summaryrefslogtreecommitdiff
path: root/lisp/cedet/semantic/bovine
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2009-09-26 17:47:11 +0000
committerChong Yidong <cyd@stupidchicken.com>2009-09-26 17:47:11 +0000
commit29e1a603c0d7fa1e4e2c116cbaab90d0401f898b (patch)
treeac94b65e2de818951c17cd1cb77d03e32418f158 /lisp/cedet/semantic/bovine
parent17e1f4bc65ff059a6f05068dc2d64d7130719fd7 (diff)
downloademacs-29e1a603c0d7fa1e4e2c116cbaab90d0401f898b.tar.gz
* 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.
Diffstat (limited to 'lisp/cedet/semantic/bovine')
-rw-r--r--lisp/cedet/semantic/bovine/c.el39
1 files changed, 25 insertions, 14 deletions
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."
(defun semantic-c-skip-conditional-section ()
"Skip one section of a conditional.
Moves forward to a matching #elif, #else, or #endif.
-Movers completely over balanced #if blocks."
+Moves completely over balanced #if blocks."
(require 'cc-cmds)
(let ((done nil))
;; (if (looking-at "^\\s-*#if")
@@ -684,6 +684,9 @@ as for the parent."
depth returnonerror)
))
+(defvar semantic-c-parse-token-hack-depth 0
+ "Current depth of recursive calls to `semantic-c-parse-lexical-token'")
+
(defun semantic-c-parse-lexical-token (lexicaltoken nonterminal depth
returnonerror)
"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
parsed there.
Argument NONTERMINAL, DEPTH, and RETURNONERROR are passed into
the regular parser."
- (let* ((buf (get-buffer-create " *C parse hack*"))
+ (let* ((semantic-c-parse-token-hack-depth (1+ semantic-c-parse-token-hack-depth))
+ (buf (get-buffer-create (format " *C parse hack %d*"
+ semantic-c-parse-token-hack-depth)))
(mode major-mode)
(spp-syms semantic-lex-spp-dynamic-macro-symbol-obarray)
(stream nil)
@@ -705,18 +710,24 @@ the regular parser."
(set-buffer buf)
(erase-buffer)
(when (not (eq major-mode mode))
- (funcall mode)
- ;; Hack in mode-local
- (activate-mode-local-bindings)
- ;; CHEATER! The following 3 lines are from
- ;; `semantic-new-buffer-fcn', but we don't want to turn
- ;; on all the other annoying modes for this little task.
- (setq semantic-new-buffer-fcn-was-run t)
- (semantic-lex-init)
- (semantic-clear-toplevel-cache)
- (remove-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook
- t)
- )
+ (save-match-data
+
+ ;; Protect against user hooks throwing errors.
+ (condition-case nil
+ (funcall mode)
+ (error nil))
+
+ ;; Hack in mode-local
+ (activate-mode-local-bindings)
+ ;; CHEATER! The following 3 lines are from
+ ;; `semantic-new-buffer-fcn', but we don't want to turn
+ ;; on all the other annoying modes for this little task.
+ (setq semantic-new-buffer-fcn-was-run t)
+ (semantic-lex-init)
+ (semantic-clear-toplevel-cache)
+ (remove-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook
+ t)
+ ))
;; Get the macro symbol table right.
(setq semantic-lex-spp-dynamic-macro-symbol-obarray spp-syms)
;; (message "%S" macros)