From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Date: Fri, 06 Aug 2021 15:38:32 +0300 Message-ID: <83im0iiw8n.fsf@gnu.org> References: <87wnp2cg52.fsf@linkov.net> <83tuk5la2u.fsf@gnu.org> <877dh18lj3.fsf@mail.linkov.net> <83y29gjvjh.fsf@gnu.org> <8735rn8jz6.fsf@mail.linkov.net> <83sfznhywm.fsf@gnu.org> <87tuk356ia.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14047"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 06 14:39:21 2021 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 1mBz8D-0003Us-1J for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 06 Aug 2021 14:39:21 +0200 Original-Received: from localhost ([::1]:53890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBz8B-0003yH-G7 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 06 Aug 2021 08:39:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBz7u-0003y6-1x for bug-gnu-emacs@gnu.org; Fri, 06 Aug 2021 08:39:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37849) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mBz7t-0008V5-Rn for bug-gnu-emacs@gnu.org; Fri, 06 Aug 2021 08:39:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mBz7t-0000Nv-Pp for bug-gnu-emacs@gnu.org; Fri, 06 Aug 2021 08:39:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Aug 2021 12:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41343 X-GNU-PR-Package: emacs Original-Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.16282535221440 (code B ref 41343); Fri, 06 Aug 2021 12:39:01 +0000 Original-Received: (at 41343) by debbugs.gnu.org; 6 Aug 2021 12:38:42 +0000 Original-Received: from localhost ([127.0.0.1]:49394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBz7a-0000N9-Fn for submit@debbugs.gnu.org; Fri, 06 Aug 2021 08:38:42 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBz7X-0000Mt-NW for 41343@debbugs.gnu.org; Fri, 06 Aug 2021 08:38:41 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44620) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBz7R-0008B7-Tx; Fri, 06 Aug 2021 08:38:33 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2227 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBz7R-0007Qu-GU; Fri, 06 Aug 2021 08:38:33 -0400 In-Reply-To: <87tuk356ia.fsf@mail.linkov.net> (message from Juri Linkov on Fri, 06 Aug 2021 11:20:29 +0300) 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" Xref: news.gmane.io gmane.emacs.bugs:211331 Archived-At: > From: Juri Linkov > Cc: stefankangas@gmail.com, 41343@debbugs.gnu.org > Date: Fri, 06 Aug 2021 11:20:29 +0300 > > >> It's too late to change how keys are implemented for tab-bar. > >> The tab-bar keymap contains such keys as 'tab-1' and 'C-tab-2', > >> and clicking mouse-1 on tabs emits such events. It doesn't emit > >> 'mouse-1' and 'mouse-2'. > > > > How do we translate mouse clicks into the likes of C-tab-2? > > When mouse-1 is clicked on the close button, then the > Control modifier 'C-' is added to the menu-item symbol tab-2 > emitted as an event. Are you talking about handle_tab_bar_click and the processing of TAB_BAR_EVENT in make_lispy_event? Or are there other/additional parts to this processing? IOW, where are the symbols like tab-2 produced? > > And what prevents us from emitting something like tab-close-2 when > > mouse-2 is clicked? > > Then mouse-2 is still hard-coded and tab-close-2 is not much different > from the previous patch that emits C-tab-2. > > Or in "tab-close-2" what does "2" mean: the button number 2 (mouse-2), > or the tab number 2 (tab-2)? > > Should they then cover all combinations? tab-1-mouse-1, > tab-1-mouse-2, tab-2-mouse-1, tab-2-mouse-2, ... I don't know, I don't think I have a clear idea of how these symbols are produced yet, and you didn't tell enough for me to get such a clear idea. Please tell more details, so that this discussion could be more efficient. > >> It should be possible to implement normal key bindings mouse-1/mouse-2, > >> but such change will not be backward-compatible. > > > > In what way will it be incompatible? > > Currently tab-bar-make-keymap returns a keymap with menu-items. > This is like menu-bar is implemented. The menu-bar displays > menu-items, and clicking on them emits events with their symbols. > The tool-bar is implemented the same way: it displays > menu-items, and clicking emits their symbols. > The tab-bar is exactly the same: displays menu-items > on the tab-bar, and clicking mouse-1 emits events > with tab names, e.g. tab-2. > > Users already are using such add-advice that expect > tab-bar-make-keymap returning a keymap with menu-items. If we find a way to produce a different symbol when mouse-2 is clicked on a tab, there will be no incompatibility, right?