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

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

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


From: Michael Heerdegen
Subject: bug#31584: 27.0.50; Document again what match re-search-backward finds
Date: Thu, 24 May 2018 23:59:08 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Michael Heidegger <michael_heerdegen@web.de> writes:

FWIW, my last name is "Heerdegen" AFAIK.

> >    The match found is the one starting last in the buffer
> >    and yet ending before the origin of the search.

> I've been bitten by this before. I'm sure the sentence you cite is
> correct, but I would suggest something more explicit about backwards
> searches. The most useful thing I could have read when I was wondering
> why this didn't work would be something like: "re-search-backward always
> behaves "non-greedily", i.e., it will find the shortest match before
> point".
>
> That might not be technically correct, but those are the terms that
> would have made sense to me: in particular, the "*" token is supposed to
> be "greedy", so why isn't it greedy backwards? This doesn't explain why
> it isn't, but it would have explicitly told me that it wouldn't be.

Without thinking long about it, I guess the above definition, and greedy
operators behaving non-greedy for backwards search, could be equivalent,
more or less.


Michael.





reply via email to

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