]> git.eshelyaron.com Git - emacs.git/commitdiff
Backport: AWK Mode: make auto-newline work when there's "==" in the
authorAlan Mackenzie <acm@muc.de>
Sun, 9 Sep 2012 01:56:38 +0000 (09:56 +0800)
committerLeo Liu <sdl.web@gmail.com>
Sun, 9 Sep 2012 01:56:38 +0000 (09:56 +0800)
pattern.

Fixes: debbugs:12188
lisp/ChangeLog
lisp/progmodes/cc-cmds.el
lisp/progmodes/cc-engine.el

index 2a735ef26fd24911a151066987a84c835c14ad27..34e391a8c5707cb52096e168312cfcbac50da95f 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  Joel Bion  <jpbion@westvi.com>  (tiny change)
 
        * pcmpl-gnu.el (pcmpl-gnu-tarfile-regexp): Add tar.xz.  (Bug#12382)
index daa2e455c28bc63edf3ce9026ab2ae452fff3276..364263879eeea13083b54a51d2f1c3115ef9dcf2 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 65e28c11e21c663c8488611ad68bef440d69edb9..59d288ec1c34267234e3298fd023ee3798a14ee0 100644 (file)
@@ -9551,12 +9551,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)