unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Drew Adams <drew.adams@oracle.com>
Cc: 41338@debbugs.gnu.org, Stephen Berman <stephen.berman@gmx.net>,
	Konrad Podczeck <konrad.podczeck@univie.ac.at>
Subject: bug#41338: Toolbar-bug in Emacs 27.0.91/Pretest
Date: Thu, 09 Mar 2023 19:14:04 +0200	[thread overview]
Message-ID: <86cz5hrjwr.fsf@mail.linkov.net> (raw)
In-Reply-To: <87o8plb6kh.fsf@mail.linkov.net> (Juri Linkov's message of "Mon,  15 Jun 2020 01:55:58 +0300")

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





      reply	other threads:[~2023-03-09 17:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-16 20:43 bug#41338: Toolbar-bug in Emacs 27.0.91/Pretest Konrad Podczeck
2020-05-16 21:34 ` Stephen Berman
2020-05-16 22:55   ` Juri Linkov
2020-05-17  8:20     ` martin rudalics
2020-05-17  8:56       ` Stephen Berman
2020-05-17  9:11         ` Stephen Berman
2020-05-17 12:36           ` Eli Zaretskii
2020-05-17 12:59             ` Stephen Berman
2020-05-17 13:12               ` Eli Zaretskii
2020-05-17 13:37                 ` Stephen Berman
2020-05-17 14:22                   ` Eli Zaretskii
2020-05-17 14:49                     ` Stephen Berman
2020-05-17 22:03                       ` Juri Linkov
2020-05-17 22:04       ` Juri Linkov
2020-05-18 16:25         ` Drew Adams
2020-05-19 22:01           ` Juri Linkov
2020-06-11 22:51           ` Juri Linkov
2020-06-13 22:56             ` Juri Linkov
2020-06-14 22:55               ` Juri Linkov
2023-03-09 17:14                 ` Juri Linkov [this message]

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86cz5hrjwr.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=41338@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=konrad.podczeck@univie.ac.at \
    --cc=stephen.berman@gmx.net \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).