cedet.el 4.7 KB

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