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: Eli Zaretskii
Subject: Re: Is it valid to call isearch-filter-predicate outside isearch?
Date: Wed, 31 May 2023 15:44:14 +0300

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: emacs-devel@gnu.org
> Date: Wed, 31 May 2023 10:08:55 +0000
> 
> Juri Linkov <juri@linkov.net> writes:
> 
> > Emacs 29 introduced a new value 'can-be-opened' of the variable
> > 'search-invisible' for side-effect-free uses.
> >
> > Probably you can bind it to this value in Org mode functions.
> 
> Not really. Because Org produces its own side effects to make isearch
> support revealing text hidden via text properties.
> 
> I guess the answer to my question about `isearch-filter-predicate' is
> yes - it may be called outside isearch and thus custom
> `isearch-filter-predicate' must consider scenarios outside isearch.
> 
> It would be nice if the docstring of `isearch-filter-predicate'
> mentioned that it might be called outside isearch-mode.

I don't really understand what you are asking here to document.  From
reading the discussion, it sounds like you set
isearch-filter-predicate to a function that relies on some
(unidentified) isearch hooks to undo its side effects?  And you did
that without studying all of the existing callers of
isearch-filter-predicate?  Not sure how documentation could have
solved this for you.

In general, a predicate is not expected to have side effects, it is
expected to return a boolean value and leave everything else intact.

(I also don't understand what does isearch-range-invisible have to do
with this.)



reply via email to

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