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.devel Subject: Re: emacs-28 d9b0b73 1/2: * doc/emacs/frames.texi (Tab Bars): Describe tab-last. Date: Mon, 15 Nov 2021 20:11:37 +0200 Organization: LINKOV.NET Message-ID: <86wnl98f1i.fsf@mail.linkov.net> References: <20211107180130.21860.30228@vcs0.savannah.gnu.org> <20211107180132.53DC620536@vcs0.savannah.gnu.org> <87lf1po4uo.fsf@gmail.com> <86czn1cqrs.fsf@mail.linkov.net> <87h7cdnwja.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24908"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 15 19:14:24 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mmgUq-0006J3-Rz for ged-emacs-devel@m.gmane-mx.org; Mon, 15 Nov 2021 19:14:24 +0100 Original-Received: from localhost ([::1]:33860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmgUp-0006YO-3s for ged-emacs-devel@m.gmane-mx.org; Mon, 15 Nov 2021 13:14:23 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmgUI-0005rA-BH for emacs-devel@gnu.org; Mon, 15 Nov 2021 13:13:50 -0500 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:37491) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmgUF-0002He-Op for emacs-devel@gnu.org; Mon, 15 Nov 2021 13:13:49 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 734C31BF203; Mon, 15 Nov 2021 18:13:43 +0000 (UTC) In-Reply-To: <87h7cdnwja.fsf@gmail.com> (Robert Pluim's message of "Mon, 15 Nov 2021 18:44:41 +0100") Received-SPF: pass client-ip=217.70.183.201; envelope-from=juri@linkov.net; helo=relay8-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:279514 Archived-At: > >>> *** 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 '-9' key > >>> is bound to 'tab-last', and switches to the last tab. Here > >>> 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 -9'. > Juri> It selects the tab before the last tab. > Juri> Maybe 'C-u -2 -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 -9 should be > mentioned there as well? This is because -9 differs from other digits. For example, '-2' selects the second tab, but 'C-1 -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 -2' will select the 42nd tab, and 'C-u -42 -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))) --