emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106942: Document negative repeat cou


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106942: Document negative repeat counts for search-forward and search-backward.
Date: Thu, 26 Jan 2012 23:48:27 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106942
fixes bug(s): http://debbugs.gnu.org/10507
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Thu 2012-01-26 23:48:27 +0800
message:
  Document negative repeat counts for search-forward and search-backward.
  
  * doc/lispref/searching.texi (String Search): Document negative repeat count.
  
  * src/search.c (Fsearch_forward, Fsearch_backward): Document negative
  repeat counts (Bug#10507).
modified:
  doc/lispref/ChangeLog
  doc/lispref/searching.texi
  src/ChangeLog
  src/search.c
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog     2012-01-26 06:30:49 +0000
+++ b/doc/lispref/ChangeLog     2012-01-26 15:48:27 +0000
@@ -1,3 +1,8 @@
+2012-01-26  Chong Yidong  <address@hidden>
+
+       * searching.texi (String Search): Document negative repeat count
+       (Bug#10507).
+
 2012-01-26  Glenn Morris  <address@hidden>
 
        * variables.texi (Using Lexical Binding):

=== modified file 'doc/lispref/searching.texi'
--- a/doc/lispref/searching.texi        2012-01-19 07:21:25 +0000
+++ b/doc/lispref/searching.texi        2012-01-26 15:48:27 +0000
@@ -49,7 +49,6 @@
 @var{string}.  If successful, it sets point to the end of the occurrence
 found, and returns the new value of point.  If no match is found, the
 value and side effects depend on @var{noerror} (see below).
address@hidden Emacs 19 feature
 
 In the following example, point is initially at the beginning of the
 line.  Then @code{(search-forward "fox")} moves point after the last
@@ -91,18 +90,21 @@
 find a match.  Invalid arguments cause errors regardless of
 @var{noerror}.
 
-If @var{repeat} is supplied (it must be a positive number), then the
-search is repeated that many times (each time starting at the end of the
-previous time's match).  If these successive searches succeed, the
-function succeeds, moving point and returning its new value.  Otherwise
-the search fails, with results depending on the value of
address@hidden, as described above.
+If @var{repeat} is a positive number @var{n}, it serves as a repeat
+count: the search is repeated @var{n} times, each time starting at the
+end of the previous time's match.  If these successive searches
+succeed, the function succeeds, moving point and returning its new
+value.  Otherwise the search fails, with results depending on the
+value of @var{noerror}, as described above.  If @var{repeat} is a
+negative number address@hidden, it serves as a repeat count of @var{n} for a
+search in the opposite (backward) direction.
 @end deffn
 
 @deffn Command search-backward string &optional limit noerror repeat
 This function searches backward from point for @var{string}.  It is
-just like @code{search-forward} except that it searches backwards and
-leaves point at the beginning of the match.
+like @code{search-forward}, except that it searches backwards rather
+than forwards.  Backward searches leave point at the beginning of the
+match.
 @end deffn
 
 @deffn Command word-search-forward string &optional limit noerror repeat

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-01-26 06:30:49 +0000
+++ b/src/ChangeLog     2012-01-26 15:48:27 +0000
@@ -1,3 +1,8 @@
+2012-01-26  Chong Yidong  <address@hidden>
+
+       * search.c (Fsearch_forward, Fsearch_backward): Document negative
+       repeat counts (Bug#10507).
+
 2012-01-26  Glenn Morris  <address@hidden>
 
        * lread.c (syms_of_lread): Doc fix.

=== modified file 'src/search.c'
--- a/src/search.c      2012-01-19 07:21:25 +0000
+++ b/src/search.c      2012-01-26 15:48:27 +0000
@@ -2181,7 +2181,9 @@
 The match found must not extend before that position.
 Optional third argument, if t, means if fail just return nil (no error).
  If not nil and not t, position at limit of search and return nil.
-Optional fourth argument is repeat count--search for successive occurrences.
+Optional fourth argument COUNT, if non-nil, means to search for COUNT
+ successive occurrences.  If COUNT is negative, search forward,
+ instead of backward, for -COUNT occurrences.
 
 Search case-sensitivity is determined by the value of the variable
 `case-fold-search', which see.
@@ -2200,7 +2202,9 @@
   equivalent to (point-max).
 Optional third argument, if t, means if fail just return nil (no error).
   If not nil and not t, move to limit of search and return nil.
-Optional fourth argument is repeat count--search for successive occurrences.
+Optional fourth argument COUNT, if non-nil, means to search for COUNT
+ successive occurrences.  If COUNT is negative, search backward,
+ instead of forward, for -COUNT occurrences.
 
 Search case-sensitivity is determined by the value of the variable
 `case-fold-search', which see.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]