From 5fe41a23d811b17bcde0921b37b89175806c83ef Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Thu, 31 Aug 2017 19:06:16 +0000 Subject: [PATCH] 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. --- lisp/progmodes/cc-engine.el | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) 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))) -- 2.39.2