aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2014-06-29 11:26:47 +0000
committerAlan Mackenzie2014-06-29 11:26:47 +0000
commite3be29073e79a306ccdbdbdb8d4caf2863de760e (patch)
tree8855f3fb6de156b89baad4a2801d840784637bf5
parent51a0825e8488f6f48f03e11a8d51e49d353b19bf (diff)
downloademacs-e3be29073e79a306ccdbdbdb8d4caf2863de760e.tar.gz
emacs-e3be29073e79a306ccdbdbdb8d4caf2863de760e.zip
Don't call c-parse-state when c++-template-syntax-table is active.
* progmodes/cc-engine.el (c-guess-continued-construct CASE G) (c-guess-basic-syntax CASE 5D.3): Rearrange so that c-syntactic-skip-backwards isn't called with the pertinent syntax table.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/progmodes/cc-defs.el2
-rw-r--r--lisp/progmodes/cc-engine.el40
-rw-r--r--lisp/progmodes/cc-langs.el4
4 files changed, 33 insertions, 21 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5293d8dda92..5f9084f4cbb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12014-06-29 Alan Mackenzie <acm@muc.de>
2
3 Don't call c-parse-state when c++-template-syntax-table is active.
4 * progmodes/cc-engine.el (c-guess-continued-construct CASE G)
5 (c-guess-basic-syntax CASE 5D.3): Rearrange so that
6 c-syntactic-skip-backwards isn't called with the pertinent syntax
7 table.
8
12014-06-28 Stephen Berman <stephen.berman@gmx.net> 92014-06-28 Stephen Berman <stephen.berman@gmx.net>
2 10
3 * calendar/todo-mode.el (todo-set-top-priorities): Fix logic to 11 * calendar/todo-mode.el (todo-set-top-priorities): Fix logic to
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index 1606cfb3357..594ff053d44 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -823,6 +823,8 @@ be after it."
823(defmacro c-with-syntax-table (table &rest code) 823(defmacro c-with-syntax-table (table &rest code)
824 ;; Temporarily switches to the specified syntax table in a failsafe 824 ;; Temporarily switches to the specified syntax table in a failsafe
825 ;; way to execute code. 825 ;; way to execute code.
826 ;; Maintainers' note: If TABLE is `c++-template-syntax-table', DON'T call
827 ;; any forms inside this that call `c-parse-state'. !!!!
826 `(let ((c-with-syntax-table-orig-table (syntax-table))) 828 `(let ((c-with-syntax-table-orig-table (syntax-table)))
827 (unwind-protect 829 (unwind-protect
828 (progn 830 (progn
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 6b406b0d89c..7404241af9b 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -9355,16 +9355,16 @@ comment at the start of cc-engine.el for more info."
9355 (not (looking-at c-<-op-cont-regexp)))))) 9355 (not (looking-at c-<-op-cont-regexp))))))
9356 (c-with-syntax-table c++-template-syntax-table 9356 (c-with-syntax-table c++-template-syntax-table
9357 (goto-char placeholder) 9357 (goto-char placeholder)
9358 (c-beginning-of-statement-1 containing-sexp t) 9358 (c-beginning-of-statement-1 containing-sexp t))
9359 (if (save-excursion 9359 (if (save-excursion
9360 (c-backward-syntactic-ws containing-sexp) 9360 (c-backward-syntactic-ws containing-sexp)
9361 (eq (char-before) ?<)) 9361 (eq (char-before) ?<))
9362 ;; In a nested template arglist. 9362 ;; In a nested template arglist.
9363 (progn 9363 (progn
9364 (goto-char placeholder) 9364 (goto-char placeholder)
9365 (c-syntactic-skip-backward "^,;" containing-sexp t) 9365 (c-syntactic-skip-backward "^,;" containing-sexp t)
9366 (c-forward-syntactic-ws)) 9366 (c-forward-syntactic-ws))
9367 (back-to-indentation))) 9367 (back-to-indentation))
9368 ;; FIXME: Should use c-add-stmt-syntax, but it's not yet 9368 ;; FIXME: Should use c-add-stmt-syntax, but it's not yet
9369 ;; template aware. 9369 ;; template aware.
9370 (c-add-syntax 'template-args-cont (point) placeholder)) 9370 (c-add-syntax 'template-args-cont (point) placeholder))
@@ -10022,16 +10022,16 @@ comment at the start of cc-engine.el for more info."
10022 (eq (char-after placeholder) ?<)))))) 10022 (eq (char-after placeholder) ?<))))))
10023 (c-with-syntax-table c++-template-syntax-table 10023 (c-with-syntax-table c++-template-syntax-table
10024 (goto-char placeholder) 10024 (goto-char placeholder)
10025 (c-beginning-of-statement-1 lim t) 10025 (c-beginning-of-statement-1 lim t))
10026 (if (save-excursion 10026 (if (save-excursion
10027 (c-backward-syntactic-ws lim) 10027 (c-backward-syntactic-ws lim)
10028 (eq (char-before) ?<)) 10028 (eq (char-before) ?<))
10029 ;; In a nested template arglist. 10029 ;; In a nested template arglist.
10030 (progn 10030 (progn
10031 (goto-char placeholder) 10031 (goto-char placeholder)
10032 (c-syntactic-skip-backward "^,;" lim t) 10032 (c-syntactic-skip-backward "^,;" lim t)
10033 (c-forward-syntactic-ws)) 10033 (c-forward-syntactic-ws))
10034 (back-to-indentation))) 10034 (back-to-indentation))
10035 ;; FIXME: Should use c-add-stmt-syntax, but it's not yet 10035 ;; FIXME: Should use c-add-stmt-syntax, but it's not yet
10036 ;; template aware. 10036 ;; template aware.
10037 (c-add-syntax 'template-args-cont (point) placeholder)) 10037 (c-add-syntax 'template-args-cont (point) placeholder))
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index d2d2de8801a..ee002b7bc7b 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -394,7 +394,9 @@ The syntax tables aren't stored directly since they're quite large."
394 ;; lists are parsed. Note that this encourages incorrect parsing of 394 ;; lists are parsed. Note that this encourages incorrect parsing of
395 ;; templates since they might contain normal operators that uses the 395 ;; templates since they might contain normal operators that uses the
396 ;; '<' and '>' characters. Therefore this syntax table might go 396 ;; '<' and '>' characters. Therefore this syntax table might go
397 ;; away when CC Mode handles templates correctly everywhere. 397 ;; away when CC Mode handles templates correctly everywhere. WHILE
398 ;; THIS SYNTAX TABLE IS CURRENT, `c-parse-state' MUST _NOT_ BE
399 ;; CALLED!!!
398 t nil 400 t nil
399 (java c++) `(lambda () 401 (java c++) `(lambda ()
400 (let ((table (funcall ,(c-lang-const c-make-mode-syntax-table)))) 402 (let ((table (funcall ,(c-lang-const c-make-mode-syntax-table))))