+2015-04-06 Alan Mackenzie <acm@muc.de>
+
+ 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).
+
2015-02-01 Alan Mackenzie <acm@muc.de>
CC Mode: Stop Font Lock forcing fontification from BOL. Fixes
(setq c-new-BEG (point-min))
(setq c-new-END (point-max))
(save-excursion
- (mapc (lambda (fn)
- (funcall fn (point-min) (point-max)))
- c-get-state-before-change-functions)
- (mapc (lambda (fn)
- (funcall fn (point-min) (point-max)
- (- (point-max) (point-min))))
- c-before-font-lock-functions)))
+ (let (before-change-functions after-change-functions)
+ (mapc (lambda (fn)
+ (funcall fn (point-min) (point-max)))
+ c-get-state-before-change-functions)
+ (mapc (lambda (fn)
+ (funcall fn (point-min) (point-max)
+ (- (point-max) (point-min))))
+ c-before-font-lock-functions))))
(set (make-local-variable 'outline-regexp) "[^#\n\^M]")
(set (make-local-variable 'outline-level) 'c-outline-level)
(unless
(or (save-excursion
(goto-char (match-beginning 0))
- (c-beginning-of-macro))
+ (let ((here (point)))
+ (and (save-match-data (c-beginning-of-macro))
+ (< (point) here))))
(progn
(setq pps-state
(parse-partial-sexp pps-position (point) nil nil pps-state)
;; Go to a less nested declaration each time round this loop.
(and
(eq (car (c-beginning-of-decl-1 bod-lim)) 'same)
+ (> (point) bod-lim)
(progn (setq bo-decl (point))
;; Are we looking at a keyword such as "template" or
;; "typedef" which can decorate a type, or the type itself?