diff options
author | Alan Mackenzie <acm@muc.de> | 2011-02-20 18:36:29 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2011-02-20 18:36:29 +0000 |
commit | bdfbdbb2197aa835bf8c09de964f7ba0cf086633 (patch) | |
tree | bc326e5849e74e38742c87068ee7e3d204646e54 | |
parent | aa9c0efca422faa3191144860728cd55a557a7fc (diff) | |
download | emacs-bdfbdbb2197aa835bf8c09de964f7ba0cf086633.tar.gz |
(c-end-of-statement): Set macro-end correctly at the end of a loop.
-rw-r--r-- | lisp/progmodes/cc-cmds.el | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index ec913e05c7e..5ac30bc28ce 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -2654,14 +2654,19 @@ sentence motion in or near comments and multiline strings." ;; Are we about to move forward into or out of a ;; preprocessor command? (when (eq (cdr res) 'macro-boundary) - (save-excursion - (end-of-line) - (setq macro-fence - (and (not (eobp)) - (progn (c-skip-ws-forward) - (c-beginning-of-macro)) - (progn (c-end-of-macro) - (point)))))) + (setq macro-fence + (save-excursion + (if macro-fence + (progn + (end-of-line) + (and (not (eobp)) + (progn (c-skip-ws-forward) + (c-beginning-of-macro)) + (progn (c-end-of-macro) + (point)))) + (and (not (eobp)) + (c-beginning-of-macro) + (progn (c-end-of-macro) (point))))))) ;; Are we about to move forward into a literal? (when (memq (cdr res) '(macro-boundary literal)) (setq range (c-ascertain-following-literal))) |