[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#41343: tab-bar-mode: Close tab on mouse-2 click
From: |
Eli Zaretskii |
Subject: |
bug#41343: tab-bar-mode: Close tab on mouse-2 click |
Date: |
Fri, 06 Aug 2021 09:26:17 +0300 |
> From: Juri Linkov <juri@linkov.net>
> Cc: stefankangas@gmail.com, 41343@debbugs.gnu.org
> Date: Fri, 06 Aug 2021 03:41:17 +0300
>
> >> (defvar tab-line-tab-map
> >> (let ((map (make-sparse-keymap)))
> >> (define-key map [tab-line mouse-1] 'tab-line-select-tab)
> >> (define-key map [tab-line mouse-2] 'tab-line-close-tab)
> >>
> >> But it's impossible to do the same for the menu-bar and the tool-bar
> >> and so in the tab-bar too.
> >
> > Why not? What prevents that?
>
> 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? And what
prevents us from emitting something like tab-close-2 when mouse-2 is
clicked?
> >> Or do you mean adding an integer variable that holds
> >> a number of the mouse button used to close the tab?
> >> For example, tab-bar-close-tab-mouse-button = 2.
> >
> > I think we should explore such possibilities only after we understand
> > why normal key bindings don't work.
>
> 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?
- bug#41343: tab-bar-mode: Close tab on mouse-2 click, Juri Linkov, 2021/08/03
- bug#41343: tab-bar-mode: Close tab on mouse-2 click, Eli Zaretskii, 2021/08/04
- bug#41343: tab-bar-mode: Close tab on mouse-2 click, Juri Linkov, 2021/08/04
- bug#41343: tab-bar-mode: Close tab on mouse-2 click, Eli Zaretskii, 2021/08/05
- bug#41343: tab-bar-mode: Close tab on mouse-2 click, Juri Linkov, 2021/08/05
- bug#41343: tab-bar-mode: Close tab on mouse-2 click,
Eli Zaretskii <=
- bug#41343: tab-bar-mode: Close tab on mouse-2 click, Juri Linkov, 2021/08/06
- bug#41343: tab-bar-mode: Close tab on mouse-2 click, Eli Zaretskii, 2021/08/06
- bug#41343: tab-bar-mode: Close tab on mouse-2 click, Juri Linkov, 2021/08/09
- bug#41343: tab-bar-mode: Close tab on mouse-2 click, Eli Zaretskii, 2021/08/10
- bug#41343: tab-bar-mode: Close tab on mouse-2 click, Juri Linkov, 2021/08/11
- bug#41343: tab-bar-mode: Close tab on mouse-2 click, Eli Zaretskii, 2021/08/11
- bug#41343: tab-bar-mode: Close tab on mouse-2 click, Juri Linkov, 2021/08/12
- bug#41343: tab-bar-mode: Close tab on mouse-2 click, Eli Zaretskii, 2021/08/12
- bug#41343: tab-bar-mode: Close tab on mouse-2 click, Juri Linkov, 2021/08/13
- bug#41343: tab-bar-mode: Close tab on mouse-2 click, Juri Linkov, 2021/08/18