changeset 106150:269b53d49dd9

* 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.
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 20 Nov 2009 01:35:49 +0000
parents 8c0ff2935e8b
children 9c5f5e4df2ac
files lisp/ChangeLog lisp/cedet/cedet.el lisp/cedet/semantic.el lisp/cedet/semantic/idle.el
diffstat 4 files changed, 35 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Nov 20 01:17:15 2009 +0000
+++ b/lisp/ChangeLog	Fri Nov 20 01:35:49 2009 +0000
@@ -1,3 +1,14 @@
+2009-11-20  Chong Yidong  <cyd@stupidchicken.com>
+
+	* 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.
+
 2009-11-20  Jay Belanger  <jay.p.belanger@gmail.com>
 
 	* calc/calc.el (calc-set-mode-line): Rename
--- a/lisp/cedet/cedet.el	Fri Nov 20 01:17:15 2009 +0000
+++ b/lisp/cedet/cedet.el	Fri Nov 20 01:35:49 2009 +0000
@@ -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-semantic-idle-scheduler-mode]   'undefined)
     (define-key map [global-semanticdb-minor-mode]          'undefined)
-    (define-key map [global-semantic-idle-scheduler-mode]   'undefined)
     (define-key map [cedet-menu-separator] 'undefined)
     (define-key map [ede-find-file]        'undefined)
     (define-key map [ede-speedbar]         'undefined)
--- a/lisp/cedet/semantic.el	Fri Nov 20 01:17:15 2009 +0000
+++ b/lisp/cedet/semantic.el	Fri Nov 20 01:35:49 2009 +0000
@@ -987,22 +987,24 @@
     '(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-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)))
   (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-semanticdb-minor-mode))))
 
 ;; The `semantic-mode' command, in conjuction with the
 ;; `semantic-default-submodes' variable, toggles Semantic's various
@@ -1029,15 +1031,14 @@
   "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))
--- a/lisp/cedet/semantic/idle.el	Fri Nov 20 01:17:15 2009 +0000
+++ b/lisp/cedet/semantic/idle.el	Fri Nov 20 01:35:49 2009 +0000
@@ -147,12 +147,18 @@
 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)