diff options
| author | Chong Yidong | 2009-09-26 17:47:11 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-09-26 17:47:11 +0000 |
| commit | 29e1a603c0d7fa1e4e2c116cbaab90d0401f898b (patch) | |
| tree | ac94b65e2de818951c17cd1cb77d03e32418f158 | |
| parent | 17e1f4bc65ff059a6f05068dc2d64d7130719fd7 (diff) | |
| download | emacs-29e1a603c0d7fa1e4e2c116cbaab90d0401f898b.tar.gz emacs-29e1a603c0d7fa1e4e2c116cbaab90d0401f898b.zip | |
* cedet/semantic/lex.el (semantic-lex-reset-hooks): Doc fix.
* cedet/semantic/idle.el
(semantic-before-idle-scheduler-reparse-hook)
(semantic-after-idle-scheduler-reparse-hook): Rename from *-hooks.
Make old name an obsolete alias.
* cedet/semantic/edit.el (semantic-after-partial-cache-change-hook)
(semantic-change-hooks, semantic-edits-new-change-hooks)
(semantic-edits-delete-change-hooks)
(semantic-edits-move-change-hook)
(semantic-edits-reparse-change-hooks)
(semantic-edits-incremental-reparse-failed-hooks): Doc fixes.
* cedet/semantic/debug.el (semantic-debug-mode): Rename hook
symbols.
* cedet/semantic/db-mode.el (semanticdb-mode-hook): Rename from
semanticdb-mode-hooks.
(global-semanticdb-minor-mode): Use the new name.
(semanticdb-hooks): Use semantic-init-db-hook instead of obsolete
alias semantic-init-db-hooks.
* cedet/semantic/db-global.el (semanticdb-enable-gnu-global-databases):
Use semantic-init-hook instead of obsolete alias
semantic-init-hooks.
* cedet/semantic/db-file.el (semanticdb-save-database-hook):
Rename from semanticdb-save-database-hooks. Make old name an
obsolete alias.
* cedet/semantic/decorate/mode.el
(semantic-decorate-pending-decoration-hook): Rename from
semantic-decorate-pending-decoration-hooks. Make old name an
obsolete alias.
* cedet/srecode/map.el (srecode-map-validate-file-for-mode): Use
semantic-init-hook instead of obsolete alias semantic-init-hooks.
* cedet/semantic/fw.el (semantic-find-file-noselect): Use
semantic-init-hook instead of obsolete alias semantic-init-hooks.
* cedet/ede/project-am.el (project-am-with-makefile-current): Use
semantic-init-hook instead of obsolete alias semantic-init-hooks.
* cedet/semantic/util.el (semantic-describe-buffer): Use
semantic-init-hook and semantic-init-db-hook instead of obsolete
aliases.
* cedet/semantic/util-modes.el (semantic-mode-line-update)
(semantic-toggle-minor-mode-globally): Use semantic-init-hook
instead of obsolete alias semantic-init-hooks.
Synch to Eric M. Ludlam's upstream CEDET repository:
* cedet/semantic/bovine/c.el (semantic-c-parse-token-hack-depth):
New var.
(semantic-c-parse-lexical-token): Save match data when setting up
the secondary parse buffer. Allow recursion. Protect against
initializing the major mode from throwing errors, ie user hooks.
* cedet/semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Protect installing a major mode from throwing errors.
| -rw-r--r-- | lisp/ChangeLog | 68 | ||||
| -rw-r--r-- | lisp/cedet/ede/project-am.el | 2 | ||||
| -rw-r--r-- | lisp/cedet/semantic/bovine/c.el | 39 | ||||
| -rw-r--r-- | lisp/cedet/semantic/db-file.el | 15 | ||||
| -rw-r--r-- | lisp/cedet/semantic/db-global.el | 4 | ||||
| -rw-r--r-- | lisp/cedet/semantic/db-mode.el | 14 | ||||
| -rw-r--r-- | lisp/cedet/semantic/debug.el | 4 | ||||
| -rw-r--r-- | lisp/cedet/semantic/decorate/mode.el | 14 | ||||
| -rw-r--r-- | lisp/cedet/semantic/edit.el | 16 | ||||
| -rw-r--r-- | lisp/cedet/semantic/fw.el | 2 | ||||
| -rw-r--r-- | lisp/cedet/semantic/idle.el | 30 | ||||
| -rw-r--r-- | lisp/cedet/semantic/lex-spp.el | 7 | ||||
| -rw-r--r-- | lisp/cedet/semantic/lex.el | 7 | ||||
| -rw-r--r-- | lisp/cedet/semantic/util-modes.el | 12 | ||||
| -rw-r--r-- | lisp/cedet/semantic/util.el | 7 | ||||
| -rw-r--r-- | lisp/cedet/srecode/map.el | 2 |
16 files changed, 177 insertions, 66 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 132e4f117ff..6ecba8b0956 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,71 @@ | |||
| 1 | 2009-09-26 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * cedet/semantic/lex.el (semantic-lex-reset-hooks): Doc fix. | ||
| 4 | |||
| 5 | * cedet/semantic/idle.el | ||
| 6 | (semantic-before-idle-scheduler-reparse-hook) | ||
| 7 | (semantic-after-idle-scheduler-reparse-hook): Rename from *-hooks. | ||
| 8 | Make old name an obsolete alias. | ||
| 9 | |||
| 10 | * cedet/semantic/edit.el (semantic-after-partial-cache-change-hook) | ||
| 11 | (semantic-change-hooks, semantic-edits-new-change-hooks) | ||
| 12 | (semantic-edits-delete-change-hooks) | ||
| 13 | (semantic-edits-move-change-hook) | ||
| 14 | (semantic-edits-reparse-change-hooks) | ||
| 15 | (semantic-edits-incremental-reparse-failed-hooks): Doc fixes. | ||
| 16 | |||
| 17 | * cedet/semantic/debug.el (semantic-debug-mode): Rename hook | ||
| 18 | symbols. | ||
| 19 | |||
| 20 | * cedet/semantic/db-mode.el (semanticdb-mode-hook): Rename from | ||
| 21 | semanticdb-mode-hooks. | ||
| 22 | (global-semanticdb-minor-mode): Use the new name. | ||
| 23 | (semanticdb-hooks): Use semantic-init-db-hook instead of obsolete | ||
| 24 | alias semantic-init-db-hooks. | ||
| 25 | |||
| 26 | * cedet/semantic/db-global.el (semanticdb-enable-gnu-global-databases): | ||
| 27 | Use semantic-init-hook instead of obsolete alias | ||
| 28 | semantic-init-hooks. | ||
| 29 | |||
| 30 | * cedet/semantic/db-file.el (semanticdb-save-database-hook): | ||
| 31 | Rename from semanticdb-save-database-hooks. Make old name an | ||
| 32 | obsolete alias. | ||
| 33 | |||
| 34 | * cedet/semantic/decorate/mode.el | ||
| 35 | (semantic-decorate-pending-decoration-hook): Rename from | ||
| 36 | semantic-decorate-pending-decoration-hooks. Make old name an | ||
| 37 | obsolete alias. | ||
| 38 | |||
| 39 | * cedet/srecode/map.el (srecode-map-validate-file-for-mode): Use | ||
| 40 | semantic-init-hook instead of obsolete alias semantic-init-hooks. | ||
| 41 | |||
| 42 | * cedet/semantic/fw.el (semantic-find-file-noselect): Use | ||
| 43 | semantic-init-hook instead of obsolete alias semantic-init-hooks. | ||
| 44 | |||
| 45 | * cedet/ede/project-am.el (project-am-with-makefile-current): Use | ||
| 46 | semantic-init-hook instead of obsolete alias semantic-init-hooks. | ||
| 47 | |||
| 48 | * cedet/semantic/util.el (semantic-describe-buffer): Use | ||
| 49 | semantic-init-hook and semantic-init-db-hook instead of obsolete | ||
| 50 | aliases. | ||
| 51 | |||
| 52 | * cedet/semantic/util-modes.el (semantic-mode-line-update) | ||
| 53 | (semantic-toggle-minor-mode-globally): Use semantic-init-hook | ||
| 54 | instead of obsolete alias semantic-init-hooks. | ||
| 55 | |||
| 56 | 2009-09-26 Chong Yidong <cyd@stupidchicken.com> | ||
| 57 | |||
| 58 | Synch to Eric Ludlam's upstream CEDET repository. | ||
| 59 | |||
| 60 | * cedet/semantic/bovine/c.el (semantic-c-parse-token-hack-depth): | ||
| 61 | New var. | ||
| 62 | (semantic-c-parse-lexical-token): Save match data when setting up | ||
| 63 | the secondary parse buffer. Allow recursion. Protect against | ||
| 64 | initializing the major mode from throwing errors, ie user hooks. | ||
| 65 | |||
| 66 | * cedet/semantic/lex-spp.el (semantic-lex-spp-lex-text-string): | ||
| 67 | Protect installing a major mode from throwing errors. | ||
| 68 | |||
| 1 | 2009-09-21 Chong Yidong <cyd@stupidchicken.com> | 69 | 2009-09-21 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 70 | ||
| 3 | * cedet/semantic.el (semantic-parser-working-message): Use a less | 71 | * cedet/semantic.el (semantic-parser-working-message): Use a less |
diff --git a/lisp/cedet/ede/project-am.el b/lisp/cedet/ede/project-am.el index 976f72e6c7d..c7045dc69df 100644 --- a/lisp/cedet/ede/project-am.el +++ b/lisp/cedet/ede/project-am.el | |||
| @@ -475,7 +475,7 @@ Kill the makefile if it was not loaded before the load." | |||
| 475 | (if kb (setq fb kb) | 475 | (if kb (setq fb kb) |
| 476 | ;; We need to find-file this thing, but don't use | 476 | ;; We need to find-file this thing, but don't use |
| 477 | ;; any semantic features. | 477 | ;; any semantic features. |
| 478 | (let ((semantic-init-hooks nil)) | 478 | (let ((semantic-init-hook nil)) |
| 479 | (setq fb (find-file-noselect fn))) | 479 | (setq fb (find-file-noselect fn))) |
| 480 | ) | 480 | ) |
| 481 | (set-buffer fb) | 481 | (set-buffer fb) |
diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el index f49d569c43e..0d250e2795f 100644 --- a/lisp/cedet/semantic/bovine/c.el +++ b/lisp/cedet/semantic/bovine/c.el | |||
| @@ -283,7 +283,7 @@ values of the conditions in the #if blocks." | |||
| 283 | (defun semantic-c-skip-conditional-section () | 283 | (defun semantic-c-skip-conditional-section () |
| 284 | "Skip one section of a conditional. | 284 | "Skip one section of a conditional. |
| 285 | Moves forward to a matching #elif, #else, or #endif. | 285 | Moves forward to a matching #elif, #else, or #endif. |
| 286 | Movers completely over balanced #if blocks." | 286 | Moves completely over balanced #if blocks." |
| 287 | (require 'cc-cmds) | 287 | (require 'cc-cmds) |
| 288 | (let ((done nil)) | 288 | (let ((done nil)) |
| 289 | ;; (if (looking-at "^\\s-*#if") | 289 | ;; (if (looking-at "^\\s-*#if") |
| @@ -684,6 +684,9 @@ as for the parent." | |||
| 684 | depth returnonerror) | 684 | depth returnonerror) |
| 685 | )) | 685 | )) |
| 686 | 686 | ||
| 687 | (defvar semantic-c-parse-token-hack-depth 0 | ||
| 688 | "Current depth of recursive calls to `semantic-c-parse-lexical-token'") | ||
| 689 | |||
| 687 | (defun semantic-c-parse-lexical-token (lexicaltoken nonterminal depth | 690 | (defun semantic-c-parse-lexical-token (lexicaltoken nonterminal depth |
| 688 | returnonerror) | 691 | returnonerror) |
| 689 | "Do a region parse on the contents of LEXICALTOKEN. | 692 | "Do a region parse on the contents of LEXICALTOKEN. |
| @@ -692,7 +695,9 @@ The text of the token is inserted into a different buffer, and | |||
| 692 | parsed there. | 695 | parsed there. |
| 693 | Argument NONTERMINAL, DEPTH, and RETURNONERROR are passed into | 696 | Argument NONTERMINAL, DEPTH, and RETURNONERROR are passed into |
| 694 | the regular parser." | 697 | the regular parser." |
| 695 | (let* ((buf (get-buffer-create " *C parse hack*")) | 698 | (let* ((semantic-c-parse-token-hack-depth (1+ semantic-c-parse-token-hack-depth)) |
| 699 | (buf (get-buffer-create (format " *C parse hack %d*" | ||
| 700 | semantic-c-parse-token-hack-depth))) | ||
| 696 | (mode major-mode) | 701 | (mode major-mode) |
| 697 | (spp-syms semantic-lex-spp-dynamic-macro-symbol-obarray) | 702 | (spp-syms semantic-lex-spp-dynamic-macro-symbol-obarray) |
| 698 | (stream nil) | 703 | (stream nil) |
| @@ -705,18 +710,24 @@ the regular parser." | |||
| 705 | (set-buffer buf) | 710 | (set-buffer buf) |
| 706 | (erase-buffer) | 711 | (erase-buffer) |
| 707 | (when (not (eq major-mode mode)) | 712 | (when (not (eq major-mode mode)) |
| 708 | (funcall mode) | 713 | (save-match-data |
| 709 | ;; Hack in mode-local | 714 | |
| 710 | (activate-mode-local-bindings) | 715 | ;; Protect against user hooks throwing errors. |
| 711 | ;; CHEATER! The following 3 lines are from | 716 | (condition-case nil |
| 712 | ;; `semantic-new-buffer-fcn', but we don't want to turn | 717 | (funcall mode) |
| 713 | ;; on all the other annoying modes for this little task. | 718 | (error nil)) |
| 714 | (setq semantic-new-buffer-fcn-was-run t) | 719 | |
| 715 | (semantic-lex-init) | 720 | ;; Hack in mode-local |
| 716 | (semantic-clear-toplevel-cache) | 721 | (activate-mode-local-bindings) |
| 717 | (remove-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook | 722 | ;; CHEATER! The following 3 lines are from |
| 718 | t) | 723 | ;; `semantic-new-buffer-fcn', but we don't want to turn |
| 719 | ) | 724 | ;; on all the other annoying modes for this little task. |
| 725 | (setq semantic-new-buffer-fcn-was-run t) | ||
| 726 | (semantic-lex-init) | ||
| 727 | (semantic-clear-toplevel-cache) | ||
| 728 | (remove-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook | ||
| 729 | t) | ||
| 730 | )) | ||
| 720 | ;; Get the macro symbol table right. | 731 | ;; Get the macro symbol table right. |
| 721 | (setq semantic-lex-spp-dynamic-macro-symbol-obarray spp-syms) | 732 | (setq semantic-lex-spp-dynamic-macro-symbol-obarray spp-syms) |
| 722 | ;; (message "%S" macros) | 733 | ;; (message "%S" macros) |
diff --git a/lisp/cedet/semantic/db-file.el b/lisp/cedet/semantic/db-file.el index 8a65c5e1e6e..3873d0abcab 100644 --- a/lisp/cedet/semantic/db-file.el +++ b/lisp/cedet/semantic/db-file.el | |||
| @@ -68,13 +68,17 @@ passes a list of predicates in `semanticdb-project-predicate-functions'." | |||
| 68 | :group 'semanticdb | 68 | :group 'semanticdb |
| 69 | :type nil) | 69 | :type nil) |
| 70 | 70 | ||
| 71 | (defcustom semanticdb-save-database-hooks nil | 71 | (defcustom semanticdb-save-database-hook nil |
| 72 | "Hooks run after a database is saved. | 72 | "Normal hook run after a database is saved. |
| 73 | Each function is called with one argument, the object representing | 73 | Each function is called with one argument, the object representing |
| 74 | the database recently written." | 74 | the database recently written." |
| 75 | :group 'semanticdb | 75 | :group 'semanticdb |
| 76 | :type 'hook) | 76 | :type 'hook) |
| 77 | 77 | ||
| 78 | (define-obsolete-variable-alias | ||
| 79 | 'semanticdb-save-database-hooks | ||
| 80 | 'semanticdb-save-database-hook "23.2") | ||
| 81 | |||
| 78 | (defvar semanticdb-dir-sep-char (if (boundp 'directory-sep-char) | 82 | (defvar semanticdb-dir-sep-char (if (boundp 'directory-sep-char) |
| 79 | (symbol-value 'directory-sep-char) | 83 | (symbol-value 'directory-sep-char) |
| 80 | ?/) | 84 | ?/) |
| @@ -210,9 +214,10 @@ If SUPRESS-QUESTIONS, then do not ask to create the directory." | |||
| 210 | ((y-or-n-p (format "Create directory %s for SemanticDB? " dest)) | 214 | ((y-or-n-p (format "Create directory %s for SemanticDB? " dest)) |
| 211 | (make-directory dest t) | 215 | (make-directory dest t) |
| 212 | t) | 216 | t) |
| 213 | (t (if (boundp 'semanticdb--inhibit-make-directory) | 217 | (t |
| 214 | (setq semanticdb--inhibit-make-directory t)) | 218 | (if (boundp 'semanticdb--inhibit-make-directory) |
| 215 | nil)))) | 219 | (setq semanticdb--inhibit-make-directory t)) |
| 220 | nil)))) | ||
| 216 | 221 | ||
| 217 | (defmethod semanticdb-save-db ((DB semanticdb-project-database-file) | 222 | (defmethod semanticdb-save-db ((DB semanticdb-project-database-file) |
| 218 | &optional | 223 | &optional |
diff --git a/lisp/cedet/semantic/db-global.el b/lisp/cedet/semantic/db-global.el index c45ed16eabf..7e13e8c7054 100644 --- a/lisp/cedet/semantic/db-global.el +++ b/lisp/cedet/semantic/db-global.el | |||
| @@ -61,9 +61,9 @@ in a GNU Global supported hierarchy." | |||
| 61 | (when (stringp mode) | 61 | (when (stringp mode) |
| 62 | (setq mode (intern mode))) | 62 | (setq mode (intern mode))) |
| 63 | 63 | ||
| 64 | (let ((ih (mode-local-value mode 'semantic-init-mode-hooks))) | 64 | (let ((ih (mode-local-value mode 'semantic-init-mode-hook))) |
| 65 | (eval `(setq-mode-local | 65 | (eval `(setq-mode-local |
| 66 | ,mode semantic-init-mode-hooks | 66 | ,mode semantic-init-mode-hook |
| 67 | (cons 'semanticdb-enable-gnu-global-hook ih)))) | 67 | (cons 'semanticdb-enable-gnu-global-hook ih)))) |
| 68 | 68 | ||
| 69 | ) | 69 | ) |
diff --git a/lisp/cedet/semantic/db-mode.el b/lisp/cedet/semantic/db-mode.el index e0899614413..f33afbb40c7 100644 --- a/lisp/cedet/semantic/db-mode.el +++ b/lisp/cedet/semantic/db-mode.el | |||
| @@ -47,17 +47,21 @@ | |||
| 47 | (global-semanticdb-minor-mode (if val 1 -1)) | 47 | (global-semanticdb-minor-mode (if val 1 -1)) |
| 48 | (custom-set-default sym val))) | 48 | (custom-set-default sym val))) |
| 49 | 49 | ||
| 50 | (defcustom semanticdb-mode-hooks nil | 50 | (defcustom semanticdb-mode-hook nil |
| 51 | "*Hooks run whenever `global-semanticdb-minor-mode' is run. | 51 | "Normal hook run whenever `global-semanticdb-minor-mode' is run. |
| 52 | Use `semanticdb-minor-mode-p' to determine if the mode has been turned | 52 | Use `semanticdb-minor-mode-p' to determine if the mode has been turned |
| 53 | on or off." | 53 | on or off." |
| 54 | :group 'semanticdb | 54 | :group 'semanticdb |
| 55 | :type 'hook) | 55 | :type 'hook) |
| 56 | 56 | ||
| 57 | (define-obsolete-variable-alias | ||
| 58 | 'semanticdb-mode-hooks | ||
| 59 | 'semanticdb-mode-hook "23.2") | ||
| 60 | |||
| 57 | ;;; Start/Stop database use | 61 | ;;; Start/Stop database use |
| 58 | ;; | 62 | ;; |
| 59 | (defvar semanticdb-hooks | 63 | (defvar semanticdb-hooks |
| 60 | '((semanticdb-semantic-init-hook-fcn semantic-init-db-hooks) | 64 | '((semanticdb-semantic-init-hook-fcn semantic-init-db-hook) |
| 61 | (semanticdb-synchronize-table semantic-after-toplevel-cache-change-hook) | 65 | (semanticdb-synchronize-table semantic-after-toplevel-cache-change-hook) |
| 62 | (semanticdb-partial-synchronize-table semantic-after-partial-cache-change-hook) | 66 | (semanticdb-partial-synchronize-table semantic-after-partial-cache-change-hook) |
| 63 | (semanticdb-revert-hook before-revert-hook) | 67 | (semanticdb-revert-hook before-revert-hook) |
| @@ -101,7 +105,7 @@ If ARG is nil, then toggle." | |||
| 101 | (funcall fn (car (cdr (car h))) (car (car h))) | 105 | (funcall fn (car (cdr (car h))) (car (car h))) |
| 102 | (setq h (cdr h))) | 106 | (setq h (cdr h))) |
| 103 | ;; Call a hook | 107 | ;; Call a hook |
| 104 | (run-hooks 'semanticdb-mode-hooks)) | 108 | (run-hooks 'semanticdb-mode-hook)) |
| 105 | )) | 109 | )) |
| 106 | 110 | ||
| 107 | (defun semanticdb-toggle-global-mode () | 111 | (defun semanticdb-toggle-global-mode () |
| @@ -119,7 +123,7 @@ Update the environment of Semantic enabled buffers accordingly." | |||
| 119 | ;; Functions used in hooks to keep SemanticDB operating. | 123 | ;; Functions used in hooks to keep SemanticDB operating. |
| 120 | ;; | 124 | ;; |
| 121 | (defun semanticdb-semantic-init-hook-fcn () | 125 | (defun semanticdb-semantic-init-hook-fcn () |
| 122 | "Function saved in `semantic-init-db-hooks'. | 126 | "Function saved in `semantic-init-db-hook'. |
| 123 | Sets up the semanticdb environment." | 127 | Sets up the semanticdb environment." |
| 124 | ;; Only initialize semanticdb if we have a file name. | 128 | ;; Only initialize semanticdb if we have a file name. |
| 125 | ;; There is no reason to cache a tag table if there is no | 129 | ;; There is no reason to cache a tag table if there is no |
diff --git a/lisp/cedet/semantic/debug.el b/lisp/cedet/semantic/debug.el index c805a2c8e9a..3a348f2a9e9 100644 --- a/lisp/cedet/semantic/debug.el +++ b/lisp/cedet/semantic/debug.el | |||
| @@ -319,7 +319,7 @@ Argument ONOFF is non-nil when we are entering debug mode. | |||
| 319 | ;; Make the buffer read only | 319 | ;; Make the buffer read only |
| 320 | (toggle-read-only 1) | 320 | (toggle-read-only 1) |
| 321 | ;; Hooks | 321 | ;; Hooks |
| 322 | (run-hooks 'semantic-debug-mode-hooks) | 322 | (run-hooks 'semantic-debug-mode-hook) |
| 323 | ) | 323 | ) |
| 324 | ;; Restore old mode information | 324 | ;; Restore old mode information |
| 325 | (save-excursion | 325 | (save-excursion |
| @@ -334,7 +334,7 @@ Argument ONOFF is non-nil when we are entering debug mode. | |||
| 334 | (use-local-map | 334 | (use-local-map |
| 335 | (oref semantic-debug-current-interface source-local-map)) | 335 | (oref semantic-debug-current-interface source-local-map)) |
| 336 | ) | 336 | ) |
| 337 | (run-hooks 'semantic-debug-exit-hooks) | 337 | (run-hooks 'semantic-debug-exit-hook) |
| 338 | ))) | 338 | ))) |
| 339 | 339 | ||
| 340 | (defun semantic-debug () | 340 | (defun semantic-debug () |
diff --git a/lisp/cedet/semantic/decorate/mode.el b/lisp/cedet/semantic/decorate/mode.el index c35df575812..b0a1c12fa79 100644 --- a/lisp/cedet/semantic/decorate/mode.el +++ b/lisp/cedet/semantic/decorate/mode.el | |||
| @@ -194,9 +194,13 @@ Also make sure old decorations in the area are completely flushed." | |||
| 194 | ;; such identified change ought to be setup as PENDING. This means | 194 | ;; such identified change ought to be setup as PENDING. This means |
| 195 | ;; that the next idle step will do the decoration change, but at the | 195 | ;; that the next idle step will do the decoration change, but at the |
| 196 | ;; time of the state change, minimal work would be done. | 196 | ;; time of the state change, minimal work would be done. |
| 197 | (defvar semantic-decorate-pending-decoration-hooks nil | 197 | (defvar semantic-decorate-pending-decoration-hook nil |
| 198 | "Functions to call with pending decoration changes.") | 198 | "Functions to call with pending decoration changes.") |
| 199 | 199 | ||
| 200 | (define-obsolete-variable-alias | ||
| 201 | 'semantic-decorate-pending-decoration-hooks | ||
| 202 | 'semantic-decorate-pending-decoration-hook "23.2") | ||
| 203 | |||
| 200 | (defun semantic-decorate-add-pending-decoration (fcn &optional buffer) | 204 | (defun semantic-decorate-add-pending-decoration (fcn &optional buffer) |
| 201 | "Add a pending decoration change represented by FCN. | 205 | "Add a pending decoration change represented by FCN. |
| 202 | Applies only to the current BUFFER. | 206 | Applies only to the current BUFFER. |
| @@ -204,17 +208,17 @@ The setting of FCN will be removed after it is run." | |||
| 204 | (save-excursion | 208 | (save-excursion |
| 205 | (when buffer (set-buffer buffer)) | 209 | (when buffer (set-buffer buffer)) |
| 206 | (semantic-make-local-hook 'semantic-decorate-flush-pending-decorations) | 210 | (semantic-make-local-hook 'semantic-decorate-flush-pending-decorations) |
| 207 | (add-hook 'semantic-decorate-pending-decoration-hooks fcn nil t))) | 211 | (add-hook 'semantic-decorate-pending-decoration-hook fcn nil t))) |
| 208 | 212 | ||
| 209 | ;;;;###autoload | 213 | ;;;;###autoload |
| 210 | (defun semantic-decorate-flush-pending-decorations (&optional buffer) | 214 | (defun semantic-decorate-flush-pending-decorations (&optional buffer) |
| 211 | "Flush any pending decorations for BUFFER. | 215 | "Flush any pending decorations for BUFFER. |
| 212 | Flush functions from `semantic-decorate-pending-decoration-hooks'." | 216 | Flush functions from `semantic-decorate-pending-decoration-hook'." |
| 213 | (save-excursion | 217 | (save-excursion |
| 214 | (when buffer (set-buffer buffer)) | 218 | (when buffer (set-buffer buffer)) |
| 215 | (run-hooks 'semantic-decorate-pending-decoration-hooks) | 219 | (run-hooks 'semantic-decorate-pending-decoration-hook) |
| 216 | ;; Always reset the hooks | 220 | ;; Always reset the hooks |
| 217 | (setq semantic-decorate-pending-decoration-hooks nil))) | 221 | (setq semantic-decorate-pending-decoration-hook nil))) |
| 218 | 222 | ||
| 219 | 223 | ||
| 220 | ;;; DECORATION MODE | 224 | ;;; DECORATION MODE |
diff --git a/lisp/cedet/semantic/edit.el b/lisp/cedet/semantic/edit.el index 5ec623bba31..59a57005c7e 100644 --- a/lisp/cedet/semantic/edit.el +++ b/lisp/cedet/semantic/edit.el | |||
| @@ -62,7 +62,7 @@ | |||
| 62 | 62 | ||
| 63 | ;;; Code: | 63 | ;;; Code: |
| 64 | (defvar semantic-after-partial-cache-change-hook nil | 64 | (defvar semantic-after-partial-cache-change-hook nil |
| 65 | "Hooks run after the buffer cache has been updated. | 65 | "Normal hook run after the buffer cache has been updated. |
| 66 | 66 | ||
| 67 | This hook will run when the cache has been partially reparsed. | 67 | This hook will run when the cache has been partially reparsed. |
| 68 | Partial reparses are incurred when a user edits a buffer, and only the | 68 | Partial reparses are incurred when a user edits a buffer, and only the |
| @@ -74,7 +74,7 @@ updated in the current buffer. | |||
| 74 | For language specific hooks, make sure you define this as a local hook.") | 74 | For language specific hooks, make sure you define this as a local hook.") |
| 75 | 75 | ||
| 76 | (defvar semantic-change-hooks nil | 76 | (defvar semantic-change-hooks nil |
| 77 | "Hooks run when semantic detects a change in a buffer. | 77 | "Abnormal hook run when semantic detects a change in a buffer. |
| 78 | Each hook function must take three arguments, identical to the | 78 | Each hook function must take three arguments, identical to the |
| 79 | common hook `after-change-functions'.") | 79 | common hook `after-change-functions'.") |
| 80 | 80 | ||
| @@ -92,27 +92,27 @@ hook. | |||
| 92 | Not used yet; part of the next generation reparse mechanism.") | 92 | Not used yet; part of the next generation reparse mechanism.") |
| 93 | 93 | ||
| 94 | (defvar semantic-edits-new-change-hooks nil | 94 | (defvar semantic-edits-new-change-hooks nil |
| 95 | "Hooks run when a new change is found. | 95 | "Abnormal hook run when a new change is found. |
| 96 | Functions must take one argument representing an overlay on that change.") | 96 | Functions must take one argument representing an overlay on that change.") |
| 97 | 97 | ||
| 98 | (defvar semantic-edits-delete-change-hooks nil | 98 | (defvar semantic-edits-delete-change-hooks nil |
| 99 | "Hooks run before a change overlay is deleted. | 99 | "Abnormal hook run before a change overlay is deleted. |
| 100 | Deleted changes occur when multiple changes are merged. | 100 | Deleted changes occur when multiple changes are merged. |
| 101 | Functions must take one argument representing an overlay being deleted.") | 101 | Functions must take one argument representing an overlay being deleted.") |
| 102 | 102 | ||
| 103 | (defvar semantic-edits-move-change-hooks nil | 103 | (defvar semantic-edits-move-change-hook nil |
| 104 | "Hooks run after a change overlay is moved. | 104 | "Abnormal hook run after a change overlay is moved. |
| 105 | Changes move when a new change overlaps an old change. The old change | 105 | Changes move when a new change overlaps an old change. The old change |
| 106 | will be moved. | 106 | will be moved. |
| 107 | Functions must take one argument representing an overlay being moved.") | 107 | Functions must take one argument representing an overlay being moved.") |
| 108 | 108 | ||
| 109 | (defvar semantic-edits-reparse-change-hooks nil | 109 | (defvar semantic-edits-reparse-change-hooks nil |
| 110 | "Hooks run after a change results in a reparse. | 110 | "Abnormal hook run after a change results in a reparse. |
| 111 | Functions are called before the overlay is deleted, and after the | 111 | Functions are called before the overlay is deleted, and after the |
| 112 | incremental reparse.") | 112 | incremental reparse.") |
| 113 | 113 | ||
| 114 | (defvar semantic-edits-incremental-reparse-failed-hooks nil | 114 | (defvar semantic-edits-incremental-reparse-failed-hooks nil |
| 115 | "Hooks run after the incremental parser fails. | 115 | "Abnormal hook run after the incremental parser fails. |
| 116 | When this happens, the buffer is marked as needing a full reprase.") | 116 | When this happens, the buffer is marked as needing a full reprase.") |
| 117 | 117 | ||
| 118 | (defcustom semantic-edits-verbose-flag nil | 118 | (defcustom semantic-edits-verbose-flag nil |
diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el index d7e5b5f2bde..a2e4d0f26c2 100644 --- a/lisp/cedet/semantic/fw.el +++ b/lisp/cedet/semantic/fw.el | |||
| @@ -391,7 +391,7 @@ FILE, NOWARN, RAWFILE, and WILDCARDS are passed into `find-file-noselect'" | |||
| 391 | ;; This is a brave statement. Don't waste time loading in | 391 | ;; This is a brave statement. Don't waste time loading in |
| 392 | ;; lots of modes. Especially decoration mode can waste a lot | 392 | ;; lots of modes. Especially decoration mode can waste a lot |
| 393 | ;; of time for a buffer we intend to kill. | 393 | ;; of time for a buffer we intend to kill. |
| 394 | (semantic-init-hooks nil) | 394 | (semantic-init-hook nil) |
| 395 | ;; This disables the part of EDE that asks questions | 395 | ;; This disables the part of EDE that asks questions |
| 396 | (ede-auto-add-method 'never) | 396 | (ede-auto-add-method 'never) |
| 397 | ;; Ask font-lock to not colorize these buffers, nor to | 397 | ;; Ask font-lock to not colorize these buffers, nor to |
diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el index 87da3cbd2cc..f220fcbb8d9 100644 --- a/lisp/cedet/semantic/idle.el +++ b/lisp/cedet/semantic/idle.el | |||
| @@ -500,16 +500,26 @@ datasets." | |||
| 500 | ;; :group 'semantic | 500 | ;; :group 'semantic |
| 501 | ;; :type 'boolean) | 501 | ;; :type 'boolean) |
| 502 | 502 | ||
| 503 | (defvar semantic-before-idle-scheduler-reparse-hooks nil | 503 | (defvar semantic-before-idle-scheduler-reparse-hook nil |
| 504 | "Hooks run before option `semantic-idle-scheduler' begins parsing. | 504 | "Normal hook run before option `semantic-idle-scheduler' begins parsing. |
| 505 | If any hook throws an error, this variable is reset to nil. | 505 | If any hook function throws an error, this variable is reset to nil. |
| 506 | This hook is not protected from lexical errors.") | 506 | This hook is not protected from lexical errors.") |
| 507 | 507 | ||
| 508 | (defvar semantic-after-idle-scheduler-reparse-hooks nil | 508 | (define-obsolete-variable-alias |
| 509 | "Hooks run after option `semantic-idle-scheduler' has parsed. | 509 | 'semantic-before-idle-scheduler-reparse-hooks |
| 510 | If any hook throws an error, this variable is reset to nil. | 510 | 'semantic-before-idle-scheduler-reparse-hook |
| 511 | "23.2") | ||
| 512 | |||
| 513 | (defvar semantic-after-idle-scheduler-reparse-hook nil | ||
| 514 | "Normal hook run after option `semantic-idle-scheduler' has parsed. | ||
| 515 | If any hook function throws an error, this variable is reset to nil. | ||
| 511 | This hook is not protected from lexical errors.") | 516 | This hook is not protected from lexical errors.") |
| 512 | 517 | ||
| 518 | (define-obsolete-variable-alias | ||
| 519 | 'semantic-after-idle-scheduler-reparse-hooks | ||
| 520 | 'semantic-after-idle-scheduler-reparse-hook | ||
| 521 | "23.2") | ||
| 522 | |||
| 513 | (defun semantic-idle-scheduler-refresh-tags () | 523 | (defun semantic-idle-scheduler-refresh-tags () |
| 514 | "Refreshes the current buffer's tags. | 524 | "Refreshes the current buffer's tags. |
| 515 | This is called by `semantic-idle-scheduler-function' to update the | 525 | This is called by `semantic-idle-scheduler-function' to update the |
| @@ -553,8 +563,8 @@ Does nothing if the current buffer doesn't need reparsing." | |||
| 553 | ;; Let people hook into this, but don't let them hose | 563 | ;; Let people hook into this, but don't let them hose |
| 554 | ;; us over! | 564 | ;; us over! |
| 555 | (condition-case nil | 565 | (condition-case nil |
| 556 | (run-hooks 'semantic-before-idle-scheduler-reparse-hooks) | 566 | (run-hooks 'semantic-before-idle-scheduler-reparse-hook) |
| 557 | (error (setq semantic-before-idle-scheduler-reparse-hooks nil))) | 567 | (error (setq semantic-before-idle-scheduler-reparse-hook nil))) |
| 558 | 568 | ||
| 559 | (unwind-protect | 569 | (unwind-protect |
| 560 | ;; Perform the parsing. | 570 | ;; Perform the parsing. |
| @@ -576,8 +586,8 @@ Does nothing if the current buffer doesn't need reparsing." | |||
| 576 | ;; Let people hook into this, but don't let them hose | 586 | ;; Let people hook into this, but don't let them hose |
| 577 | ;; us over! | 587 | ;; us over! |
| 578 | (condition-case nil | 588 | (condition-case nil |
| 579 | (run-hooks 'semantic-after-idle-scheduler-reparse-hooks) | 589 | (run-hooks 'semantic-after-idle-scheduler-reparse-hook) |
| 580 | (error (setq semantic-after-idle-scheduler-reparse-hooks nil)))) | 590 | (error (setq semantic-after-idle-scheduler-reparse-hook nil)))) |
| 581 | ;; Return if we are lexically safe (from prog1) | 591 | ;; Return if we are lexically safe (from prog1) |
| 582 | lexically-safe))) | 592 | lexically-safe))) |
| 583 | 593 | ||
diff --git a/lisp/cedet/semantic/lex-spp.el b/lisp/cedet/semantic/lex-spp.el index 9d47fb4cfb6..8fc11734c2f 100644 --- a/lisp/cedet/semantic/lex-spp.el +++ b/lisp/cedet/semantic/lex-spp.el | |||
| @@ -863,7 +863,12 @@ and variable state from the current buffer." | |||
| 863 | ;; Below is a painful hack to make sure everything is setup correctly. | 863 | ;; Below is a painful hack to make sure everything is setup correctly. |
| 864 | (when (not (eq major-mode mode)) | 864 | (when (not (eq major-mode mode)) |
| 865 | (save-match-data | 865 | (save-match-data |
| 866 | (funcall mode) | 866 | |
| 867 | ;; Protect against user-hooks that throw errors. | ||
| 868 | (condition-case nil | ||
| 869 | (funcall mode) | ||
| 870 | (error nil)) | ||
| 871 | |||
| 867 | ;; Hack in mode-local | 872 | ;; Hack in mode-local |
| 868 | (activate-mode-local-bindings) | 873 | (activate-mode-local-bindings) |
| 869 | ;; CHEATER! The following 3 lines are from | 874 | ;; CHEATER! The following 3 lines are from |
diff --git a/lisp/cedet/semantic/lex.el b/lisp/cedet/semantic/lex.el index 83e0836f8a6..93b062971c1 100644 --- a/lisp/cedet/semantic/lex.el +++ b/lisp/cedet/semantic/lex.el | |||
| @@ -769,9 +769,10 @@ start position of the block, and STREAM is the list of tokens in that | |||
| 769 | block.") | 769 | block.") |
| 770 | 770 | ||
| 771 | (defvar semantic-lex-reset-hooks nil | 771 | (defvar semantic-lex-reset-hooks nil |
| 772 | "List of hooks major-modes use to reset lexical analyzers. | 772 | "Abnormal hook used by major-modes to reset lexical analyzers. |
| 773 | Hooks are called with START and END values for the current lexical pass. | 773 | Hook functions are called with START and END values for the |
| 774 | Should be set with `add-hook'specifying a LOCAL option.") | 774 | current lexical pass. Should be set with `add-hook', specifying |
| 775 | a LOCAL option.") | ||
| 775 | 776 | ||
| 776 | ;; Stack of nested blocks. | 777 | ;; Stack of nested blocks. |
| 777 | (defvar semantic-lex-block-stack nil) | 778 | (defvar semantic-lex-block-stack nil) |
diff --git a/lisp/cedet/semantic/util-modes.el b/lisp/cedet/semantic/util-modes.el index 4df7e68d338..b0d08210c29 100644 --- a/lisp/cedet/semantic/util-modes.el +++ b/lisp/cedet/semantic/util-modes.el | |||
| @@ -97,7 +97,7 @@ Only minor modes that are locally enabled are shown in the mode line." | |||
| 97 | ml (cdr ml)) | 97 | ml (cdr ml)) |
| 98 | (when (and (symbol-value mm) | 98 | (when (and (symbol-value mm) |
| 99 | ;; Only show local minor mode status | 99 | ;; Only show local minor mode status |
| 100 | (not (memq mm semantic-init-hooks))) | 100 | (not (memq mm semantic-init-hook))) |
| 101 | (and ms | 101 | (and ms |
| 102 | (symbolp ms) | 102 | (symbolp ms) |
| 103 | (setq ms (symbol-value ms))) | 103 | (setq ms (symbol-value ms))) |
| @@ -178,26 +178,26 @@ function used to toggle the mode." | |||
| 178 | (or (and (fboundp mode) (assq mode minor-mode-alist)) | 178 | (or (and (fboundp mode) (assq mode minor-mode-alist)) |
| 179 | (error "Semantic minor mode %s not found" mode)) | 179 | (error "Semantic minor mode %s not found" mode)) |
| 180 | (if (not arg) | 180 | (if (not arg) |
| 181 | (if (memq mode semantic-init-hooks) | 181 | (if (memq mode semantic-init-hook) |
| 182 | (setq arg -1) | 182 | (setq arg -1) |
| 183 | (setq arg 1))) | 183 | (setq arg 1))) |
| 184 | ;; Add or remove the MODE toggle function from | 184 | ;; Add or remove the MODE toggle function from |
| 185 | ;; `semantic-init-hooks'. Then turn MODE on or off in every | 185 | ;; `semantic-init-hook'. Then turn MODE on or off in every |
| 186 | ;; Semantic enabled buffer. | 186 | ;; Semantic enabled buffer. |
| 187 | (cond | 187 | (cond |
| 188 | ;; Turn off if ARG < 0 | 188 | ;; Turn off if ARG < 0 |
| 189 | ((< arg 0) | 189 | ((< arg 0) |
| 190 | (remove-hook 'semantic-init-hooks mode) | 190 | (remove-hook 'semantic-init-hook mode) |
| 191 | (semantic-map-buffers #'(lambda () (funcall mode -1))) | 191 | (semantic-map-buffers #'(lambda () (funcall mode -1))) |
| 192 | nil) | 192 | nil) |
| 193 | ;; Turn on if ARG > 0 | 193 | ;; Turn on if ARG > 0 |
| 194 | ((> arg 0) | 194 | ((> arg 0) |
| 195 | (add-hook 'semantic-init-hooks mode) | 195 | (add-hook 'semantic-init-hook mode) |
| 196 | (semantic-map-buffers #'(lambda () (funcall mode 1))) | 196 | (semantic-map-buffers #'(lambda () (funcall mode 1))) |
| 197 | t) | 197 | t) |
| 198 | ;; Otherwise just check MODE state | 198 | ;; Otherwise just check MODE state |
| 199 | (t | 199 | (t |
| 200 | (memq mode semantic-init-hooks)) | 200 | (memq mode semantic-init-hook)) |
| 201 | )) | 201 | )) |
| 202 | 202 | ||
| 203 | ;;;; | 203 | ;;;; |
diff --git a/lisp/cedet/semantic/util.el b/lisp/cedet/semantic/util.el index 5d22cd068bd..2e67a60cd05 100644 --- a/lisp/cedet/semantic/util.el +++ b/lisp/cedet/semantic/util.el | |||
| @@ -335,8 +335,8 @@ If TAG is not specified, use the tag at point." | |||
| 335 | 335 | ||
| 336 | (princ "\nGeneral configuration items:\n") | 336 | (princ "\nGeneral configuration items:\n") |
| 337 | (let ((vars '(semantic-inhibit-functions | 337 | (let ((vars '(semantic-inhibit-functions |
| 338 | semantic-init-hooks | 338 | semantic-init-hook |
| 339 | semantic-init-db-hooks | 339 | semantic-init-db-hook |
| 340 | semantic-unmatched-syntax-hook | 340 | semantic-unmatched-syntax-hook |
| 341 | semantic--before-fetch-tags-hook | 341 | semantic--before-fetch-tags-hook |
| 342 | semantic-after-toplevel-bovinate-hook | 342 | semantic-after-toplevel-bovinate-hook |
| @@ -445,6 +445,8 @@ NOTFIRST indicates that this was not the first call in the recursive use." | |||
| 445 | ;; "transparently". Here are some interactive commands based on | 445 | ;; "transparently". Here are some interactive commands based on |
| 446 | ;; Senator. | 446 | ;; Senator. |
| 447 | 447 | ||
| 448 | ;; Symbol completion | ||
| 449 | |||
| 448 | (defvar semantic--completion-cache nil | 450 | (defvar semantic--completion-cache nil |
| 449 | "Internal variable used by `senator-complete-symbol'.") | 451 | "Internal variable used by `senator-complete-symbol'.") |
| 450 | 452 | ||
| @@ -456,6 +458,7 @@ NOTFIRST indicates that this was not the first call in the recursive use." | |||
| 456 | "Find all tags with name starting with PREFIX. | 458 | "Find all tags with name starting with PREFIX. |
| 457 | This uses `semanticdb' when available." | 459 | This uses `semanticdb' when available." |
| 458 | (let (result ctxt) | 460 | (let (result ctxt) |
| 461 | ;; Try the Semantic analyzer | ||
| 459 | (condition-case nil | 462 | (condition-case nil |
| 460 | (and (featurep 'semantic/analyze) | 463 | (and (featurep 'semantic/analyze) |
| 461 | (setq ctxt (semantic-analyze-current-context)) | 464 | (setq ctxt (semantic-analyze-current-context)) |
diff --git a/lisp/cedet/srecode/map.el b/lisp/cedet/srecode/map.el index e36b19b80e2..efa858fca78 100644 --- a/lisp/cedet/srecode/map.el +++ b/lisp/cedet/srecode/map.el | |||
| @@ -355,7 +355,7 @@ Return non-nil if the map changed." | |||
| 355 | (insert-file-contents file nil nil nil t) | 355 | (insert-file-contents file nil nil nil t) |
| 356 | ;; Force it to be ready to parse. | 356 | ;; Force it to be ready to parse. |
| 357 | (srecode-template-mode) | 357 | (srecode-template-mode) |
| 358 | (let ((semantic-init-hooks nil)) | 358 | (let ((semantic-init-hook nil)) |
| 359 | (semantic-new-buffer-fcn)) | 359 | (semantic-new-buffer-fcn)) |
| 360 | ) | 360 | ) |
| 361 | 361 | ||