unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: emacs-28 d9b0b73 1/2: * doc/emacs/frames.texi (Tab Bars): Describe tab-last.
       [not found] ` <20211107180132.53DC620536@vcs0.savannah.gnu.org>
@ 2021-11-15 14:45   ` Robert Pluim
  2021-11-15 17:20     ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Pluim @ 2021-11-15 14:45 UTC (permalink / raw)
  To: emacs-devel; +Cc: Juri Linkov

>>>>> On Sun,  7 Nov 2021 13:01:32 -0500 (EST), juri@jurta.org (Juri Linkov) said:
    Juri> ----
    Juri> ++++
    Juri>  *** New optional key binding for 'tab-last'.
    Juri>  If you customize the user option 'tab-bar-select-tab-modifiers' to
    Juri>  allow selecting tabs using their index numbers, the '<MODIFIER>-9' key
    Juri>  is bound to 'tab-last', and switches to the last tab.  Here <MODIFIER>
    Juri>  is any of the modifiers in the list that is the value of
    Juri> -'tab-bar-select-tab-modifiers'.  You can also use negative indices,
    Juri> -which count from the last tab: -1 is the last tab, -2 the one before
    Juri> +'tab-bar-select-tab-modifiers'.  You can also use positive indices,
    Juri> +which count from the last tab: 1 is the last tab, 2 the one before
    Juri>  that, etc.
 
Hi Juri, this contradicts what the docstring for
`tab-bar-select-tab-modifiers' says about indices.

Robert
-- 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: emacs-28 d9b0b73 1/2: * doc/emacs/frames.texi (Tab Bars): Describe tab-last.
  2021-11-15 14:45   ` emacs-28 d9b0b73 1/2: * doc/emacs/frames.texi (Tab Bars): Describe tab-last Robert Pluim
@ 2021-11-15 17:20     ` Juri Linkov
  2021-11-15 17:44       ` Robert Pluim
  0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2021-11-15 17:20 UTC (permalink / raw)
  To: Robert Pluim; +Cc: emacs-devel

>>  *** New optional key binding for 'tab-last'.
>>  If you customize the user option 'tab-bar-select-tab-modifiers' to
>>  allow selecting tabs using their index numbers, the '<MODIFIER>-9' key
>>  is bound to 'tab-last', and switches to the last tab.  Here <MODIFIER>
>>  is any of the modifiers in the list that is the value of
>> +'tab-bar-select-tab-modifiers'.  You can also use positive indices,
>> +which count from the last tab: 1 is the last tab, 2 the one before
>>  that, etc.
>
> Hi Juri, this contradicts what the docstring for
> `tab-bar-select-tab-modifiers' says about indices.

Please try to type 'C-u 2 <MODIFIER>-9'.
It selects the tab before the last tab.
Maybe 'C-u -2 <MODIFIER>-9' should do the same?
E.g. by using '(abs)' on the argument?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: emacs-28 d9b0b73 1/2: * doc/emacs/frames.texi (Tab Bars): Describe tab-last.
  2021-11-15 17:20     ` Juri Linkov
@ 2021-11-15 17:44       ` Robert Pluim
  2021-11-15 18:11         ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Pluim @ 2021-11-15 17:44 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel

>>>>> On Mon, 15 Nov 2021 19:20:39 +0200, Juri Linkov <juri@linkov.net> said:

    >>> *** New optional key binding for 'tab-last'.
    >>> If you customize the user option 'tab-bar-select-tab-modifiers' to
    >>> allow selecting tabs using their index numbers, the '<MODIFIER>-9' key
    >>> is bound to 'tab-last', and switches to the last tab.  Here <MODIFIER>
    >>> is any of the modifiers in the list that is the value of
    >>> +'tab-bar-select-tab-modifiers'.  You can also use positive indices,
    >>> +which count from the last tab: 1 is the last tab, 2 the one before
    >>> that, etc.
    >> 
    >> Hi Juri, this contradicts what the docstring for
    >> `tab-bar-select-tab-modifiers' says about indices.

    Juri> Please try to type 'C-u 2 <MODIFIER>-9'.
    Juri> It selects the tab before the last tab.
    Juri> Maybe 'C-u -2 <MODIFIER>-9' should do the same?
    Juri> E.g. by using '(abs)' on the argument?

Hmm, ok. I got confused by the 'tab-bar-select-tab-modifiers'
docstring, which says

    List of modifier keys for selecting tab-bar tabs by their numbers.
    Possible modifier keys are `control', `meta', `shift', `hyper', `super' and
    `alt'.  Pressing one of the modifiers in the list and a digit selects
    the tab whose number equals the digit.  Negative numbers count from
    the end of the tab bar.  The digit 9 selects the last (rightmost) tab.
    For easier selection of tabs by their numbers, consider customizing
    `tab-bar-tab-hints', which will show tab numbers alongside the tab name.

Perhaps the option of doing C-u <digit> <MODIFIER>-9 should be
mentioned there as well?

Robert
-- 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: emacs-28 d9b0b73 1/2: * doc/emacs/frames.texi (Tab Bars): Describe tab-last.
  2021-11-15 17:44       ` Robert Pluim
@ 2021-11-15 18:11         ` Juri Linkov
  0 siblings, 0 replies; 4+ messages in thread
From: Juri Linkov @ 2021-11-15 18:11 UTC (permalink / raw)
  To: Robert Pluim; +Cc: emacs-devel

>     >>> *** New optional key binding for 'tab-last'.
>     >>> If you customize the user option 'tab-bar-select-tab-modifiers' to
>     >>> allow selecting tabs using their index numbers, the '<MODIFIER>-9' key
>     >>> is bound to 'tab-last', and switches to the last tab.  Here <MODIFIER>
>     >>> is any of the modifiers in the list that is the value of
>     >>> +'tab-bar-select-tab-modifiers'.  You can also use positive indices,
>     >>> +which count from the last tab: 1 is the last tab, 2 the one before
>     >>> that, etc.
>     >>
>     >> Hi Juri, this contradicts what the docstring for
>     >> `tab-bar-select-tab-modifiers' says about indices.
>
>     Juri> Please try to type 'C-u 2 <MODIFIER>-9'.
>     Juri> It selects the tab before the last tab.
>     Juri> Maybe 'C-u -2 <MODIFIER>-9' should do the same?
>     Juri> E.g. by using '(abs)' on the argument?
>
> Hmm, ok. I got confused by the 'tab-bar-select-tab-modifiers'
> docstring, which says
>
>     List of modifier keys for selecting tab-bar tabs by their numbers.
>     Possible modifier keys are `control', `meta', `shift', `hyper', `super' and
>     `alt'.  Pressing one of the modifiers in the list and a digit selects
>     the tab whose number equals the digit.  Negative numbers count from
>     the end of the tab bar.  The digit 9 selects the last (rightmost) tab.
>     For easier selection of tabs by their numbers, consider customizing
>     `tab-bar-tab-hints', which will show tab numbers alongside the tab name.
>
> Perhaps the option of doing C-u <digit> <MODIFIER>-9 should be
> mentioned there as well?

This is because <MODIFIER>-9 differs from other digits.
For example, '<MODIFIER>-2' selects the second tab,
but 'C-1 <MODIFIER>-2' selects the first tab.  This means that
the prefix argument takes precedence over the modifier digit,
so you can select a tab that has no digit key, e.g.
'C-u 42 <MODIFIER>-2' will select the 42nd tab, and
'C-u -42 <MODIFIER>-2' will select the 42nd tab from the end.

But 'tab-last' is an exception from this rule, and its prefix argument
means to count the relative position from the last tab.

'tab-bar-select-tab' and 'tab-last' should describe their prefix arguments,
so 'tab-bar-select-tab-modifiers' could just link to their docstrings:

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 5fc5124d47..9173a7b38d 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -91,9 +91,9 @@ tab-bar-tab-ungrouped
 (defcustom tab-bar-select-tab-modifiers '()
   "List of modifier keys for selecting tab-bar tabs by their numbers.
 Possible modifier keys are `control', `meta', `shift', `hyper', `super' and
-`alt'.  Pressing one of the modifiers in the list and a digit selects
-the tab whose number equals the digit.  Negative numbers count from
-the end of the tab bar.  The digit 9 selects the last (rightmost) tab.
+`alt'.  Pressing one of the modifiers in the list and a digit selects the
+tab whose number equals the digit (see more at `tab-bar-select-tab').
+The digit 9 selects the last (rightmost) tab (`tab-last').
 For easier selection of tabs by their numbers, consider customizing
 `tab-bar-tab-hints', which will show tab numbers alongside the tab name."
   :type '(set :tag "Tab selection modifier keys"
@@ -1064,7 +1064,7 @@ tab-bar-select-tab
 using `tab-bar-select-tab-modifiers'), calling it without an argument
 will translate its bound numeric key to the numeric argument.
 TAB-NUMBER counts from 1.  Negative TAB-NUMBER counts tabs from the end of
-the tab bar."
+the tab bar.  The prefix argument takes precedence over the bound digit key."
   (interactive "P")
   (unless (integerp tab-number)
     (let ((key (event-basic-type last-command-event)))
-- 



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-15 18:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20211107180130.21860.30228@vcs0.savannah.gnu.org>
     [not found] ` <20211107180132.53DC620536@vcs0.savannah.gnu.org>
2021-11-15 14:45   ` emacs-28 d9b0b73 1/2: * doc/emacs/frames.texi (Tab Bars): Describe tab-last Robert Pluim
2021-11-15 17:20     ` Juri Linkov
2021-11-15 17:44       ` Robert Pluim
2021-11-15 18:11         ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).