From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#41338: Toolbar-bug in Emacs 27.0.91/Pretest Date: Tue, 23 Jul 2024 21:00:41 +0300 Organization: LINKOV.NET Message-ID: <86o76oxa2e.fsf@mail.linkov.net> References: <87ftbzva1f.fsf@rub.de> <877dxb4hzh.fsf@mail.linkov.net> <87mu66i5gl.fsf@mail.linkov.net> <8d5d6374-26f8-49b7-badd-c676c9622ea8@default> <87k10dz051.fsf@mail.linkov.net> <87h7vewp6i.fsf@mail.linkov.net> <87o8plb6kh.fsf@mail.linkov.net> <86cz5hrjwr.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35495"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) To: 41338@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 23 20:03:34 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sWJrJ-00098r-Ka for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Jul 2024 20:03:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWJqr-0000Rn-Hx; Tue, 23 Jul 2024 14:03:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWJqj-0000NK-Ga for bug-gnu-emacs@gnu.org; Tue, 23 Jul 2024 14:03:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWJqj-00005Q-6s for bug-gnu-emacs@gnu.org; Tue, 23 Jul 2024 14:02:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sWJqn-0000Dg-Pv for bug-gnu-emacs@gnu.org; Tue, 23 Jul 2024 14:03:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Jul 2024 18:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41338 X-GNU-PR-Package: emacs Original-Received: via spool by 41338-submit@debbugs.gnu.org id=B41338.1721757751796 (code B ref 41338); Tue, 23 Jul 2024 18:03:01 +0000 Original-Received: (at 41338) by debbugs.gnu.org; 23 Jul 2024 18:02:31 +0000 Original-Received: from localhost ([127.0.0.1]:60712 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWJqI-0000Ck-Lc for submit@debbugs.gnu.org; Tue, 23 Jul 2024 14:02:30 -0400 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:35375) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWJqF-0000CS-V1; Tue, 23 Jul 2024 14:02:28 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 10148E0003; Tue, 23 Jul 2024 18:01:54 +0000 (UTC) In-Reply-To: <86cz5hrjwr.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 09 Mar 2023 19:14:04 +0200") X-GND-Sasl: juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289189 Archived-At: 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.