cedet-cscope.el, cedet-edebug.el, cedet-global.el, cedet-idutils.el,
[bpt/emacs.git] / lisp / cedet / cedet.el
1 ;;; cedet.el --- Setup CEDET environment
2
3 ;;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
4 ;;; Free Software Foundation, Inc.
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:
27 ;;
28 ;; This library automatically setups your [X]Emacs to use CEDET tools.
29 ;;
30 ;; (require 'cedet)
31 ;;
32 ;; If you want to turn on useful or all Semantic features by default,
33 ;; respectively add:
34 ;;
35 ;; (setq semantic-load-turn-useful-things-on t)
36 ;; or
37 ;; (setq semantic-load-turn-everything-on t)
38 ;;
39 ;; before loading this file, like this:
40 ;;
41 ;; (setq semantic-load-turn-useful-things-on t)
42 ;; (require 'cedet)
43 ;;
44 ;; That's it!
45
46 ;;; Code:
47
48 (eval-when-compile
49 (require 'cl))
50
51 (defconst cedet-version "1.0pre7"
52 "Current version of CEDET.")
53
54 (require 'eieio)
55 ;; (require 'semantic)
56 ;; (require 'srecode)
57 ;; (require 'ede)
58 (require 'speedbar)
59
60 (defconst cedet-packages
61 `(
62 ;;PACKAGE MIN-VERSION
63 (cedet ,cedet-version)
64 (eieio "1.2")
65 (semantic "2.0pre7")
66 (srecode "0.2")
67 (ede "1.0pre7")
68 (speedbar "1.0.3"))
69 "Table of CEDET packages to install.")
70
71 (declare-function inversion-find-version "inversion")
72
73 (defun cedet-version ()
74 "Display all active versions of CEDET and Dependant packages.
75
76 The PACKAGE column is the name of a given package from CEDET.
77
78 REQUESTED VERSION is the version requested by the CEDET load script.
79 See `cedet-packages' for details.
80
81 FILE VERSION is the version number found in the source file
82 for the specificed PACKAGE.
83
84 LOADED VERSION is the version of PACKAGE current loaded in Emacs
85 memory and (presumably) running in this Emacs instance. Value is X
86 if the package has not been loaded."
87 (interactive)
88 (require 'inversion)
89 (with-output-to-temp-buffer "*CEDET*"
90 (princ "CEDET Version:\t") (princ cedet-version)
91 (princ "\n \t\t\tRequested\tFile\t\tLoaded")
92 (princ "\n Package\t\tVersion\t\tVersion\t\tVersion")
93 (princ "\n ----------------------------------------------------------")
94 (let ((p cedet-packages))
95 (while p
96 (let ((sym (symbol-name (car (car p)))))
97 (princ "\n ")
98 (princ sym)
99 (princ ":\t")
100 (if (< (length sym) 5)
101 (princ "\t"))
102 (if (< (length sym) 13)
103 (princ "\t"))
104 (let ((reqver (nth 1 (car p)))
105 (filever (car (inversion-find-version sym)))
106 (loadver (when (featurep (car (car p)))
107 (symbol-value (intern-soft (concat sym "-version"))))))
108 (princ reqver)
109 (if (< (length reqver) 8) (princ "\t"))
110 (princ "\t")
111 (if (string= filever reqver)
112 ;; I tried the words "check" and "match", but that
113 ;; just looked lame.
114 (princ "ok\t")
115 (princ filever)
116 (if (< (length filever) 8) (princ "\t")))
117 (princ "\t")
118 (if loadver
119 (if (string= loadver reqver)
120 (princ "ok")
121 (princ loadver))
122 (princ "Not Loaded"))
123 ))
124 (setq p (cdr p))))
125 (princ "\n\n\nC-h f cedet-version RET\n for details on output format.")
126 ))
127
128 (provide 'cedet)
129
130 ;;; cedet.el ends here