emacs-devel
[Top][All Lists]
Advanced

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

Re: master 2b3f3d421a: Make minibuffer lazy highlight setup buffer-local


From: Juri Linkov
Subject: Re: master 2b3f3d421a: Make minibuffer lazy highlight setup buffer-local where appropriate
Date: Wed, 18 May 2022 21:59:04 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>> `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.



reply via email to

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