diff options
| author | Chong Yidong | 2012-11-07 23:46:35 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-11-07 23:46:35 +0800 |
| commit | 8a3afaf9ea1812d8c341ea27744d68441f3ce5a5 (patch) | |
| tree | 244e51a1425d349396fedf44a74e0bb6da6ab714 | |
| parent | fdaf534a7b1f94563065f0136cb7bac981722877 (diff) | |
| download | emacs-8a3afaf9ea1812d8c341ea27744d68441f3ce5a5.tar.gz emacs-8a3afaf9ea1812d8c341ea27744d68441f3ce5a5.zip | |
* doc/lispref/searching.texi (Replacing Match): Document \? in replace-match.
| -rw-r--r-- | doc/lispref/ChangeLog | 2 | ||||
| -rw-r--r-- | doc/lispref/searching.texi | 27 | ||||
| -rw-r--r-- | etc/NEWS | 1 |
3 files changed, 21 insertions, 9 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 1339e727bd8..eba44b5743d 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | 7 | ||
| 8 | 2012-11-07 Chong Yidong <cyd@gnu.org> | 8 | 2012-11-07 Chong Yidong <cyd@gnu.org> |
| 9 | 9 | ||
| 10 | * searching.texi (Replacing Match): Document \? in replace-match. | ||
| 11 | |||
| 10 | * variables.texi (Creating Buffer-Local): Document setq-local and | 12 | * variables.texi (Creating Buffer-Local): Document setq-local and |
| 11 | defvar-local. | 13 | defvar-local. |
| 12 | (Setting Generalized Variables): Arrange table alphabetically. | 14 | (Setting Generalized Variables): Arrange table alphabetically. |
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 56c96363e81..f165381a0f8 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi | |||
| @@ -1310,22 +1310,31 @@ part of one of the following sequences: | |||
| 1310 | @table @asis | 1310 | @table @asis |
| 1311 | @item @samp{\&} | 1311 | @item @samp{\&} |
| 1312 | @cindex @samp{&} in replacement | 1312 | @cindex @samp{&} in replacement |
| 1313 | @samp{\&} stands for the entire text being replaced. | 1313 | This stands for the entire text being replaced. |
| 1314 | 1314 | ||
| 1315 | @item @samp{\@var{n}} | 1315 | @item @samp{\@var{n}}, where @var{n} is a digit |
| 1316 | @cindex @samp{\@var{n}} in replacement | 1316 | @cindex @samp{\@var{n}} in replacement |
| 1317 | @samp{\@var{n}}, where @var{n} is a digit, stands for the text that | 1317 | This stands for the text that matched the @var{n}th subexpression in |
| 1318 | matched the @var{n}th subexpression in the original regexp. | 1318 | the original regexp. Subexpressions are those expressions grouped |
| 1319 | Subexpressions are those expressions grouped inside @samp{\(@dots{}\)}. | 1319 | inside @samp{\(@dots{}\)}. If the @var{n}th subexpression never |
| 1320 | If the @var{n}th subexpression never matched, an empty string is substituted. | 1320 | matched, an empty string is substituted. |
| 1321 | 1321 | ||
| 1322 | @item @samp{\\} | 1322 | @item @samp{\\} |
| 1323 | @cindex @samp{\} in replacement | 1323 | @cindex @samp{\} in replacement |
| 1324 | @samp{\\} stands for a single @samp{\} in the replacement text. | 1324 | This stands for a single @samp{\} in the replacement text. |
| 1325 | |||
| 1326 | @item @samp{\?} | ||
| 1327 | This stands for itself (for compatibility with @code{replace-regexp} | ||
| 1328 | and related commands; @pxref{Regexp Replacement,,, emacs, The GNU | ||
| 1329 | Emacs Manual}). | ||
| 1325 | @end table | 1330 | @end table |
| 1326 | 1331 | ||
| 1327 | These substitutions occur after case conversion, if any, | 1332 | @noindent |
| 1328 | so the strings they substitute are never case-converted. | 1333 | Any other character following @samp{\} signals an error. |
| 1334 | |||
| 1335 | The substitutions performed by @samp{\&} and @samp{\@var{n}} occur | ||
| 1336 | after case conversion, if any. Therefore, the strings they substitute | ||
| 1337 | are never case-converted. | ||
| 1329 | 1338 | ||
| 1330 | If @var{subexp} is non-@code{nil}, that says to replace just | 1339 | If @var{subexp} is non-@code{nil}, that says to replace just |
| 1331 | subexpression number @var{subexp} of the regexp that was matched, not | 1340 | subexpression number @var{subexp} of the regexp that was matched, not |
| @@ -699,6 +699,7 @@ sequence in later calls. | |||
| 699 | font name as a string. Whether it returns a font spec or a font name | 699 | font name as a string. Whether it returns a font spec or a font name |
| 700 | depends on the graphical library. | 700 | depends on the graphical library. |
| 701 | 701 | ||
| 702 | +++ | ||
| 702 | ** If the NEWTEXT arg to `replace-match' contains a substring "\?", | 703 | ** If the NEWTEXT arg to `replace-match' contains a substring "\?", |
| 703 | that substring is inserted literally even if the LITERAL arg is | 704 | that substring is inserted literally even if the LITERAL arg is |
| 704 | non-nil, instead of causing an error to be signaled. | 705 | non-nil, instead of causing an error to be signaled. |