[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: search-backward returning matches which end after point
From: |
Stefan Monnier |
Subject: |
Re: search-backward returning matches which end after point |
Date: |
Sat, 24 Aug 2024 11:20:20 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
> search-backward (and re-search-backward, and looking-back) don't return
> matches which end after point. Is there a version which does?
No 🙁
You could write a `while + looking-at` loop to do that, but if you want
something faster, you'll need to change the C code.
I don't expect it would be a difficult change, tho (it should not require
any significant change in the regexp engine, for example).
> The -prev commands defined by easy-mmode-define-navigation use
> re-search-backward. So if the point is inside the thing which the regex
> matches, then thing-prev command will not go to the start of the thing.
Of course, the same problem appears for search-forward when searching
from within the thing we're searching. In both cases the usual
workaround is to start your search elsewhere (i.e. take "small" step
back before searching forward or vice-versa).
Stefan
Re: search-backward returning matches which end after point, Andreas Röhler, 2024/08/26