Doc/message fixes.
[bpt/emacs.git] / lisp / cedet / cedet.el
CommitLineData
b2b35d56
CY
1;;; cedet.el --- Setup CEDET environment
2
bd2afec2
GM
3;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
4;; Free Software Foundation, Inc.
b2b35d56
CY
5
6;; Author: David Ponce <david@dponce.com>
7;; Maintainer: Eric M. Ludlam <zappo@gnu.org>
8;; Version: 0.2
9;; Keywords: OO, lisp
10
11;; This file is part of GNU Emacs.
12
13;; GNU Emacs is free software: you can redistribute it and/or modify
14;; it under the terms of the GNU General Public License as published by
15;; the Free Software Foundation, either version 3 of the License, or
16;; (at your option) any later version.
17
18;; GNU Emacs is distributed in the hope that it will be useful,
19;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;; GNU General Public License for more details.
22
23;; You should have received a copy of the GNU General Public License
24;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25
26;;; Commentary:
a964f5e5
CY
27
28;;; Code:
b2b35d56 29;;
826608a5
CY
30;; This file depends on the major components of CEDET, so that you can
31;; load them all by doing (require 'cedet). This is mostly for
32;; compatibility with the upstream, stand-alone CEDET distribution.
b2b35d56
CY
33
34(eval-when-compile
35 (require 'cl))
36
715f35a5
CY
37(declare-function inversion-find-version "inversion")
38
b2b35d56
CY
39(defconst cedet-version "1.0pre7"
40 "Current version of CEDET.")
41
b2b35d56
CY
42(defconst cedet-packages
43 `(
44 ;;PACKAGE MIN-VERSION
45 (cedet ,cedet-version)
46 (eieio "1.2")
47 (semantic "2.0pre7")
aa8724ae 48 (srecode "1.0pre7")
b2b35d56
CY
49 (ede "1.0pre7")
50 (speedbar "1.0.3"))
51 "Table of CEDET packages to install.")
52
715f35a5
CY
53(defvar cedet-menu-map ;(make-sparse-keymap "CEDET menu")
54 (let ((map (make-sparse-keymap "CEDET menu")))
55 (define-key map [semantic-force-refresh] 'undefined)
56 (define-key map [semantic-edit-menu] 'undefined)
57 (define-key map [navigate-menu] 'undefined)
58 (define-key map [semantic-options-separator] 'undefined)
59 (define-key map [global-semantic-highlight-func-mode] 'undefined)
60 (define-key map [global-semantic-highlight-func-mode] 'undefined)
61 (define-key map [global-semantic-decoration-mode] 'undefined)
62 (define-key map [global-semantic-idle-completions-mode] 'undefined)
63 (define-key map [global-semantic-idle-summary-mode] 'undefined)
64 (define-key map [global-semanticdb-minor-mode] 'undefined)
65 (define-key map [global-semantic-idle-scheduler-mode] 'undefined)
66 (define-key map [semantic-menu-separator] '("--"))
67 (define-key map [semantic-mode]
a2095e2e 68 '(menu-item "Enable Parsers (Semantic)" semantic-mode
715f35a5
CY
69 :help "Enable language parsers (Semantic)"
70 :visible (not (bound-and-true-p semantic-mode))))
71 (define-key map [cedet-menu-separator] 'undefined)
72 (define-key map [ede-mode]
a2095e2e 73 '(menu-item "Enable Project Support (EDE)" global-ede-mode
715f35a5
CY
74 :help "Enable the Emacs Development Environment (EDE)"
75 :visible (not (bound-and-true-p global-ede-mode))))
76 (define-key map [ede-menu-separator] '("--"))
77 (define-key map [ede-find-file] 'undefined)
78 (define-key map [ede-speedbar] 'undefined)
79 (define-key map [ede] 'undefined)
80 (define-key map [ede-new] 'undefined)
81 (define-key map [ede-target-options] 'undefined)
82 (define-key map [ede-project-options] 'undefined)
83 (define-key map [ede-build-forms-menu] 'undefined)
84 map)
85 "Menu keymap for the CEDET package.
86This is used by `semantic-mode' and `global-ede-mode'.")
b2b35d56
CY
87
88(defun cedet-version ()
89 "Display all active versions of CEDET and Dependant packages.
90
91The PACKAGE column is the name of a given package from CEDET.
92
93REQUESTED VERSION is the version requested by the CEDET load script.
94See `cedet-packages' for details.
95
96FILE VERSION is the version number found in the source file
bd2afec2 97for the specified PACKAGE.
b2b35d56
CY
98
99LOADED VERSION is the version of PACKAGE current loaded in Emacs
100memory and (presumably) running in this Emacs instance. Value is X
101if the package has not been loaded."
102 (interactive)
103 (require 'inversion)
104 (with-output-to-temp-buffer "*CEDET*"
105 (princ "CEDET Version:\t") (princ cedet-version)
106 (princ "\n \t\t\tRequested\tFile\t\tLoaded")
107 (princ "\n Package\t\tVersion\t\tVersion\t\tVersion")
108 (princ "\n ----------------------------------------------------------")
109 (let ((p cedet-packages))
110 (while p
111 (let ((sym (symbol-name (car (car p)))))
112 (princ "\n ")
113 (princ sym)
114 (princ ":\t")
115 (if (< (length sym) 5)
116 (princ "\t"))
117 (if (< (length sym) 13)
118 (princ "\t"))
119 (let ((reqver (nth 1 (car p)))
120 (filever (car (inversion-find-version sym)))
121 (loadver (when (featurep (car (car p)))
122 (symbol-value (intern-soft (concat sym "-version"))))))
123 (princ reqver)
124 (if (< (length reqver) 8) (princ "\t"))
125 (princ "\t")
126 (if (string= filever reqver)
127 ;; I tried the words "check" and "match", but that
128 ;; just looked lame.
129 (princ "ok\t")
130 (princ filever)
131 (if (< (length filever) 8) (princ "\t")))
132 (princ "\t")
133 (if loadver
134 (if (string= loadver reqver)
135 (princ "ok")
136 (princ loadver))
137 (princ "Not Loaded"))
138 ))
139 (setq p (cdr p))))
140 (princ "\n\n\nC-h f cedet-version RET\n for details on output format.")
141 ))
142
143(provide 'cedet)
144
145;;; cedet.el ends here