diff options
| author | Alan Mackenzie | 2017-08-22 17:04:34 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2017-08-22 17:04:34 +0000 |
| commit | 4309d1574ae86244751600171b605b2b2eca4697 (patch) | |
| tree | 07add6321803d042dc966cf660d17b483ae86c5a | |
| parent | ee5a146e331c0bc73c46d608450399e5b90e6321 (diff) | |
| download | emacs-4309d1574ae86244751600171b605b2b2eca4697.tar.gz emacs-4309d1574ae86244751600171b605b2b2eca4697.zip | |
When looking for the end of a declarator, prevent macros fouling up the search
The practical implication of this bug was a random jit-lock chunk remaining
entirely unfontified.
* lisp/progmodes/cc-mode (c-fl-decl-end): If point starts inside a macro,
restrict two forward searches to the end of that macro.
| -rw-r--r-- | lisp/progmodes/cc-mode.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 0bf89b9a36a..48a6619bd1e 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -1549,10 +1549,13 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".") | |||
| 1549 | (c-backward-syntactic-ws) | 1549 | (c-backward-syntactic-ws) |
| 1550 | (when (setq pos1 (c-on-identifier)) | 1550 | (when (setq pos1 (c-on-identifier)) |
| 1551 | (goto-char pos1) | 1551 | (goto-char pos1) |
| 1552 | (when (and (c-forward-declarator) | 1552 | (let ((lim (save-excursion |
| 1553 | (eq (c-forward-token-2) 0)) | 1553 | (and (c-beginning-of-macro) |
| 1554 | (c-backward-syntactic-ws) | 1554 | (progn (c-end-of-macro) (point)))))) |
| 1555 | (point))))) | 1555 | (when (and (c-forward-declarator lim) |
| 1556 | (eq (c-forward-token-2 1 nil lim) 0)) | ||
| 1557 | (c-backward-syntactic-ws) | ||
| 1558 | (point)))))) | ||
| 1556 | 1559 | ||
| 1557 | (defun c-change-expand-fl-region (_beg _end _old-len) | 1560 | (defun c-change-expand-fl-region (_beg _end _old-len) |
| 1558 | ;; Expand the region (c-new-BEG c-new-END) to an after-change font-lock | 1561 | ;; Expand the region (c-new-BEG c-new-END) to an after-change font-lock |