Subject: bug#31584: 27.0.50; Document again what match re-search-backward finds

From: Noam Postavsky <[email-masked]>
Date: Thu, 24 May 2018 21:27:36 -0400

Michael Heerdegen <[email-masked]> writes:

> The anchor is in this paragraph:
>
>    Nonincremental search for a regexp is done with the commands
> ‘re-search-forward’ and ‘re-search-backward’. [...]

Ah, no, the anchor (which I added as part of the patch) is in the elisp
manual, not the emacs manual.

 <<<<<ANCHOR IS HERE>>>>>>
 -- Command: re-search-backward regexp &optional limit noerror count
     This function searches backward in the current buffer for a string
     of text that is matched by the regular expression REGEXP, leaving
     point at the beginning of the first text found.

     This function is analogous to `re-search-forward', but they are not
     simple mirror images.  `re-search-forward' finds the match whose
     beginning is as close as possible to the starting point.  If
     `re-search-backward' were a perfect mirror image, it would find the
     match whose end is as close as possible.  However, in fact it
     finds the match whose beginning is as close as possible (and yet
     ends before the starting point).  The reason for this is that
     matching a regular expression at a given spot always works from
     beginning to end, and starts at a specified beginning position.