[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#49534: 26.3; Isearch should support using filter predicates with emp
bug#49534: 26.3; Isearch should support using filter predicates with empty search hits
Tue, 13 Jul 2021 18:27:32 +0200
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Drew Adams <firstname.lastname@example.org> writes:
> That won't work. Isearch is unnecessarily restrictive because of this
> test in `isearch-search', which if non-nil prevents invoking
> (= (match-beginning 0) (match-end 0))
The code is:
(isearch-search-string isearch-string nil t))
;; Clear RETRY unless the search predicate says
;; to skip this search hit.
(if (or (not isearch-success)
(= (match-beginning 0) (match-end 0))
(match-beginning 0) (match-end 0)))
(setq retry nil)))
I've tried following the logic here, but I'm not sure why we never retry
if the match is zero length. It looks like this was introduced here:
Author: Richard M. Stallman <email@example.com>
AuthorDate: Mon Feb 10 09:41:31 1997 +0000
(isearch-search): Refuse to match invisible text.
(isearch-range-invisible): New function.
(search-invisible): New user option.
And, indeed, the default predicate doesn't match on invisible text...
but I'm not sure why it's also testing the length of the match. (The
default predicate also checks this, so removing the test seems to
produce identical results by default.)
So I've added Richard to the CCs -- Richard, you don't happen to recall
the meaning of that apparently duplicated test in a patch that's only 24
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no