bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#41338: Toolbar-bug in Emacs 27.0.91/Pretest


From: Juri Linkov
Subject: bug#41338: Toolbar-bug in Emacs 27.0.91/Pretest
Date: Tue, 23 Jul 2024 21:00:41 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)

close 41338 31.0.50
thanks

>>>> isearch uses overriding-terminal-local-map, so the proper test case is:
>>>>
>>>> (setq overriding-terminal-local-map
>>>>       (let ((map (make-keymap)))
>>>>    (define-key map [delete-frame]
>>>>      (lambda (&rest ignore)
>>>>        (interactive)
>>>>        (message "DELETE-FRAME")))
>>>>    (define-key map "!"
>>>>      (lambda (&rest ignore)
>>>>        (interactive)
>>>>        (message "!")))
>>>>    map))
>>>>
>>>> and indeed typing '!' you get the message,
>>>> but no message when clicking the `X' icon.
>>>
>>> The docstring of 'overriding-terminal-local-map' says:
>>>
>>>   Per-terminal keymap that takes precedence over all other keymaps.
>>>
>>> so maybe this is right for a *per-terminal* keymap not to react
>>> to window events such as clicking the `X' icon?
>>
>> If there is no bug here, then I see two possible solutions for isearch:
>>
>> 1. use special-event-map in isearch.el the same way as isearch.el uses
>>    overriding-terminal-local-map;
>>
>> 2. use the hook ‘delete-frame-functions’ to explicitly exit isearch.
>
> Since nobody proposed a better solution, here is a fix:
>
> diff --git a/lisp/isearch.el b/lisp/isearch.el
> index 505837de988..005376f8257 100644
> --- a/lisp/isearch.el
> +++ b/lisp/isearch.el
> @@ -1330,6 +1333,7 @@ isearch-mode
>    (add-hook 'pre-command-hook 'isearch-pre-command-hook)
>    (add-hook 'post-command-hook 'isearch-post-command-hook)
>    (add-hook 'mouse-leave-buffer-hook 'isearch-mouse-leave-buffer)
> +  (add-hook 'delete-frame-functions 'isearch-done)
>    (add-hook 'kbd-macro-termination-hook 'isearch-done)
>  
>    ;; isearch-mode can be made modal (in the sense of not returning to
> @@ -1430,6 +1434,7 @@ isearch-done
>    (remove-hook 'pre-command-hook 'isearch-pre-command-hook)
>    (remove-hook 'post-command-hook 'isearch-post-command-hook)
>    (remove-hook 'mouse-leave-buffer-hook 'isearch-mouse-leave-buffer)
> +  (remove-hook 'delete-frame-functions 'isearch-done)
>    (remove-hook 'kbd-macro-termination-hook 'isearch-done)
>    (when (buffer-live-p isearch--current-buffer)
>      (with-current-buffer isearch--current-buffer

So now this is pushed to master, and closed.





reply via email to

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