From: Juri Linkov <juri@linkov.net>
To: Augusto Stoffel <arstoffel@gmail.com>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: master 2b3f3d421a: Make minibuffer lazy highlight setup buffer-local where appropriate
Date: Wed, 18 May 2022 21:59:04 +0300 [thread overview]
Message-ID: <86ee0qd5sf.fsf@mail.linkov.net> (raw)
In-Reply-To: <87lev2h590.fsf@gmail.com> (Augusto Stoffel's message of "Sun, 15 May 2022 23:10:03 +0200")
>> `add-function` is modeled after `add-hook`, so the above
>> `make-local-variable` would be better replaced with
>>
>> (add-function :after-while (local 'isearch-filter-predicate) filter)
>>
>> [ Of course, that's pure theory. You'd better test it first. ]
>
> Yes, I guess that's the right way to approach this. The attached patch
> implements it.
Thanks, pushed.
> Now, I had tried it earlier and noticed something looked fishy. Now I
> can reproduce the problem:
>
> 1. With an active region, call C-M-%
> 2. Switch from the minibuffer back to the original buffer
> 3. Call keyboard-escape-quit (maybe twice) to quit the minibuffer
> prompt.
>
> Then the buffer-local value of `isearch-filter-predicate' is not cleaned
> up. Is it by any chance intentional that minibuffer-exit-hook doesn't
> run in this case?
Indeed, a buffer-local minibuffer-exit-hook is not called
when the minibuffer is exited outside of the minibuffer.
This problem exists for all existing uses of buffer-local
minibuffer-exit-hook. For example, in 'string-rectangle':
1. activate a rectangular region
2. type 'C-x r t'
3. enter a string in the minibuffer
4. switch to the original buffer
5. call keyboard-escape-quit twice
The temporary review content of the rectangle is not erased
by rectangle--string-erase-preview from minibuffer-exit-hook.
next prev parent reply other threads:[~2022-05-18 18:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <165264034407.21518.7194358780844409479@vcs2.savannah.gnu.org>
[not found] ` <20220515184546.6304CC01683@vcs2.savannah.gnu.org>
2022-05-15 20:16 ` master 2b3f3d421a: Make minibuffer lazy highlight setup buffer-local where appropriate Stefan Monnier
2022-05-15 21:10 ` Augusto Stoffel
2022-05-18 18:59 ` Juri Linkov [this message]
2022-05-18 20:51 ` Stefan Monnier
2022-05-19 16:20 ` Juri Linkov
2022-05-22 14:40 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86ee0qd5sf.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=arstoffel@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.