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

From: Juri Linkov <[email-masked]>
Date: Wed, 20 May 2020 01:01:53 +0300

> If I use `emacs -Q', in the Emacs 27 pretest
> or in Emacs 26.3 or earlier, and if I do this
> and then click the `X' icon:
>
> (define-key special-event-map [delete-frame]
>   (lambda (&rest ignore)
>     (interactive)
>     (message "HHHHHHHHHHHHHH")))
>
> I just get the message, as expected.
>
> (Sorry, haven't been following this thread.)

Indeed, clicking the `X' emits the `delete-frame' event.

The problem is that no one understand this comment in isearch.el:

    ;; Pass frame events transparently so they won't exit the search.
    ;; In particular, if we have more than one display open, then a
    ;; switch-frame might be generated by someone typing at another keyboard.
    (define-key map [switch-frame] nil)
    (define-key map [delete-frame] nil)

added in 1995 by 5f48fc17d16.