aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2015-04-06 22:20:16 +0000
committerAlan Mackenzie2015-04-06 22:23:30 +0000
commit4d748735d5c49f73e1d49123f7188c9a2fd7d252 (patch)
treee702fdd43d721a6481f77596bf76f833cacfc46e
parentb31d359d182eb252a11f0468a7dc1ee1eafb28e9 (diff)
downloademacs-4d748735d5c49f73e1d49123f7188c9a2fd7d252.tar.gz
emacs-4d748735d5c49f73e1d49123f7188c9a2fd7d252.zip
Fix miscellaneous glitches in cc-mode.el. Fixes debbugs#20245.
* progmodes/cc-mode.el (c-common-init): bind \(before\|after\)-change-functions to nil around invocations of c-get-state-before-change-functions and c-before-font-lock-functions to prevent recursive invocations. (c-neutralize-syntax-in-and-mark-CPP): On c-beginning-of-macro, check that point has actually moved back. (c-fl-decl-start): Check whether c-beginning-of-decl-1 has actually found a boundary (as contrasted with hitting a search limit).
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/progmodes/cc-mode.el20
2 files changed, 26 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 38bb8afa15c..1d25e8f870e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,17 @@
12015-04-06 Alan Mackenzie <acm@muc.de>
2
3 Fix miscellaneous glitches in cc-mode.el. Fixes debbugs#20245.
4
5 * progmodes/cc-mode.el (c-common-init): bind
6 \(before\|after\)-change-functions to nil around invocations of
7 c-get-state-before-change-functions and
8 c-before-font-lock-functions to prevent recursive invocations.
9 (c-neutralize-syntax-in-and-mark-CPP): On c-beginning-of-macro,
10 check that point has actually moved back.
11 (c-fl-decl-start): Check whether c-beginning-of-decl-1 has
12 actually found a boundary (as contrasted with hitting a search
13 limit).
14
12015-02-01 Alan Mackenzie <acm@muc.de> 152015-02-01 Alan Mackenzie <acm@muc.de>
2 16
3 CC Mode: Stop Font Lock forcing fontification from BOL. Fixes 17 CC Mode: Stop Font Lock forcing fontification from BOL. Fixes
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index d88fe702c59..1f58ba1ee9b 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -659,13 +659,14 @@ compatible with old code; callers should always specify it."
659 (setq c-new-BEG (point-min)) 659 (setq c-new-BEG (point-min))
660 (setq c-new-END (point-max)) 660 (setq c-new-END (point-max))
661 (save-excursion 661 (save-excursion
662 (mapc (lambda (fn) 662 (let (before-change-functions after-change-functions)
663 (funcall fn (point-min) (point-max))) 663 (mapc (lambda (fn)
664 c-get-state-before-change-functions) 664 (funcall fn (point-min) (point-max)))
665 (mapc (lambda (fn) 665 c-get-state-before-change-functions)
666 (funcall fn (point-min) (point-max) 666 (mapc (lambda (fn)
667 (- (point-max) (point-min)))) 667 (funcall fn (point-min) (point-max)
668 c-before-font-lock-functions))) 668 (- (point-max) (point-min))))
669 c-before-font-lock-functions))))
669 670
670 (set (make-local-variable 'outline-regexp) "[^#\n\^M]") 671 (set (make-local-variable 'outline-regexp) "[^#\n\^M]")
671 (set (make-local-variable 'outline-level) 'c-outline-level) 672 (set (make-local-variable 'outline-level) 'c-outline-level)
@@ -972,7 +973,9 @@ Note that the style variables are always made local to the buffer."
972 (unless 973 (unless
973 (or (save-excursion 974 (or (save-excursion
974 (goto-char (match-beginning 0)) 975 (goto-char (match-beginning 0))
975 (c-beginning-of-macro)) 976 (let ((here (point)))
977 (and (save-match-data (c-beginning-of-macro))
978 (< (point) here))))
976 (progn 979 (progn
977 (setq pps-state 980 (setq pps-state
978 (parse-partial-sexp pps-position (point) nil nil pps-state) 981 (parse-partial-sexp pps-position (point) nil nil pps-state)
@@ -1170,6 +1173,7 @@ Note that the style variables are always made local to the buffer."
1170 ;; Go to a less nested declaration each time round this loop. 1173 ;; Go to a less nested declaration each time round this loop.
1171 (and 1174 (and
1172 (eq (car (c-beginning-of-decl-1 bod-lim)) 'same) 1175 (eq (car (c-beginning-of-decl-1 bod-lim)) 'same)
1176 (> (point) bod-lim)
1173 (progn (setq bo-decl (point)) 1177 (progn (setq bo-decl (point))
1174 ;; Are we looking at a keyword such as "template" or 1178 ;; Are we looking at a keyword such as "template" or
1175 ;; "typedef" which can decorate a type, or the type itself? 1179 ;; "typedef" which can decorate a type, or the type itself?