From: Alan Mackenzie Date: Thu, 31 Aug 2017 19:06:16 +0000 (+0000) Subject: Fix a glitch in CC Mode's syntactic whitespace cache. X-Git-Tag: emacs-26.0.90~287 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5fe41a23d811b17bcde0921b37b89175806c83ef;p=emacs.git Fix a glitch in CC Mode's syntactic whitespace cache. * lisp/progmodes/cc-engine.el (c-forward-sws): Deal correctly with a block comment close at the end of a macro. --- diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index d20e575a928..bf95dc1e3ce 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -1980,17 +1980,10 @@ comment at the start of cc-engine.el for more info." (end-of-line)) (setq macro-end (point)) ;; Check for an open block comment at the end of the macro. - (goto-char macro-start) - (let (s in-block-comment) - (while - (progn - (setq s (parse-partial-sexp (point) macro-end - nil nil s 'syntax-table)) - (< (point) macro-end)) - (setq in-block-comment - (and (elt s 4) ; in a comment - (null (elt s 7))))) ; a block comment - (if in-block-comment (setq safe-start nil))) + (let ((s (parse-partial-sexp macro-start macro-end))) + (if (and (elt s 4) ; in a comment + (null (elt s 7))) ; a block comment + (setq safe-start nil))) (forward-line 1) ;; Don't cache at eob in case the buffer is narrowed. (not (eobp)))