emacs-devel
[Top][All Lists]
Advanced

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

Re: Is it valid to call isearch-filter-predicate outside isearch?


From: Michael Heerdegen
Subject: Re: Is it valid to call isearch-filter-predicate outside isearch?
Date: Fri, 02 Jun 2023 01:22:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Ihor Radchenko <yantar92@posteo.net> writes:

> > If it does, maybe using `post-command-hook' would be a better choice
> > than `isearch-end-hook' (which is, obviously, not a good choice)?
>
> Surely not. `post-command-hook' is triggered after each
> `self-insert-command' during isearch/query-replace.

Of course the idea is not to so something blindly.  One could check
whether isearch is still active and which overlays need to be kept.

> I had to advice `isearch-clean-overlays', which appears to be called by
> all the users of `isearch-filter-predicate' (replace-regexp, evil-mode,
> and swipet). Still a workaround. Ugly.

Hmm.  Maybe the optimum.

BTW, did you consider to :before advice the local variable
`isearch-filter-predicate' instead of overwriting it?  That would be a
bit nicer for users and other modes that also need to change it.


Michael.




reply via email to

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