mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-17 01:34:21 +00:00
* search.c (Freplace_match): Treat \? in the replacement text literally.
Fixes: debbugs:8161
This commit is contained in:
parent
68b0c113f6
commit
d32e47aff6
3 changed files with 13 additions and 1 deletions
4
etc/NEWS
4
etc/NEWS
|
|
@ -482,6 +482,10 @@ inefficiency, and not namespace-clean.
|
|||
|
||||
* 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.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
2012-08-05 Lawrence Mitchell <wence@gmx.li>
|
||||
|
||||
* search.c (Freplace_match): Treat \? in the replacement text
|
||||
literally (Bug#8161).
|
||||
|
||||
2012-08-05 Chong Yidong <cyd@gnu.org>
|
||||
|
||||
* term.c (Vsuspend_tty_functions, Vresume_tty_functions):
|
||||
|
|
|
|||
|
|
@ -2226,6 +2226,9 @@ Otherwise treat `\\' as special:
|
|||
`\\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 @@ since only regular expressions have distinguished subexpressions. */)
|
|||
}
|
||||
else if (c == '\\')
|
||||
delbackslash = 1;
|
||||
else
|
||||
else if (c != '?')
|
||||
error ("Invalid use of `\\' in replacement text");
|
||||
}
|
||||
if (substart >= 0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue