diff options
| author | Alan Mackenzie | 2012-09-09 09:56:38 +0800 |
|---|---|---|
| committer | Leo Liu | 2012-09-09 09:56:38 +0800 |
| commit | 48e8c8aad6a03b6b20a781b29da8d3e445ab2af7 (patch) | |
| tree | 1111d4b3c79546928f04aa10b534d6d84dce1f2d | |
| parent | da8d07a31fec39b8bcc6db9625809fb349c50081 (diff) | |
| download | emacs-48e8c8aad6a03b6b20a781b29da8d3e445ab2af7.tar.gz emacs-48e8c8aad6a03b6b20a781b29da8d3e445ab2af7.zip | |
Backport: AWK Mode: make auto-newline work when there's "==" in the
pattern.
Fixes: debbugs:12188
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/progmodes/cc-cmds.el | 17 | ||||
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 4 |
3 files changed, 20 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2a735ef26fd..34e391a8c57 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2012-09-08 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | AWK Mode: make auto-newline work when there's "==" in the pattern. | ||
| 4 | * progmodes/cc-cmds.el (c-point-syntax): Handle virtual semicolons | ||
| 5 | correctly. | ||
| 6 | * progmodes/cc-engine.el (c-guess-basic-syntax CASE 5A.3): Test | ||
| 7 | more rigorously for "=" token. | ||
| 8 | |||
| 1 | 2012-09-08 Joel Bion <jpbion@westvi.com> (tiny change) | 9 | 2012-09-08 Joel Bion <jpbion@westvi.com> (tiny change) |
| 2 | 10 | ||
| 3 | * pcmpl-gnu.el (pcmpl-gnu-tarfile-regexp): Add tar.xz. (Bug#12382) | 11 | * pcmpl-gnu.el (pcmpl-gnu-tarfile-regexp): Add tar.xz. (Bug#12382) |
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index daa2e455c28..364263879ee 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." | |||
| 493 | (insert-char ?\n 1) | 493 | (insert-char ?\n 1) |
| 494 | ;; In AWK (etc.) or in a macro, make sure this CR hasn't changed | 494 | ;; In AWK (etc.) or in a macro, make sure this CR hasn't changed |
| 495 | ;; the syntax. (There might already be an escaped NL there.) | 495 | ;; the syntax. (There might already be an escaped NL there.) |
| 496 | (when (or (c-at-vsemi-p (1- (point))) | 496 | (when (or |
| 497 | (let ((pt (point))) | 497 | (save-excursion |
| 498 | (save-excursion | 498 | (c-skip-ws-backward (c-point 'bopl)) |
| 499 | (backward-char) | 499 | (c-at-vsemi-p)) |
| 500 | (and (c-beginning-of-macro) | 500 | (let ((pt (point))) |
| 501 | (progn (c-end-of-macro) | 501 | (save-excursion |
| 502 | (< (point) pt)))))) | 502 | (backward-char) |
| 503 | (and (c-beginning-of-macro) | ||
| 504 | (progn (c-end-of-macro) | ||
| 505 | (< (point) pt)))))) | ||
| 503 | (backward-char) | 506 | (backward-char) |
| 504 | (insert-char ?\\ 1) | 507 | (insert-char ?\\ 1) |
| 505 | (forward-char)) | 508 | (forward-char)) |
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 65e28c11e21..59d288ec1c3 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -9551,12 +9551,12 @@ comment at the start of cc-engine.el for more info." | |||
| 9551 | (setq tmpsymbol nil) | 9551 | (setq tmpsymbol nil) |
| 9552 | (while (and (> (point) placeholder) | 9552 | (while (and (> (point) placeholder) |
| 9553 | (zerop (c-backward-token-2 1 t)) | 9553 | (zerop (c-backward-token-2 1 t)) |
| 9554 | (/= (char-after) ?=)) | 9554 | (not (looking-at "=\\([^=]\\|$\\)"))) |
| 9555 | (and c-opt-inexpr-brace-list-key | 9555 | (and c-opt-inexpr-brace-list-key |
| 9556 | (not tmpsymbol) | 9556 | (not tmpsymbol) |
| 9557 | (looking-at c-opt-inexpr-brace-list-key) | 9557 | (looking-at c-opt-inexpr-brace-list-key) |
| 9558 | (setq tmpsymbol 'topmost-intro-cont))) | 9558 | (setq tmpsymbol 'topmost-intro-cont))) |
| 9559 | (eq (char-after) ?=)) | 9559 | (looking-at "=\\([^=]\\|$\\)")) |
| 9560 | (looking-at c-brace-list-key)) | 9560 | (looking-at c-brace-list-key)) |
| 9561 | (save-excursion | 9561 | (save-excursion |
| 9562 | (while (and (< (point) indent-point) | 9562 | (while (and (< (point) indent-point) |