summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-cmds.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2012-09-08 20:00:13 +0000
committerAlan Mackenzie <acm@muc.de>2012-09-08 20:00:13 +0000
commitace2989a842a84483702cbef6284fe7a8300e18a (patch)
tree6d04572259cc9cd925650b2bd736cd5a1a5ac706 /lisp/progmodes/cc-cmds.el
parenteabf0404414f2828c08d1d5d8fab4740670e7541 (diff)
downloademacs-ace2989a842a84483702cbef6284fe7a8300e18a.tar.gz
emacs-ace2989a842a84483702cbef6284fe7a8300e18a.tar.bz2
emacs-ace2989a842a84483702cbef6284fe7a8300e18a.zip
AWK Mode: make auto-newline work when there's "==" in the pattern.
cc-cmds.el (c-point-syntax): Handle virtual semicolons correctly. cc-engine.el (c-guess-basic-syntax CASE 5A.3): Test more rigorously for "=" token.
Diffstat (limited to 'lisp/progmodes/cc-cmds.el')
-rw-r--r--lisp/progmodes/cc-cmds.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 7cd0a0b0ae2..eec6873dc19 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -493,13 +493,16 @@ inside a literal or a macro, nothing special happens."
(insert-char ?\n 1)
;; In AWK (etc.) or in a macro, make sure this CR hasn't changed
;; the syntax. (There might already be an escaped NL there.)
- (when (or (c-at-vsemi-p (1- (point)))
- (let ((pt (point)))
- (save-excursion
- (backward-char)
- (and (c-beginning-of-macro)
- (progn (c-end-of-macro)
- (< (point) pt))))))
+ (when (or
+ (save-excursion
+ (c-skip-ws-backward (c-point 'bopl))
+ (c-at-vsemi-p))
+ (let ((pt (point)))
+ (save-excursion
+ (backward-char)
+ (and (c-beginning-of-macro)
+ (progn (c-end-of-macro)
+ (< (point) pt))))))
(backward-char)
(insert-char ?\\ 1)
(forward-char))