[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/man/search.texi [lexbind]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/man/search.texi [lexbind] |
Date: |
Tue, 06 Jul 2004 06:59:34 -0400 |
Index: emacs/man/search.texi
diff -c emacs/man/search.texi:1.33.2.5 emacs/man/search.texi:1.33.2.6
*** emacs/man/search.texi:1.33.2.5 Tue Jul 6 09:23:50 2004
--- emacs/man/search.texi Tue Jul 6 10:23:38 2004
***************
*** 231,248 ****
Vertical scrolling during incremental search can be enabled by
setting the customizable variable @code{isearch-allow-scroll} to a
! non-nil value.
You can then use the vertical scroll-bar or certain keyboard
commands such as @address@hidden (@code{scroll-down}),
@address@hidden (@code{scroll-up}) and @kbd{C-l} (@code{recenter})
within the search, thus letting you see more of the text near the
current match. You must run these commands via their key sequences to
! stay in the search - typing M-x @var{comand-name} will always
terminate a search.
You can give prefix arguments to these commands in the usual way.
! The current match cannot be scrolled out of the window - this is
intentional.
Several other commands, such as @kbd{C-x 2}
--- 231,248 ----
Vertical scrolling during incremental search can be enabled by
setting the customizable variable @code{isearch-allow-scroll} to a
! address@hidden value.
You can then use the vertical scroll-bar or certain keyboard
commands such as @address@hidden (@code{scroll-down}),
@address@hidden (@code{scroll-up}) and @kbd{C-l} (@code{recenter})
within the search, thus letting you see more of the text near the
current match. You must run these commands via their key sequences to
! stay in the search---typing M-x @var{comand-name} will always
terminate a search.
You can give prefix arguments to these commands in the usual way.
! The current match cannot be scrolled out of the window---this is
intentional.
Several other commands, such as @kbd{C-x 2}
***************
*** 847,853 ****
@vindex isearch-allow-scroll
Scrolling, etc., during incremental search is enabled by setting the
! customizable variable @code{isearch-allow-scroll} to a non-nil value.
@c See Subject: Info file: How do I get an itemized list without blank lines?
@c Date: Sat, 12 Apr 2003 09:45:31 +0000 in gnu.emacs.help
--- 847,853 ----
@vindex isearch-allow-scroll
Scrolling, etc., during incremental search is enabled by setting the
! customizable variable @code{isearch-allow-scroll} to a address@hidden value.
@c See Subject: Info file: How do I get an itemized list without blank lines?
@c Date: Sat, 12 Apr 2003 09:45:31 +0000 in gnu.emacs.help
***************
*** 893,899 ****
You should only thus configure commands which are ``safe'': i.e., they
won't leave emacs in an inconsistent state when executed within a
! search - that is to say, the following things may be changed by a
command only temporarily, and must be restored before the command
finishes:
--- 893,899 ----
You should only thus configure commands which are ``safe'': i.e., they
won't leave emacs in an inconsistent state when executed within a
! search---that is to say, the following things may be changed by a
command only temporarily, and must be restored before the command
finishes:
***************
*** 913,919 ****
window's size, or create or delete other windows and frames.
Note that an attempt by a command to scroll the text
! @emph{horizontally} won't work, although it will do no harm - any such
scrolling will be overriden and nullified by the display code.
@node Replace, Other Repeating Search, Configuring Scrolling, Search
--- 913,919 ----
window's size, or create or delete other windows and frames.
Note that an attempt by a command to scroll the text
! @emph{horizontally} won't work, although it will do no harm---any such
scrolling will be overriden and nullified by the display code.
@node Replace, Other Repeating Search, Configuring Scrolling, Search
***************
*** 977,985 ****
What if you want to exchange @samp{x} and @samp{y}: replace every @samp{x}
with a @samp{y} and vice versa? You can do it this way:
@example
! M-x query-replace @key{RET} x @key{RET} @@TEMP@@ @key{RET}
! M-x query-replace @key{RET} y @key{RET} x @key{RET}
! M-x query-replace @key{RET} @@TEMP@@ @key{RET} y @key{RET}
@end example
@noindent
--- 977,985 ----
What if you want to exchange @samp{x} and @samp{y}: replace every @samp{x}
with a @samp{y} and vice versa? You can do it this way:
@example
! M-x replace-string @key{RET} x @key{RET} @@TEMP@@ @key{RET}
! M-< M-x replace-string @key{RET} y @key{RET} x @key{RET}
! M-< M-x replace-string @key{RET} @@TEMP@@ @key{RET} y @key{RET}
@end example
@noindent
***************
*** 993,1005 ****
single string. The similar command @kbd{M-x replace-regexp} replaces
any match for a specified pattern.
! In @code{replace-regexp}, the @var{newstring} need not be constant: it
! can refer to all or part of what is matched by the @var{regexp}.
! @samp{\&} in @var{newstring} stands for the entire match being replaced.
! @address@hidden in @var{newstring}, where @var{d} is a digit, stands for
! whatever matched the @var{d}th parenthesized grouping in @var{regexp}.
! To include a @samp{\} in the text to replace with, you must enter
! @samp{\\}. For example,
@example
M-x replace-regexp @key{RET} c[ad]+r @key{RET} \&-safe @key{RET}
--- 993,1007 ----
single string. The similar command @kbd{M-x replace-regexp} replaces
any match for a specified pattern.
! In @code{replace-regexp}, the @var{newstring} need not be constant:
! it can refer to all or part of what is matched by the @var{regexp}.
! @samp{\&} in @var{newstring} stands for the entire match being
! replaced. @address@hidden in @var{newstring}, where @var{d} is a
! digit, stands for whatever matched the @var{d}th parenthesized
! grouping in @var{regexp}. @samp{\#} refers to the count of
! replacements already made in this command, as a decimal number. In
! the first replacement, @samp{\#} stands for @samp{0}; in the second,
! for @samp{1}; and so on. For example,
@example
M-x replace-regexp @key{RET} c[ad]+r @key{RET} \&-safe @key{RET}
***************
*** 1014,1020 ****
@end example
@noindent
! performs the inverse transformation.
@node Replacement and Case, Query Replace, Regexp Replace, Replace
@subsection Replace Commands and Case
--- 1016,1076 ----
@end example
@noindent
! performs the inverse transformation. To include a @samp{\} in the
! text to replace with, you must enter @samp{\\}.
!
! You can also use Lisp expressions to calculate parts of the
! replacement string. To do this, write @samp{\,} followed by the
! expression in the replacement string. Each replacement calculates the
! value of the expression, which ought to be a string, and uses it in
! the replacement string in place of the expression itself. If the
! expression is a symbol, one space in the replacement string after the
! symbol name counts as part of the symbol name, so the value replaces
! them both.
!
! Inside such an expression, @samp{\&} and @address@hidden used as
! subexpressions refer respectively to the entire match as a string, and
! to a submatch as a string. @var{n} may exceed 9 here, and the value
! of @address@hidden is @code{nil} if subexpression @var{n} did not
! match. You can also use @samp{\#&} and @address@hidden refer to
! those matches converted to numbers (this is valid when the match or
! submatch has the form of a number). @samp{\#} stands for the number
! of already-completed replacements.
!
! Repeating our example to exchange @samp{x} and @samp{y}, we can thus
! do it also this way:
!
! @example
! M-x replace-regexp @key{RET} \(x\)\|y @key{RET}
! \,(if \1 "y" "x") @key{RET}
! @end example
!
! The @code{format} function (@pxref{Formatting Strings,,,elisp, GNU
! Emacs Lisp Reference Manual}) comes in handy for computing replacement
! strings for @samp{\,}. For example, to add consecutively numbered
! strings like @samp{ABC00042} to columns 73 @w{to 80} (unless they are
! already occupied), you can use
!
! @example
! M-x replace-regexp @key{RET} address@hidden,address@hidden @key{RET}
! \,(format "%-72sABC%05d" \& \#) @key{RET}
! @end example
!
! If you want to enter part of the replacement string by hand each
! time, use @samp{\?} in the replacement string. Each replacement will
! enter a recursive edit, with point at the position where the @samp{\?}
! was. For example,
!
! @example
! M-x replace-regexp @key{RET} address@hidden @key{RET}
! \&address@hidden:address@hidden @key{RET}
! @end example
!
! @noindent
! will add labels starting with @address@hidden:address@hidden to occurences of
! @address@hidden, but letting you edit each replacement before
! performing it. To number the labels starting at 1, use @samp{\,(1+
! \#)} instead of @samp{\#}.
@node Replacement and Case, Query Replace, Regexp Replace, Replace
@subsection Replace Commands and Case
***************
*** 1126,1134 ****
@item ^
to go back to the position of the previous occurrence (or what used to
! be an occurrence), in case you changed it by mistake. This works by
! popping the mark ring. Only one @kbd{^} in a row is meaningful, because
! only one previous replacement position is kept during @code{query-replace}.
@item C-r
to enter a recursive editing level, in case the occurrence needs to be
--- 1182,1189 ----
@item ^
to go back to the position of the previous occurrence (or what used to
! be an occurrence), in case you changed it by mistake or want to
! reexamine it.
@item C-r
to enter a recursive editing level, in case the occurrence needs to be