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#70086: Mouse clicks in tab-bar don't call commands bound in keymap properties Date: Wed, 10 Apr 2024 09:42:30 +0300 Organization: LINKOV.NET Message-ID: <86cyqxeqa9.fsf@mail.linkov.net> References: <948ee96f-52d5-4cd5-be84-70368cff214f@alphapapa.net> <86ttknd3kd.fsf@mail.linkov.net> <6393275a-0009-46f0-9eff-c1149c2e0ee4@alphapapa.net> <865xwv7oxo.fsf@mail.linkov.net> <6f66d842-7b7c-4a16-bf47-2b3641c3195b@alphapapa.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26789"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 70086@debbugs.gnu.org To: Adam Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 10 08:54:25 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 1ruRqj-0006qQ-NI for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Apr 2024 08:54:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruRqK-0007Cs-Qc; Wed, 10 Apr 2024 02:54:00 -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 1ruRqF-0007CM-Aw for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2024 02:53:55 -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 1ruRqE-0007Bs-QA for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2024 02:53:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ruRqN-0003iY-7y for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2024 02:54:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Apr 2024 06:54:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70086 X-GNU-PR-Package: emacs Original-Received: via spool by 70086-submit@debbugs.gnu.org id=B70086.171273200313953 (code B ref 70086); Wed, 10 Apr 2024 06:54:03 +0000 Original-Received: (at 70086) by debbugs.gnu.org; 10 Apr 2024 06:53:23 +0000 Original-Received: from localhost ([127.0.0.1]:51932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruRpg-0003cY-1Y for submit@debbugs.gnu.org; Wed, 10 Apr 2024 02:53:22 -0400 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]:52721) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruRpc-0003am-B7 for 70086@debbugs.gnu.org; Wed, 10 Apr 2024 02:53:18 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 7A32BC0002; Wed, 10 Apr 2024 06:53:00 +0000 (UTC) In-Reply-To: <6f66d842-7b7c-4a16-bf47-2b3641c3195b@alphapapa.net> (Adam Porter's message of "Fri, 5 Apr 2024 13:41:56 -0500") 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:283026 Archived-At: --=-=-= Content-Type: text/plain > Do you think this could be fixed in time for Emacs 30? Please try out the following patch. At least it works for your test case. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=tab-bar-global.patch diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index cd076664faf..1a80f3d99e7 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -298,9 +298,13 @@ tab-bar--event-to-item nil otherwise." (setq tab-bar--dragging-in-progress nil) (if (posn-window posn) - (let ((caption (car (posn-string posn)))) - (when caption - (get-text-property 0 'menu-item caption))) + (let* ((caption (car (posn-string posn))) + (menu-item (when caption + (get-text-property 0 'menu-item caption)))) + (when (equal menu-item '(global ignore nil)) + (setf (nth 1 menu-item) + (key-binding (vector 'tab-bar last-nonmenu-event) t))) + menu-item) ;; Text-mode emulation of switching tabs on the tab bar. ;; This code is used when you click the mouse in the tab bar ;; on a console which has no window system but does have a mouse. @@ -332,7 +336,7 @@ tab-bar-mouse-down-1 (setq tab-bar--dragging-in-progress t) ;; Don't close the tab when clicked on the close button. Also ;; don't add new tab on down-mouse. Let `tab-bar-mouse-1' do this. - (unless (or (memq (car item) '(add-tab history-back history-forward)) + (unless (or (memq (car item) '(add-tab history-back history-forward global)) (nth 2 item)) (if (functionp (nth 1 item)) (call-interactively (nth 1 item)) @@ -347,7 +351,7 @@ tab-bar-mouse-1 (let* ((item (tab-bar--event-to-item (event-start event))) (tab-number (tab-bar--key-to-number (nth 0 item)))) (cond - ((and (memq (car item) '(add-tab history-back history-forward)) + ((and (memq (car item) '(add-tab history-back history-forward global)) (functionp (nth 1 item))) (call-interactively (nth 1 item))) ((and (nth 2 item) (not (eq tab-number t))) @@ -468,8 +472,8 @@ tab-bar-touchscreen-begin (tab-bar-select-tab number)))) ;; Cancel the timer. (cancel-timer timer))) - ((and (memq (car item) '(add-tab history-back - history-forward)) + ((and (memq (car item) '( add-tab history-back + history-forward global)) (functionp (cadr item))) ;; This is some kind of button. Wait for the ;; tap to complete and press it. --=-=-=--