]> code.delx.au - gnu-emacs/commitdiff
AWK Mode: make auto-newline work when there's "==" in the pattern.
authorAlan Mackenzie <acm@muc.de>
Sat, 8 Sep 2012 20:00:13 +0000 (20:00 +0000)
committerAlan Mackenzie <acm@muc.de>
Sat, 8 Sep 2012 20:00:13 +0000 (20:00 +0000)
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.

lisp/ChangeLog
lisp/progmodes/cc-cmds.el
lisp/progmodes/cc-engine.el

index 10458236c3002ccfed6648cbffba99e8921b23f2..ea69865c79f00bad5e9e422df7c58ffc14cab7f1 100644 (file)
@@ -1,3 +1,11 @@
+2012-09-08  Alan Mackenzie  <acm@muc.de>
+
+       AWK Mode: make auto-newline work when there's "==" in the pattern.
+       * progmodes/cc-cmds.el (c-point-syntax): Handle virtual semicolons
+       correctly.
+       * progmodes/cc-engine.el (c-guess-basic-syntax CASE 5A.3): Test
+       more rigorously for "=" token.
+
 2012-09-08  Dmitry Gutov  <dgutov@yandex.ru>
 
        * progmodes/ruby-mode.el (ruby-match-expression-expansion): Only
index 7cd0a0b0ae21c0c306c290210d8b51fbacf4dfbc..eec6873dc190580b2f80457208542e75aadfcbf4 100644 (file)
@@ -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))
index 142ec4cdd66a4cbd3915421de87c10d0bf3b7fe6..9188ab2fbfd4eec13b61a61302a187c02cd5cf8f 100644 (file)
@@ -9579,12 +9579,12 @@ comment at the start of cc-engine.el for more info."
                             (setq tmpsymbol nil)
                             (while (and (> (point) placeholder)
                                         (zerop (c-backward-token-2 1 t))
-                                        (/= (char-after) ?=))
+                                        (not (looking-at "=\\([^=]\\|$\\)")))
                               (and c-opt-inexpr-brace-list-key
                                    (not tmpsymbol)
                                    (looking-at c-opt-inexpr-brace-list-key)
                                    (setq tmpsymbol 'topmost-intro-cont)))
-                            (eq (char-after) ?=))
+                            (looking-at "=\\([^=]\\|$\\)"))
                           (looking-at c-brace-list-key))
                       (save-excursion
                         (while (and (< (point) indent-point)