Commit ebf5c4f5 authored by Chong Yidong's avatar Chong Yidong
Browse files

* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu

items.

* cedet/cedet.el (cedet-menu-map): Remove Semantic and EDE menu
items.

* cedet/ede.el (ede-minor-mode):
* cedet/semantic.el (semantic-mode): Toggle menu separators.
parent c38eb027
2009-10-31 Chong Yidong <cyd@stupidchicken.com>
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
items.
* cedet/cedet.el (cedet-menu-map): Remove Semantic and EDE menu
items.
* cedet/ede.el (ede-minor-mode):
* cedet/semantic.el (semantic-mode): Toggle menu separators.
2009-10-31 Stefan Monnier <monnier@iro.umontreal.ca>
* textmodes/two-column.el (2C-split):
......
......@@ -63,17 +63,7 @@
(define-key map [global-semantic-idle-summary-mode] 'undefined)
(define-key map [global-semanticdb-minor-mode] 'undefined)
(define-key map [global-semantic-idle-scheduler-mode] 'undefined)
(define-key map [semantic-menu-separator] '("--"))
(define-key map [semantic-mode]
'(menu-item "Enable Parsers (Semantic)" semantic-mode
:help "Enable language parsers (Semantic)"
:visible (not (bound-and-true-p semantic-mode))))
(define-key map [cedet-menu-separator] 'undefined)
(define-key map [ede-mode]
'(menu-item "Enable Project Support (EDE)" global-ede-mode
:help "Enable the Emacs Development Environment (EDE)"
:visible (not (bound-and-true-p global-ede-mode))))
(define-key map [ede-menu-separator] '("--"))
(define-key map [ede-find-file] 'undefined)
(define-key map [ede-speedbar] 'undefined)
(define-key map [ede] 'undefined)
......
......@@ -585,27 +585,31 @@ Argument LIST-O-O is the list of objects to choose from."
;; Activate the EDE items in cedet-menu-map
(define-key cedet-menu-map [ede-find-file]
'(menu-item "Find File in Project..." ede-find-file :enable ede-object))
'(menu-item "Find File in Project..." ede-find-file :enable ede-object
:visible global-ede-mode))
(define-key cedet-menu-map [ede-speedbar]
'(menu-item "View Project Tree" ede-speedbar :enable ede-object))
'(menu-item "View Project Tree" ede-speedbar :enable ede-object
:visible global-ede-mode))
(define-key cedet-menu-map [ede]
'(menu-item "Load Project" ede))
'(menu-item "Load Project" ede
:visible global-ede-mode))
(define-key cedet-menu-map [ede-new]
'(menu-item "Create Project" ede-new
:enable (not ede-object)))
:enable (not ede-object)
:visible global-ede-mode))
(define-key cedet-menu-map [ede-target-options]
'(menu-item "Target Options" ede-target-options
:filter ede-target-forms-menu))
:filter ede-target-forms-menu
:visible global-ede-mode))
(define-key cedet-menu-map [ede-project-options]
'(menu-item "Project Options" ede-project-options
:filter ede-project-forms-menu))
:filter ede-project-forms-menu
:visible global-ede-mode))
(define-key cedet-menu-map [ede-build-forms-menu]
'(menu-item "Build Project" ede-build-forms-menu
:filter ede-build-forms-menu
:enable ede-object))
(define-key cedet-menu-map [semantic-menu-separator] 'undefined)
(define-key cedet-menu-map [cedet-menu-separator] 'undefined)
(define-key cedet-menu-map [ede-menu-separator] '("--"))
:enable ede-object
:visible global-ede-mode))
(defun ede-menu-obj-of-class-p (class)
"Return non-nil if some member of `ede-object' is a child of CLASS."
......@@ -841,6 +845,8 @@ an EDE controlled project."
(if global-ede-mode
;; Turn on global-ede-mode
(progn
(if semantic-mode
(define-key cedet-menu-map [cedet-menu-separator] '("--")))
(add-hook 'semanticdb-project-predicate-functions 'ede-directory-project-p)
(add-hook 'semanticdb-project-root-functions 'ede-toplevel-project-or-nil)
(add-hook 'ecb-source-path-functions 'ede-ecb-project-paths)
......@@ -850,6 +856,7 @@ an EDE controlled project."
(ede-load-cache)
(ede-reset-all-buffers 1))
;; Turn off global-ede-mode
(define-key cedet-menu-map [cedet-menu-separator] nil)
(remove-hook 'semanticdb-project-predicate-functions 'ede-directory-project-p)
(remove-hook 'semanticdb-project-root-functions 'ede-toplevel-project-or-nil)
(remove-hook 'ecb-source-path-functions 'ede-ecb-project-paths)
......
......@@ -1002,10 +1002,7 @@ Throw away all the old tags, and recreate the tag database."
'(menu-item "Reparse When Idle" global-semantic-idle-scheduler-mode
:help "Keep a buffer's parse tree up to date when idle"
:visible semantic-mode
:button (:toggle . global-semantic-idle-scheduler-mode)))
(define-key cedet-menu-map [ede-menu-separator] 'undefined)
(define-key cedet-menu-map [cedet-menu-separator] 'undefined)
(define-key cedet-menu-map [semantic-menu-separator] '("--")))
:button (:toggle . global-semantic-idle-scheduler-mode))))
;; The `semantic-mode' command, in conjuction with the
;; `semantic-default-submodes' variable, toggles Semantic's various
......@@ -1076,11 +1073,15 @@ Semantic mode.
(require 'semantic/db-ebrowse)
(semanticdb-load-ebrowse-caches)))
(add-hook 'mode-local-init-hook 'semantic-new-buffer-fcn)
(if global-ede-mode
(define-key cedet-menu-map [cedet-menu-separator] '("--")))
(dolist (b (buffer-list))
(with-current-buffer b
(semantic-new-buffer-fcn))))
;; Disable all Semantic features.
(remove-hook 'mode-local-init-hook 'semantic-new-buffer-fcn)
(define-key cedet-menu-map [cedet-menu-separator] nil)
(define-key cedet-menu-map [semantic-options-separator] nil)
;; FIXME: handle semanticdb-load-ebrowse-caches
(dolist (mode semantic-submode-list)
(if (and (boundp mode) (eval mode))
......
......@@ -1326,6 +1326,18 @@ mail status in mode line"))
(define-key menu-bar-tools-menu [separator-prog]
'("--"))
(define-key menu-bar-tools-menu [semantic]
`(menu-item ,(purecopy "Source Code Parsers (Semantic)")
semantic-mode
:help ,(purecopy "Toggle automatic parsing in source code buffers (Semantic mode)")
:button (:toggle . (bound-and-true-p semantic-mode))))
(define-key menu-bar-tools-menu [ede]
`(menu-item ,(purecopy "Project support (EDE)")
global-ede-mode
:help ,(purecopy "Toggle the Emacs Development Environment (Global EDE mode)")
:button (:toggle . (bound-and-true-p global-ede-mode))))
(define-key menu-bar-tools-menu [gdb]
`(menu-item ,(purecopy "Debugger (GDB)...") gdb
:help ,(purecopy "Debug a program from within Emacs with GDB")))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment