bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#24801: 25.1; Reverse regexp search highlighting


From: Eli Zaretskii
Subject: bug#24801: 25.1; Reverse regexp search highlighting
Date: Thu, 27 Oct 2016 05:33:52 +0300

> From: npostavs@users.sourceforge.net
> Date: Wed, 26 Oct 2016 18:42:20 -0400
> Cc: 24801@debbugs.gnu.org
> 
> > I see this behavior in Emacs 23 and later, but not in Emacs 22 and
> > before, so I'm guessing this change is maybe intentional.  But it's not
> > clear to me why it would be.
> 
> `(elisp) Regexp Search', under `re-search-backward' says:
> 
>      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.
> 
>      A true mirror-image of `re-search-forward' would require a special
>      feature for matching regular expressions from end to beginning.
>      It's not worth the trouble of implementing that.
> 
> And the texi source says the same at tag emacs-22.1; I've only built
> Emacs back to 23.4 though, so I can't test it.

I see the same behavior in all versions, including 22.x and 21.4.





reply via email to

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