all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: 31584@debbugs.gnu.org
Subject: bug#31584: 27.0.50; Document again what match re-search-backward finds
Date: Thu, 24 May 2018 15:10:26 -0700	[thread overview]
Message-ID: <87sh6gg0x9.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87in7cg2qw.fsf@web.de>

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Michael Heidegger <michael_heerdegen@web.de> writes:
>
> FWIW, my last name is "Heerdegen" AFAIK.

It's not too late to change!

I blame `flyspell-auto-correct-previous-word' for this stuff the same
way that other people blame autocorrect on iOS. Apparently I randomly
hit "C-;" a lot.

>> >    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.

I agree they're equivalent, but it would take me longer to think about
it, particularly when I'm trying to make a regexp match and am already
annoyed. But it was just a suggestion -- so long as something gets in
there, I don't mind.

Eric






  reply	other threads:[~2018-05-24 22:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-24 21:31 bug#31584: 27.0.50; Document again what match re-search-backward finds Michael Heerdegen
2018-05-24 21:42 ` Eric Abrahamsen
2018-05-24 21:59   ` Michael Heerdegen
2018-05-24 22:10     ` Eric Abrahamsen [this message]
2018-05-24 22:14   ` Noam Postavsky
2018-05-24 22:47     ` Eric Abrahamsen
2018-05-24 22:47     ` Michael Heerdegen
2018-05-24 23:55       ` Noam Postavsky
2018-05-25  0:22         ` Michael Heerdegen
2018-05-25  0:31           ` Noam Postavsky
2018-05-25  0:36             ` Eric Abrahamsen
2018-05-25  1:10             ` Michael Heerdegen
2018-05-25  1:27               ` Noam Postavsky
2018-05-25  1:48                 ` Michael Heerdegen
2018-05-25  6:23         ` Eli Zaretskii
2018-05-25 11:59           ` Noam Postavsky
2018-05-25  0:28     ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sh6gg0x9.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=31584@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.