diff options
| author | Alan Mackenzie | 2017-08-31 19:06:16 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2017-08-31 19:06:16 +0000 |
| commit | 5fe41a23d811b17bcde0921b37b89175806c83ef (patch) | |
| tree | 22cf4ee2047efaa4a387785c6e8c28fe1d0dcb7b /lisp | |
| parent | 201f950e665153733b47b133a839921bc95806e3 (diff) | |
| download | emacs-5fe41a23d811b17bcde0921b37b89175806c83ef.tar.gz emacs-5fe41a23d811b17bcde0921b37b89175806c83ef.zip | |
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." | |||
| 1980 | (end-of-line)) | 1980 | (end-of-line)) |
| 1981 | (setq macro-end (point)) | 1981 | (setq macro-end (point)) |
| 1982 | ;; Check for an open block comment at the end of the macro. | 1982 | ;; Check for an open block comment at the end of the macro. |
| 1983 | (goto-char macro-start) | 1983 | (let ((s (parse-partial-sexp macro-start macro-end))) |
| 1984 | (let (s in-block-comment) | 1984 | (if (and (elt s 4) ; in a comment |
| 1985 | (while | 1985 | (null (elt s 7))) ; a block comment |
| 1986 | (progn | 1986 | (setq safe-start nil))) |
| 1987 | (setq s (parse-partial-sexp (point) macro-end | ||
| 1988 | nil nil s 'syntax-table)) | ||
| 1989 | (< (point) macro-end)) | ||
| 1990 | (setq in-block-comment | ||
| 1991 | (and (elt s 4) ; in a comment | ||
| 1992 | (null (elt s 7))))) ; a block comment | ||
| 1993 | (if in-block-comment (setq safe-start nil))) | ||
| 1994 | (forward-line 1) | 1987 | (forward-line 1) |
| 1995 | ;; Don't cache at eob in case the buffer is narrowed. | 1988 | ;; Don't cache at eob in case the buffer is narrowed. |
| 1996 | (not (eobp))) | 1989 | (not (eobp))) |