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#51247: 28.0.60; Insufficient documentation of tab-bar.el internal functions Date: Sun, 17 Oct 2021 22:13:30 +0300 Message-ID: <83lf2rforp.fsf@gnu.org> References: <831r4kghcu.fsf@gnu.org> <87y26ry3vs.fsf@mail.linkov.net> <83mtn7frz3.fsf@gnu.org> <87tuhfv726.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28680"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51247@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 17 21:14:26 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 1mcBc0-0007Hg-U6 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Oct 2021 21:14:25 +0200 Original-Received: from localhost ([::1]:51772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mcBbz-0008HJ-RA for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Oct 2021 15:14:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcBbe-0008H4-H4 for bug-gnu-emacs@gnu.org; Sun, 17 Oct 2021 15:14:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33729) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mcBbe-0002Dl-8P for bug-gnu-emacs@gnu.org; Sun, 17 Oct 2021 15:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mcBbe-0003df-1X for bug-gnu-emacs@gnu.org; Sun, 17 Oct 2021 15:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Oct 2021 19:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51247 X-GNU-PR-Package: emacs Original-Received: via spool by 51247-submit@debbugs.gnu.org id=B51247.163449802113956 (code B ref 51247); Sun, 17 Oct 2021 19:14:01 +0000 Original-Received: (at 51247) by debbugs.gnu.org; 17 Oct 2021 19:13:41 +0000 Original-Received: from localhost ([127.0.0.1]:45275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mcBbG-0003cy-3Z for submit@debbugs.gnu.org; Sun, 17 Oct 2021 15:13:41 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52430) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mcBbA-0003ci-IP for 51247@debbugs.gnu.org; Sun, 17 Oct 2021 15:13:37 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:32920) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mcBb4-0001kl-RL; Sun, 17 Oct 2021 15:13:26 -0400 Original-Received: from [87.69.77.57] (port=4109 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 1mcBb4-0000cN-DR; Sun, 17 Oct 2021 15:13:26 -0400 In-Reply-To: <87tuhfv726.fsf@mail.linkov.net> (message from Juri Linkov on Sun, 17 Oct 2021 21:29:21 +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:217432 Archived-At: > From: Juri Linkov > Cc: 51247@debbugs.gnu.org > Date: Sun, 17 Oct 2021 21:29:21 +0300 > > >> [ ] tab-bar-format-tabs > >> Show all tabs. > >> [X] tab-bar-format-tabs-groups > >> Show tabs with their groups. > >> [ ] tab-bar-separator > >> Separator between tabs. > >> [ ] tab-bar-format-add-tab > >> Button to add a new tab. > >> [X] tab-bar-format-align-right > >> Align the rest of tab bar items to the right. > >> [X] tab-bar-format-global > >> Format ‘global-mode-string’ to display it in the tab bar. More > >> [INS] > >> > >> So here its docstring explains what this option is useful for. > > > > Can't you provide a separate text for the Custom display? The doc > > string in its current form is simply misleading. > > It's a feature of :options in defcustom that it takes the text > from the docstrings. Maybe it's possible to override this text, > but I currently don't know how. OK, how about the patch below? diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 82ec617..3dc95c9 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -705,11 +705,14 @@ tab-bar-format "Template for displaying tab bar items. Every item in the list is a function that returns a string, or a list of menu-item elements, or nil. -When you add more items `tab-bar-format-align-right' and -`tab-bar-format-global' to the end, then after enabling -`display-time-mode' (or any other mode that uses `global-mode-string') -it will display time aligned to the right on the tab bar instead of -the mode line. Replacing `tab-bar-format-tabs' with +Adding a function to the list causes the tab bar to show +that string, or display a menu with those menu items when +you click on the tab bar. +If the list ends with `tab-bar-format-align-right' and +`tab-bar-format-global', then after enabling `display-time-mode' +(or any other mode that uses `global-mode-string'), +it will display time aligned to the right on the tab bar instead +of the mode line. Replacing `tab-bar-format-tabs' with `tab-bar-format-tabs-groups' will group tabs on the tab bar." :type 'hook :options '(tab-bar-format-menu-global @@ -728,7 +731,7 @@ tab-bar-format :version "28.1") (defun tab-bar-format-menu-global () - "Show global menu on clicking the Menu button." + "Produce the Menu button for the tab bar that shows a global menu." `((add-tab menu-item (propertize "Menu" 'face 'tab-bar-tab-inactive) (lambda (event) (interactive "e") (let ((menu (make-sparse-keymap @@ -745,7 +748,8 @@ tab-bar-format-menu-global :help "Global Menu"))) (defun tab-bar-format-history () - "Show back and forward buttons when `tab-bar-history-mode' is enabled. + "Produce back and forward buttons for the tab bar. +These buttons will be shown when `tab-bar-history-mode' is enabled. You can hide these buttons by customizing `tab-bar-format' and removing `tab-bar-format-history' from it." (when tab-bar-history-mode @@ -781,7 +785,7 @@ tab-bar--format-tab ,(alist-get 'close-binding tab)))))) (defun tab-bar-format-tabs () - "Show all tabs." + "Produce all the tabs for the tab bar." (let ((i 0)) (mapcan (lambda (tab) @@ -855,7 +859,7 @@ tab-bar--format-tab-group :help "Click to visit group")))) (defun tab-bar-format-tabs-groups () - "Show tabs with their groups." + "Produce tabs for the tab bar grouped according to their groups." (let* ((tabs (funcall tab-bar-tabs-function)) (current-group (funcall tab-bar-tab-group-function (tab-bar--current-tab-find tabs))) @@ -899,7 +903,7 @@ tab-bar-format-align-right `((align-right menu-item ,str ignore)))) (defun tab-bar-format-global () - "Format `global-mode-string' to display it in the tab bar. + "Produce display of `global-mode-string' in the tab bar. When `tab-bar-format-global' is added to `tab-bar-format' (possibly appended after `tab-bar-format-align-right'), then modes that display information on the mode line