diff options
| author | Alan Mackenzie | 2019-05-06 17:36:28 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2019-05-06 17:36:28 +0000 |
| commit | 77b1148b5164c71c4ba673173eed2a37918d4f78 (patch) | |
| tree | bc37220b5beb2c9f3dd96ea55f089a3e28d8e2fb | |
| parent | 63091313490beee4c5ed9767195c2a3df98f0332 (diff) | |
| download | emacs-77b1148b5164c71c4ba673173eed2a37918d4f78.tar.gz emacs-77b1148b5164c71c4ba673173eed2a37918d4f78.zip | |
c-beginning-of-statement-1: Handle syntactic WS macros properly.
* lisp/progmodes/cc-engine.el (c-beginning-of-statement-1): The variable
before-sws-pos should record the position of a closing paren/brace/bracket
before moving backwards over a sexp. When there is a syntactic WS macro
between the starting point and the closing p/b/b, setq before-sws-pos again
after moving backward over the macro.
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 7e6a46ea6e0..a2762ca2097 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -1143,6 +1143,9 @@ comment at the start of cc-engine.el for more info." | |||
| 1143 | ;; Have we moved into a macro? | 1143 | ;; Have we moved into a macro? |
| 1144 | ((and (not macro-start) | 1144 | ((and (not macro-start) |
| 1145 | (c-beginning-of-macro)) | 1145 | (c-beginning-of-macro)) |
| 1146 | (save-excursion | ||
| 1147 | (c-backward-syntactic-ws) | ||
| 1148 | (setq before-sws-pos (point))) | ||
| 1146 | ;; Have we crossed a statement boundary? If not, | 1149 | ;; Have we crossed a statement boundary? If not, |
| 1147 | ;; keep going back until we find one or a "real" sexp. | 1150 | ;; keep going back until we find one or a "real" sexp. |
| 1148 | (and | 1151 | (and |