diff options
| author | Alan Mackenzie | 2017-11-12 11:49:03 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2017-11-12 11:49:03 +0000 |
| commit | 42daf83f08b2b0ef9d571e535195df55d392ef79 (patch) | |
| tree | c179741bf85ec29b6e05554f517d670cdfdfbe9f | |
| parent | 7775c4729814431608c943643a490ad5f1f68a99 (diff) | |
| download | emacs-42daf83f08b2b0ef9d571e535195df55d392ef79.tar.gz emacs-42daf83f08b2b0ef9d571e535195df55d392ef79.zip | |
CC Mode: Fix defun-open being recognized as brace-list-open at EOB.
* lisp/progmodes/cc-engine.el (c-looking-at-statement-block): Add handling
for an open brace at EOB and nested braces inside an unclosed brace block.
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 8ec01e1810b..ab0204cb961 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -10740,10 +10740,8 @@ comment at the start of cc-engine.el for more info." | |||
| 10740 | (t ; We're at (1+ here). | 10740 | (t ; We're at (1+ here). |
| 10741 | (cond | 10741 | (cond |
| 10742 | ((progn (c-forward-syntactic-ws) | 10742 | ((progn (c-forward-syntactic-ws) |
| 10743 | (eq (point) (1- there))) | 10743 | (eq (point) (1- there)))) |
| 10744 | t) | 10744 | ((c-syntactic-re-search-forward c-keywords-regexp there t)) |
| 10745 | ((c-syntactic-re-search-forward c-keywords-regexp there t) | ||
| 10746 | t) | ||
| 10747 | ((c-syntactic-re-search-forward "{" there t t) | 10745 | ((c-syntactic-re-search-forward "{" there t t) |
| 10748 | (backward-char) | 10746 | (backward-char) |
| 10749 | (c-looking-at-statement-block)) | 10747 | (c-looking-at-statement-block)) |
| @@ -10752,8 +10750,12 @@ comment at the start of cc-engine.el for more info." | |||
| 10752 | (cond | 10750 | (cond |
| 10753 | ((c-syntactic-re-search-forward "[;,]" nil t t) | 10751 | ((c-syntactic-re-search-forward "[;,]" nil t t) |
| 10754 | (eq (char-before) ?\;)) | 10752 | (eq (char-before) ?\;)) |
| 10755 | ((c-syntactic-re-search-forward c-keywords-regexp nil t t) | 10753 | ((progn (c-forward-syntactic-ws) |
| 10756 | t) | 10754 | (eobp))) |
| 10755 | ((c-syntactic-re-search-forward c-keywords-regexp nil t t)) | ||
| 10756 | ((c-syntactic-re-search-forward "{" nil t t) | ||
| 10757 | (backward-char) | ||
| 10758 | (c-looking-at-statement-block)) | ||
| 10757 | (t nil))) | 10759 | (t nil))) |
| 10758 | (goto-char here)))) | 10760 | (goto-char here)))) |
| 10759 | 10761 | ||