[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r109446: * search.c (Freplace_match):
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r109446: * search.c (Freplace_match): Treat \? in the replacement text literally. |
Date: |
Sun, 05 Aug 2012 21:30:15 +0800 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 109446
fixes bug: http://debbugs.gnu.org/8161
author: Lawrence Mitchell <address@hidden>
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sun 2012-08-05 21:30:15 +0800
message:
* search.c (Freplace_match): Treat \? in the replacement text literally.
modified:
etc/NEWS
src/ChangeLog
src/search.c
=== modified file 'etc/NEWS'
--- a/etc/NEWS 2012-08-03 10:23:30 +0000
+++ b/etc/NEWS 2012-08-05 13:30:15 +0000
@@ -482,6 +482,10 @@
* Incompatible Lisp Changes in Emacs 24.2
+** If the NEWTEXT arg to `replace-match' contains a substring "\?",
+that substring is inserted literally even if the LITERAL arg is
+non-nil, instead of causing an error to be signaled.
+
+++
** Docstrings starting with `*' no longer indicate user options.
Only variables defined using `defcustom' are considered user options.
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2012-08-05 07:45:12 +0000
+++ b/src/ChangeLog 2012-08-05 13:30:15 +0000
@@ -1,3 +1,8 @@
+2012-08-05 Lawrence Mitchell <address@hidden>
+
+ * search.c (Freplace_match): Treat \? in the replacement text
+ literally (Bug#8161).
+
2012-08-05 Chong Yidong <address@hidden>
* term.c (Vsuspend_tty_functions, Vresume_tty_functions):
=== modified file 'src/search.c'
--- a/src/search.c 2012-07-27 09:24:34 +0000
+++ b/src/search.c 2012-08-05 13:30:15 +0000
@@ -2226,6 +2226,9 @@
`\\N' means substitute what matched the Nth `\\(...\\)'.
If Nth parens didn't match, substitute nothing.
`\\\\' means insert one `\\'.
+ `\\?' is treated literally
+ (for compatibility with `query-replace-regexp').
+ Any other character following `\\' signals an error.
Case conversion does not apply to these substitutions.
FIXEDCASE and LITERAL are optional arguments.
@@ -2428,7 +2431,7 @@
}
else if (c == '\\')
delbackslash = 1;
- else
+ else if (c != '?')
error ("Invalid use of `\\' in replacement text");
}
if (substart >= 0)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r109446: * search.c (Freplace_match): Treat \? in the replacement text literally.,
Chong Yidong <=