]> git.eshelyaron.com Git - emacs.git/commitdiff
* menu-bar.el: Remove ediff-misc from Tools menu.
authorChong Yidong <cyd@stupidchicken.com>
Mon, 21 Sep 2009 02:14:58 +0000 (02:14 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Mon, 21 Sep 2009 02:14:58 +0000 (02:14 +0000)
* cedet/semantic.el (semantic-init-hook)
(semantic-init-mode-hook, semantic-init-db-hook): Rename
from *-hooks, to follow hook naming conventions.
(semantic-submode-list, semantic-default-submodes): New vars.
(semantic-mode): New mode.
(semantic-parser-working-message): Add ellipses to parse message.

* cedet/semantic/bovine/c.el:
* cedet/semantic/bovine/make.el:
* cedet/semantic/bovine/scm.el:
* cedet/semantic/wisent/java-tags.el:
* cedet/semantic/wisent/javascript.el: Don't set hooks directly.
This is now done in semantic-mode.

* cedet/semantic/decorate/mode.el (global-semantic-decoration-mode):
Autoload.

* cedet/srecode/compile.el:
* cedet/srecode/insert.el:
* cedet/srecode/mode.el: Fix require statements.

16 files changed:
lisp/ChangeLog
lisp/cedet/ede/cpp-root.el
lisp/cedet/ede/pmake.el
lisp/cedet/semantic.el
lisp/cedet/semantic/bovine/c.el
lisp/cedet/semantic/bovine/make.el
lisp/cedet/semantic/bovine/scm.el
lisp/cedet/semantic/decorate/mode.el
lisp/cedet/semantic/html.el
lisp/cedet/semantic/wisent/java-tags.el
lisp/cedet/semantic/wisent/javascript.el
lisp/cedet/srecode/compile.el
lisp/cedet/srecode/insert.el
lisp/cedet/srecode/mode.el
lisp/ediff-hook.el
lisp/menu-bar.el

index 200ff032de965f69bde2c6ef11f7b7fd90e2d07e..3f4b8f705aedd18cdeadda2bb5e54a0fdb37199a 100644 (file)
@@ -1,5 +1,40 @@
+2009-09-21  Chong Yidong  <cyd@stupidchicken.com>
+
+       * menu-bar.el: Remove ediff-misc from Tools menu.
+
+       * cedet/semantic.el (semantic-init-hook)
+       (semantic-init-mode-hook, semantic-init-db-hook): Rename
+       from *-hooks, to follow hook naming conventions.
+       (semantic-submode-list, semantic-default-submodes): New vars.
+       (semantic-mode): New mode.
+       (semantic-parser-working-message): Add ellipses to parse message.
+
+       * cedet/semantic/bovine/c.el:
+       * cedet/semantic/bovine/make.el:
+       * cedet/semantic/bovine/scm.el:
+       * cedet/semantic/wisent/java-tags.el:
+       * cedet/semantic/wisent/javascript.el: Don't set hooks directly.
+       This is now done in semantic-mode.
+
+       * cedet/semantic/decorate/mode.el (global-semantic-decoration-mode):
+       Autoload.
+
+       * cedet/srecode/compile.el:
+       * cedet/srecode/insert.el:
+       * cedet/srecode/mode.el: Fix require statements.
+
 2009-09-20  Chong Yidong  <cyd@stupidchicken.com>
 
+       * cedet/semantic/decorate/mode.el (global-semantic-decoration-mode):
+       Autoload.
+
+       * cedet/ede/cpp-root.el (ede-set-project-variables): Fix featurep.
+
+       * cedet/srecode/mode.el (global-srecode-minor-mode): Fix require.
+
+       * cedet/srecode/insert.el (srecode--insert-into-buffer): Fix
+       require.
+
        * cedet/cedet.el: Require srecode.
 
        * cedet/ede/system.el: Add local vars for autoloading.
@@ -7,9 +42,11 @@
 
        * cedet/ede/pmake.el (ede-proj-makefile-create): Require
        ede/srecode.
+       (ede-proj-makefile-create): Fix require.
 
        * cedet/srecode/compile.el (srecode-compile-split-code)
        (srecode-compile-parse-inserter): Fix compiler warning.
+       (srecode-compile-templates): Fix require.
 
 2009-09-20  Chong Yidong  <cyd@stupidchicken.com>
 
index 02f86d2c856d75a9ae3f03b07bb64b69fb9af876..a922cc157828c52a391f1345c64ac5ec9d2f6f4b 100644 (file)
@@ -467,7 +467,7 @@ This is for project include paths and spp source files."
   "Set variables local to PROJECT in BUFFER.
 Also set up the lexical preprocessor map."
   (call-next-method)
-  (when (and (featurep 'semantic-c) (featurep 'semantic-lex-spp))
+  (when (and (featurep 'semantic/c) (featurep 'semantic/lex-spp))
     (setq semantic-lex-spp-project-macro-symbol-obarray
          (semantic-lex-make-spp-table (oref project spp-table)))
     ))
index 302de420543c84808a3525d053a4fb7ec9289363..348bc3e302b168619e973916c9378cd4f5d22215 100644 (file)
@@ -204,7 +204,7 @@ MFILENAME is the makefile to generate."
        ((eq (oref this makefile-type) 'Makefile.in)
        (error "Makefile.in is not supported"))
        ((eq (oref this makefile-type) 'Makefile.am)
-       (require 'ede-pconf)
+       (require 'ede/pconf)
        ;; Distribution variables
        (let ((targ (if isdist (oref this targets) mt)))
          (ede-compiler-begin-unique
index 2d38103f9ee213c60caf5ccf51142885d0d8e343..5596bda981bae9eef18fb9a76f3e8bed80fa8076 100644 (file)
@@ -255,19 +255,26 @@ setup to use Semantic."
   :group 'semantic
   :type 'hook)
 
-(defvar semantic-init-hooks nil
-  "*Hooks run when a buffer is initialized with a parsing table.")
+(defvar semantic-init-hook nil
+  "Hook run when a buffer is initialized with a parsing table.")
 
-(defvar semantic-init-mode-hooks nil
-  "*Hooks run when a buffer of a particular mode is initialized.")
-(make-variable-buffer-local 'semantic-init-mode-hooks)
+(defvar semantic-init-mode-hook nil
+  "Hook run when a buffer of a particular mode is initialized.")
+(make-variable-buffer-local 'semantic-init-mode-hook)
 
-(defvar semantic-init-db-hooks nil
-  "Hooks run when a buffer is initialized with a parsing table for DBs.
+(defvar semantic-init-db-hook nil
+  "Hook run when a buffer is initialized with a parsing table for DBs.
 This hook is for database functions which intend to swap in a tag table.
 This guarantees that the DB will go before other modes that require
 a parse of the buffer.")
 
+(define-obsolete-variable-alias 'semantic-init-hooks
+  'semantic-init-hook "23.2")
+(define-obsolete-variable-alias 'semantic-init-mode-hooks
+  'semantic-init-mode-hook "23.2")
+(define-obsolete-variable-alias 'semantic-init-db-hooks
+  'semantic-init-db-hook "23.2")
+
 (defvar semantic-new-buffer-fcn-was-run nil
   "Non nil after `semantic-new-buffer-fcn' has been executed.")
 (make-variable-buffer-local 'semantic-new-buffer-fcn-was-run)
@@ -306,17 +313,11 @@ to use Semantic, and `semantic-init-hook' is run."
     ;; Force this buffer to have its cache refreshed.
     (semantic-clear-toplevel-cache)
     ;; Call DB hooks before regular init hooks
-    (run-hooks 'semantic-init-db-hooks)
+    (run-hooks 'semantic-init-db-hook)
     ;; Set up semantic modes
-    (run-hooks 'semantic-init-hooks)
+    (run-hooks 'semantic-init-hook)
     ;; Set up major-mode specific semantic modes
-    (run-hooks 'semantic-init-mode-hooks)
-    ))
-
-(add-hook 'mode-local-init-hook 'semantic-new-buffer-fcn)
-
-;; Test the above hook.
-;;(add-hook 'semantic-init-hooks (lambda () (message "init for semantic")))
+    (run-hooks 'semantic-init-mode-hook)))
 
 (defun semantic-fetch-tags-fast ()
   "For use in a hook.  When only a partial reparse is needed, reparse."
@@ -325,9 +326,6 @@ to use Semantic, and `semantic-init-hook' is run."
          (semantic-fetch-tags))
     (error nil))
   semantic--buffer-cache)
-
-(if (boundp 'eval-defun-hooks)
-    (add-hook 'eval-defun-hooks 'semantic-fetch-tags-fast))
 \f
 ;;; Parsing Commands
 ;;
@@ -528,7 +526,7 @@ Bufferse larger than this will display the working progress bar.")
 If optional argument ARG is non-nil it is appended to the message
 string."
   (if semantic-parser-name
-      (format "%s/%s" semantic-parser-name (or arg ""))
+      (format "%s/%s..." semantic-parser-name (or arg ""))
     (format "%s" (or arg ""))))
 \f
 ;;; Application Parser Entry Points
@@ -817,10 +815,104 @@ a START and END part."
 (make-obsolete 'semantic-bovinate-from-nonterminal-full
                'semantic-parse-region)
 
+;;; User interface
+
+;; The `semantic-mode' command, in conjuction with the
+;; `semantic-default-submodes' variable, are used to collectively
+;; toggle Semantic's various auxilliary minor modes.
+
+(defvar semantic-load-system-cache-loaded nil
+  "Non nil when the Semantic system caches have been loaded.
+Prevent this load system from loading files in twice.")
+
+(defconst semantic-submode-list
+  '(global-semantic-highlight-func-mode
+    global-semantic-decoration-mode
+    global-semantic-stickyfunc-mode
+    global-semantic-idle-completions-mode
+    global-semantic-idle-scheduler-mode
+    global-semanticdb-minor-mode
+    global-semantic-idle-summary-mode
+    global-semantic-mru-bookmark-mode)
+  "List of auxilliary minor modes in the Semantic package.")
+
+;;;###autoload
+(defcustom semantic-default-submodes
+  '(global-semantic-idle-scheduler-mode global-semanticdb-minor-mode)
+  "List of auxilliary 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
+                                    keybinding for tag names."
+  :group 'semantic
+  :type `(set ,@(mapcar (lambda (c) (list 'const c))
+                       semantic-submode-list)))
+
+;;;###autoload
+(define-minor-mode semantic-mode
+  "Toggle Semantic mode.
+With ARG, turn Semantic mode on if ARG is positive, off otherwise.
+
+In Semantic mode, Emacs parses the buffers you visit for their
+semantic content.  This information is used by a variety of
+auxilliary minor modes, listed in `semantic-default-submodes';
+all the minor modes in this list are also enabled when you enable
+Semantic mode."
+  :group 'semantic
+  (if semantic-mode
+      ;; Turn on Semantic mode
+      (progn
+       (dolist (mode semantic-submode-list)
+         (if (memq mode semantic-default-submodes)
+             (funcall mode 1)))
+       (unless semantic-load-system-cache-loaded
+         (setq semantic-load-system-cache-loaded t)
+         (when (and (boundp 'semanticdb-default-system-save-directory)
+                    (stringp semanticdb-default-system-save-directory)
+                    (file-exists-p semanticdb-default-system-save-directory))
+           (semanticdb-load-ebrowse-caches)))
+       (add-hook 'mode-local-init-hook 'semantic-new-buffer-fcn)
+       ;; Add mode-local hooks
+       (add-hook 'javascript-mode-hook 'wisent-javascript-setup-parser)
+       (add-hook 'ecmascript-mode-hook 'wisent-javascript-setup-parser)
+       (add-hook 'java-mode-hook 'wisent-java-default-setup)
+       (add-hook 'scheme-mode-hook 'semantic-default-scheme-setup)
+       (add-hook 'makefile-mode-hook 'semantic-default-make-setup)
+       (add-hook 'c-mode-hook 'semantic-default-c-setup)
+       (add-hook 'c++-mode-hook 'semantic-default-c-setup)
+       (add-hook 'html-mode-hook 'semantic-default-html-setup))
+    ;; Disable all Semantic features.
+    (remove-hook 'mode-local-init-hook 'semantic-new-buffer-fcn)
+    (remove-hook 'javascript-mode-hook 'wisent-javascript-setup-parser)
+    (remove-hook 'ecmascript-mode-hook 'wisent-javascript-setup-parser)
+    (remove-hook 'java-mode-hook 'wisent-java-default-setup)
+    (remove-hook 'scheme-mode-hook 'semantic-default-scheme-setup)
+    (remove-hook 'makefile-mode-hook 'semantic-default-make-setup)
+    (remove-hook 'c-mode-hook 'semantic-default-c-setup)
+    (remove-hook 'c++-mode-hook 'semantic-default-c-setup)
+    (remove-hook 'html-mode-hook 'semantic-default-html-setup)
+
+    ;; FIXME: handle semanticdb-load-ebrowse-caches
+
+    (dolist (mode semantic-submode-list)
+      (if (and (boundp mode) (eval mode))
+         (funcall mode -1)))))
+
+
 (provide 'semantic)
 
 ;; Semantic-util is a part of the semantic API.  Include it last
 ;; because it depends on semantic.
 (require 'semantic/util)
 
+;; (require 'semantic/load)
+
 ;;; semantic.el ends here
index 5ab658d6af7379c13b2690b7047238520d3710b1..f49d569c43e89466585e775c2e7ec8a9143d751b 100644 (file)
@@ -1629,11 +1629,6 @@ DO NOT return the list of tags encompassing point."
   (semantic-c-reset-preprocessor-symbol-map)
   )
 
-;;;###autoload
-(add-hook 'c-mode-hook 'semantic-default-c-setup)
-;;;###autoload
-(add-hook 'c++-mode-hook 'semantic-default-c-setup)
-
 ;;; SETUP QUERY
 ;;
 (defun semantic-c-describe-environment ()
index 1686ef2aa152cdc3ea0e8eacb9ce044d94724d89..ac7d084a384e0bd228ca44bca8f537a63212acd6 100644 (file)
@@ -230,9 +230,6 @@ Uses default implementation, and also gets a list of filenames."
   (setq semantic-lex-analyzer #'semantic-make-lexer)
   )
 
-;;;###autoload
-(add-hook 'makefile-mode-hook 'semantic-default-make-setup)
-
 (provide 'semantic/bovine/make)
 
 ;; Local variables:
index 3558062d61df0ab786599556894cad486fa1c2fb..091486cc382d20ac0a5bd7328b402562855ff2c0 100644 (file)
@@ -110,9 +110,6 @@ syntax as specified by the syntax table."
   (setq semantic-lex-analyzer #'semantic-scheme-lexer)
   )
 
-;;;###autoload
-(add-hook 'scheme-mode-hook 'semantic-default-scheme-setup)
-
 (provide 'semantic/bovine/scm)
 
 ;; Local variables:
index a02d4c388fb6c5fd2dffe853e5d7c51f761fe05e..c35df575812fce3c722ec8f6670b78bd8b4f76f9 100644 (file)
@@ -234,6 +234,7 @@ When this mode is activated, decorations specified by
   :set (lambda (sym val)
          (global-semantic-decoration-mode (if val 1 -1))))
 
+;;;###autoload
 (defun global-semantic-decoration-mode (&optional arg)
   "Toggle global use of option `semantic-decoration-mode'.
 Decoration mode turns on all active decorations as specified
@@ -558,5 +559,10 @@ Use a primary decoration."
 
 (provide 'semantic/decorate/mode)
 
-;;; semantic/decorate/mode.el ends here
+;; Local variables:
+;; generated-autoload-file: "../loaddefs.el"
+;; generated-autoload-feature: semantic/loaddefs
+;; generated-autoload-load-name: "semantic/decorate/mode"
+;; End:
 
+;;; semantic/decorate/mode.el ends here
index 5ed7908f8939068f890d099f02a229d546653888..0ce3ed710b0e9cf387aafcc09f06aef94a6287a6 100644 (file)
@@ -254,9 +254,6 @@ tag with greater section value than LEVEL is found."
    t)
   )
 
-;;;###autoload
-(add-hook 'html-mode-hook 'semantic-default-html-setup)
-
 (define-child-mode html-helper-mode html-mode
   "`html-helper-mode' needs the same semantic support as `html-mode'.")
 
index ff5e0634d96ed2d301aef92ccdc3dd16a812228f..5a9d8c398b4efb03948f5bb8515b287fe76e7a25 100644 (file)
@@ -111,9 +111,6 @@ Use the alternate LALR(1) parser."
   ;; Setup javadoc stuff
   (semantic-java-doc-setup))
 
-;;;###autoload
-(add-hook 'java-mode-hook 'wisent-java-default-setup)
-
 (provide 'semantic/wisent/java-tags)
 
 ;; Local variables:
index 184f1eaf5468f03a43693f9c74cf939dd51ba645..892f76be4f019c629d71d1299f6588c14a998c09 100644 (file)
@@ -92,11 +92,6 @@ This function overrides `get-local-variables'."
    semantic-command-separation-character ";"
    ))
 
-;;;###autoload
-(add-hook 'javascript-mode-hook 'wisent-javascript-setup-parser)
-;;;###autoload
-(add-hook 'ecmascript-mode-hook 'wisent-javascript-setup-parser)
-
 (provide 'semantic/wisent/javascript-jv)
 
 ;; Local variables:
index 769c0137e68b271e474c3ba7633d4e7842586eb6..5b3d8fb50fc907e73988c10ebf7d18e432f7657a 100644 (file)
@@ -197,7 +197,7 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
 (defun srecode-compile-templates ()
   "Compile a semantic recode template file into a mode-local variable."
   (interactive)
-  (require 'srecode-insert)
+  (require 'srecode/insert)
   (message "Compiling template %s..."
           (file-name-nondirectory (buffer-file-name)))
   (let ((tags (semantic-fetch-tags))
index 743c8e8e6525614ae1430a393c5c33f1c3fbf77f..e1772b3c5789fa3d5fa4930384b0f59a0a075272 100644 (file)
@@ -159,7 +159,7 @@ Buffer based features related to change hooks is handled one level up."
   ;; while the field insert tool is loaded via autoloads during
   ;; the insert.
   (when (eq srecode-insert-ask-variable-method 'field)
-    (require 'srecode-fields))
+    (require 'srecode/fields))
 
   (let ((srecode-field-archive nil) ; Prevent field leaks during insert
        (start (point)) ; Beginning of the region.
index 3100a392cf270672a7d6bf3769472295007f3540..f8493138e494520fe627cfedae6d2db7017c4b65 100644 (file)
@@ -42,7 +42,7 @@
   "Non-nil in buffers with Semantic Recoder macro keybindings."
   :group 'srecode
   :type 'boolean
-  :require 'srecode-mode
+  :require 'srecode/mode
   :initialize 'custom-initialize-default
   :set (lambda (sym val)
          (global-srecode-minor-mode (if val 1 -1))))
index 00525b6fe440b25cac97069f0091293b3eed6f65..f2b3e0d437f4d1ac67016fc3be051fda8e91e20b 100644 (file)
           :style toggle
           :selected (if (featurep 'ediff-tbar)
                         (ediff-use-toolbar-p))]))
-      
+
       ;; put these menus before Object-Oriented-Browser in Tools menu
       (if (and (featurep 'menubar) (not (featurep 'infodock))
               (not (featurep 'ediff-hook)))
        (symbol-value 'menu-bar-ediff-merge-menu))
   (defvar menu-bar-ediff-menu (make-sparse-keymap "Compare"))
   (fset 'menu-bar-ediff-menu (symbol-value 'menu-bar-ediff-menu))
-  
+
   ;; define ediff compare menu
+  (define-key menu-bar-ediff-menu [ediff-misc]
+    (list 'menu-item "Ediff Miscellanea" menu-bar-ediff-misc-menu))
+  (define-key menu-bar-ediff-menu [separator-ediff-misc] '("--"))
   (define-key menu-bar-ediff-menu [window]
     '(menu-item "This Window and Next Window" compare-windows
                :help "Compare the current window and the next window"))
index 24fd88e6819b1e65161e4b7a03f8331dd1faaa59..e3aa7bc04b8b0d437003c82d97d5cf6de60a3073 100644 (file)
@@ -1312,8 +1312,6 @@ mail status in mode line"))
 (define-key menu-bar-tools-menu [separator-compare]
   '("--"))
 
-(define-key menu-bar-tools-menu [ediff-misc]
-  '(menu-item "Ediff Miscellanea" menu-bar-ediff-misc-menu))
 (define-key menu-bar-tools-menu [epatch]
   '(menu-item "Apply Patch" menu-bar-epatch-menu))
 (define-key menu-bar-tools-menu [ediff-merge]