diff options
author | Alan Mackenzie <acm@muc.de> | 2017-08-31 19:06:16 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2017-08-31 19:06:16 +0000 |
commit | 5fe41a23d811b17bcde0921b37b89175806c83ef (patch) | |
tree | 22cf4ee2047efaa4a387785c6e8c28fe1d0dcb7b /lisp | |
parent | 201f950e665153733b47b133a839921bc95806e3 (diff) | |
download | emacs-5fe41a23d811b17bcde0921b37b89175806c83ef.tar.gz |
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.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/progmodes/cc-engine.el | 15 |
1 files 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))) |