1 ;;; cedet.el --- Setup CEDET environment
3 ;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 by David Ponce
5 ;; Author: David Ponce <david@dponce.com>
6 ;; Maintainer: CEDET developers <http://sf.net/projects/cedet>
7 ;; Created: 09 Dec 2002
9 ;; X-RCS: $Id: cedet.el,v 1.1 2007-11-26 15:06:40 michaels Exp $
11 ;; This file is not part of Emacs
13 ;; This program is free software; you can redistribute it and/or
14 ;; modify it under the terms of the GNU General Public License as
15 ;; published by the Free Software Foundation; either version 2, or (at
16 ;; your option) any later version.
18 ;; This program is distributed in the hope that it will be useful, but
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 ;; General Public License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with this program; see the file COPYING. If not, write to
25 ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
26 ;; Boston, MA 02110-1301, USA.
30 ;; This library automatically setups your [X]Emacs to use CEDET tools.
32 ;; First download the latest CEDET distribution, provided in a
33 ;; cedet-<VERSION>.tar.gz tarball, from the project page at:
34 ;; <http://sf.net/projects/cedet>.
36 ;; Unpack the tarball in a directory of your choice. It will install
37 ;; the following directory tree:
55 ;; Then, add the following into your ~/.emacs startup file:
57 ;; (load-file "<INSTALL-PATH>/cedet/common/cedet.el")
59 ;; If you want to turn on useful or all Semantic features by default,
62 ;; (setq semantic-load-turn-useful-things-on t)
64 ;; (setq semantic-load-turn-everything-on t)
66 ;; before loading this file, like this:
68 ;; (setq semantic-load-turn-useful-things-on t)
69 ;; (load-file "<INSTALL-PATH>/cedet/common/cedet.el")
83 (defconst cedet-version "1.0pre4"
84 "Current version of CEDET.")
86 (defconst cedet-packages
88 ;;PACKAGE MIN-VERSION INSTALLDIR
89 (cedet ,cedet-version "common" )
95 (cedet-contrib "1.0pre4" "contrib" )
97 "Table of CEDET packages to install.")
99 ;; This file must be in "<INSTALL-DIR>/cedet/common"!
100 (let ((default-directory
102 (or load-file-name (buffer-file-name)))))
104 ;; Add "<INSTALL-DIR>/cedet/common" to `load-path'.
105 (add-to-list 'load-path default-directory)
106 (message "%S added to `load-path'" default-directory)
107 ;; Require the inversion library.
110 ;; Go up to the parent "<INSTALL-DIR>/cedet" directory.
111 (let ((default-directory (expand-file-name ".."))
112 package min-version installdir)
114 ;; Add the CEDET packages subdirectories to the `load-path' if
116 (dolist (package-spec cedet-packages)
117 (setq package (nth 0 package-spec)
118 min-version (nth 1 package-spec)
119 installdir (nth 2 package-spec))
121 (setq installdir (expand-file-name installdir)))
122 (inversion-add-to-load-path package min-version installdir))
124 ;; Then run every package setup.
125 (dolist (package-spec cedet-packages)
126 (setq package (nth 0 package-spec))
127 (message "Setting up %s..." package)
130 (require (intern (format "%s-load" package)))
131 (message "Setting up %s...done" package))
133 (message "%s" (error-message-string err)))))
137 (require 'inversion))
139 (defun cedet-version ()
140 "Display all active versions of CEDET and Dependant packages.
142 The PACKAGE column is the name of a given package from CEDET.
144 REQUESTED VERSION is the version requested by the CEDET load script.
145 See `cedet-packages' for details.
147 FILE VERSION is the version number found in the source file
148 for the specificed PACKAGE.
150 LOADED VERSION is the version of PACKAGE current loaded in Emacs
151 memory and (presumably) running in this Emacs instance. Value is X
152 if the package has not been loaded."
154 (with-output-to-temp-buffer "*CEDET*"
155 (princ "CEDET Version:\t") (princ cedet-version)
156 (princ "\n \t\t\tRequested\tFile\t\tLoaded")
157 (princ "\n Package\t\tVersion\t\tVersion\t\tVersion")
158 (princ "\n ----------------------------------------------------------")
159 (let ((p cedet-packages))
161 (let ((sym (symbol-name (car (car p)))))
165 (if (< (length sym) 5)
167 (if (< (length sym) 13)
169 (let ((reqver (nth 1 (car p)))
170 (filever (car (inversion-find-version sym)))
171 (loadver (when (featurep (car (car p)))
172 (symbol-value (intern-soft (concat sym "-version"))))))
174 (if (< (length reqver) 8) (princ "\t"))
176 (if (string= filever reqver)
177 ;; I tried the words "check" and "match", but that
181 (if (< (length filever) 8) (princ "\t")))
184 (if (string= loadver reqver)
187 (princ "Not Loaded"))
190 (princ "\n\n\nC-h f cedet-version RET\n for details on output format.")
195 ;;; cedet.el ends here