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