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: Sun, 04 Jun 2023 04:06:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Ihor Radchenko <yantar92@posteo.net> writes:

> Michael Heerdegen <michael_heerdegen@web.de> writes:
>
> >> 2. It feels against the interface. If advising this predicate is
> >>    expected, why not convert it into an abnormal hook?
> >
> > It's more flexible and expressive, as Drew already mentioned.  For
> > example, how the members of a hook are logically combined (`and'ed,
> > `or'ed) is fixed in a hook, but not when using advising.
>
> Interesting.  From Elisp Tips in the manual, I always felt that using
> advices is always frowned upon. And you are suggesting that they are
> the better way to go in these situations.  I am wondering if this
> thing with modifying predicates should be documented somewhere and
> recommended approach.

Though, "better" does not necessarily mean "best".

Why do we have to change the bindings (of those diverse Isearch
variables) at all?  If Isearch behaves specially in Dired, and we maybe
consider WDired a submode of Dired, we could say: we make the respective
variables permanently buffer local in Dired buffers and bind them to a
function that always works in all cases: the bound functions could just
test whether the buffer is in dired-mode or wdired-mode, and whether
`dired-isearch-filenames-mode' is enabled, and do the right thing.

Would that be possible?


Michael.




reply via email to

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