summaryrefslogtreecommitdiff
path: root/lisp/cedet
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2009-11-20 01:35:49 +0000
committerChong Yidong <cyd@stupidchicken.com>2009-11-20 01:35:49 +0000
commit51dc79a2330b3a2c7e1d4b526a571eaa1a1a6b4e (patch)
tree8b41c54839855340a5caf7e76145c62c6594349b /lisp/cedet
parent5ca2edf871a89d1f7b85b5cb1ab6d907b5acd97d (diff)
downloademacs-51dc79a2330b3a2c7e1d4b526a571eaa1a1a6b4e.tar.gz
* cedet/cedet.el (cedet-menu-map): Re-order menu items.
* cedet/semantic.el: Enable idle-mode menu items only if global-semantic-idle-scheduler-mode is enabled. (semantic-default-submodes): Doc fix. * cedet/semantic/idle.el (global-semantic-idle-scheduler-mode): When turning off, disable other idle modes.
Diffstat (limited to 'lisp/cedet')
-rw-r--r--lisp/cedet/cedet.el2
-rw-r--r--lisp/cedet/semantic.el31
-rw-r--r--lisp/cedet/semantic/idle.el8
3 files changed, 24 insertions, 17 deletions
diff --git a/lisp/cedet/cedet.el b/lisp/cedet/cedet.el
index a2725989731..4bf598abdae 100644
--- a/lisp/cedet/cedet.el
+++ b/lisp/cedet/cedet.el
@@ -61,8 +61,8 @@
(define-key map [global-semantic-decoration-mode] 'undefined)
(define-key map [global-semantic-idle-completions-mode] 'undefined)
(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 [global-semanticdb-minor-mode] 'undefined)
(define-key map [cedet-menu-separator] 'undefined)
(define-key map [ede-find-file] 'undefined)
(define-key map [ede-speedbar] 'undefined)
diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el
index 08a93e3f69f..446d1e0a3e6 100644
--- a/lisp/cedet/semantic.el
+++ b/lisp/cedet/semantic.el
@@ -987,22 +987,24 @@ Throw away all the old tags, and recreate the tag database."
'(menu-item "Show Tag Completions" global-semantic-idle-completions-mode
:help "Show tag completions when idle"
:visible semantic-mode
+ :enable global-semantic-idle-scheduler-mode
:button (:toggle . global-semantic-idle-completions-mode)))
(define-key cedet-menu-map [global-semantic-idle-summary-mode]
'(menu-item "Show Tag Summaries" global-semantic-idle-summary-mode
:help "Show tag summaries when idle"
:visible semantic-mode
+ :enable global-semantic-idle-scheduler-mode
:button (:toggle . global-semantic-idle-summary-mode)))
- (define-key cedet-menu-map [global-semanticdb-minor-mode]
- '(menu-item "Semantic Database" global-semanticdb-minor-mode
- :help "Store tag information in a database"
- :visible semantic-mode
- :button (:toggle . global-semanticdb-minor-mode)))
(define-key cedet-menu-map [global-semantic-idle-scheduler-mode]
'(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))))
+ :button (:toggle . global-semantic-idle-scheduler-mode)))
+ (define-key cedet-menu-map [global-semanticdb-minor-mode]
+ '(menu-item "Semantic Database" global-semanticdb-minor-mode
+ :help "Store tag information in a database"
+ :visible semantic-mode
+ :button (:toggle . global-semanticdb-minor-mode))))
;; The `semantic-mode' command, in conjuction with the
;; `semantic-default-submodes' variable, toggles Semantic's various
@@ -1029,15 +1031,14 @@ Prevent this load system from loading files in twice.")
"List of auxiliary Semantic minor modes enabled by `semantic-mode'.
The possible elements of this list include the following:
- `semantic-highlight-func-mode' - Highlight the current tag.
- `semantic-decoration-mode' - Decorate tags based on various attributes.
- `semantic-stickyfunc-mode' - Track current function in the header-line.
- `semantic-idle-completions-mode' - Provide smart symbol completion
- automatically when idle.
- `semantic-idle-scheduler-mode' - Keep a buffer's parse tree up to date.
- `semanticdb-minor-mode' - Store tags when a buffer is not in memory.
- `semantic-idle-summary-mode' - Show a summary for the code at point.
- `semantic-mru-bookmark-mode' - Provide `switch-to-buffer'-like
+ `global-semanticdb-minor-mode' - Maintain tag database.
+ `global-semantic-idle-scheduler-mode' - Reparse buffer when idle.
+ `global-semantic-idle-summary-mode' - Show summary of tag at point.
+ `global-semantic-idle-completions-mode' - Show completions when idle.
+ `global-semantic-decoration-mode' - Additional tag decorations.
+ `global-semantic-highlight-func-mode' - Highlight the current tag.
+ `global-semantic-stickyfunc-mode' - Show current fun in header line.
+ `global-semantic-mru-bookmark-mode' - Provide `switch-to-buffer'-like
keybinding for tag names."
:group 'semantic
:type `(set ,@(mapcar (lambda (c) (list 'const c))
diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el
index e8be0bb97eb..7f5915064b2 100644
--- a/lisp/cedet/semantic/idle.el
+++ b/lisp/cedet/semantic/idle.el
@@ -147,12 +147,18 @@ and then schedule other jobs setup with `semantic-idle-scheduler-add'.
If ARG is positive, enable, if it is negative, disable.
If ARG is nil, then toggle."
(interactive "P")
+ ;; When turning off, disable other idle modes.
+ (when (or (and (numberp arg) (< arg 0))
+ (and (null arg) global-semantic-idle-scheduler-mode))
+ (global-semantic-idle-summary-mode -1)
+ (global-semantic-idle-tag-highlight-mode -1)
+ (global-semantic-idle-completions-mode -1))
(setq global-semantic-idle-scheduler-mode
(semantic-toggle-minor-mode-globally
'semantic-idle-scheduler-mode arg)))
(defcustom semantic-idle-scheduler-mode-hook nil
- "Hook run at the end of function `semantic-idle-scheduler-mode'."
+ "Hook run at the end of the function `semantic-idle-scheduler-mode'."
:group 'semantic
:type 'hook)