emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r108131: Backport: AWK Mode: make


From: Leo Liu
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r108131: Backport: AWK Mode: make auto-newline work when there's "==" in the
Date: Sun, 09 Sep 2012 09:56:38 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108131
fixes bug: http://debbugs.gnu.org/12188
author: Alan Mackenzie  <address@hidden>
committer: Leo Liu <address@hidden>
branch nick: emacs-24
timestamp: Sun 2012-09-09 09:56:38 +0800
message:
  Backport: AWK Mode: make auto-newline work when there's "==" in the
  pattern.
modified:
  lisp/ChangeLog
  lisp/progmodes/cc-cmds.el
  lisp/progmodes/cc-engine.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-09-08 00:59:04 +0000
+++ b/lisp/ChangeLog    2012-09-09 01:56:38 +0000
@@ -1,3 +1,11 @@
+2012-09-08  Alan Mackenzie  <address@hidden>
+
+       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  <address@hidden>  (tiny change)
 
        * pcmpl-gnu.el (pcmpl-gnu-tarfile-regexp): Add tar.xz.  (Bug#12382)

=== modified file 'lisp/progmodes/cc-cmds.el'
--- a/lisp/progmodes/cc-cmds.el 2012-07-21 01:41:48 +0000
+++ b/lisp/progmodes/cc-cmds.el 2012-09-09 01:56:38 +0000
@@ -493,13 +493,16 @@
       (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))

=== modified file 'lisp/progmodes/cc-engine.el'
--- a/lisp/progmodes/cc-engine.el       2012-04-11 15:32:30 +0000
+++ b/lisp/progmodes/cc-engine.el       2012-09-09 01:56:38 +0000
@@ -9551,12 +9551,12 @@
                             (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]