unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Gabriel <gabriel376@hotmail.com>
To: 47117@debbugs.gnu.org
Subject: bug#47117: 28.0.50; [PATCH] Update docstring of 'tab-line-tabs-function'
Date: Sat, 13 Mar 2021 19:10:45 -0300	[thread overview]
Message-ID: <CH2PR01MB58790FEDC00B84318908F4638B6E9@CH2PR01MB5879.prod.exchangelabs.com> (raw)
In-Reply-To: <875z1uag84.fsf@mail.linkov.net> (Juri Linkov's message of "Sat,  13 Mar 2021 23:36:27 +0200")

[-- Attachment #1: Type: text/plain, Size: 1003 bytes --]

Juri Linkov <juri@linkov.net> writes:

>> The user option 'tab-line-tabs-function' on tab-line.el does not mention
>> the possible value of 'tab-line-tabs-buffer-groups', which can difficult
>> the discoverability of this feature for users. This patch update its
>> docstring to mention the missing option, and adds a docstring to the
>> function of same name. Feel free to modify the proposed patch for an
>> improved and clearer docstring version.
>
> Thanks for your patches.  There is only a very small problem:
>
>>  (defun tab-line-tabs-buffer-groups ()
>> +  "Return a list of buffers grouped either
>> +by `tab-line-tabs-buffer-group-function', when set,
>> +or by `tab-line-tabs-buffer-groups'."
>
> The first line of the docstring should be a complete sentence,
> as described in (info "(elisp) Function Documentation")

Here is an updated patch. I used 'tab-line-tabs-window-buffers' and
'tab-line-switch-cycling' as a reference. I appreciate your help, I am
still learning the basic stuff.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-tab-line.el-Update-docstring-of-tab-line-tabs-f.patch --]
[-- Type: text/x-diff, Size: 1784 bytes --]

From e32da7c2be28e03881d9d1d7fba0bec53d4f0c86 Mon Sep 17 00:00:00 2001
From: Gabriel do Nascimento Ribeiro <gabriel.nascimento@nubank.com.br>
Date: Sat, 13 Mar 2021 19:04:55 -0300
Subject: [PATCH] lisp/tab-line.el: Update docstring of
 'tab-line-tabs-function'

(tab-line-tabs-function): Mention'tab-line-tabs-buffer-groups'
in the docstring.
(tab-line-tabs-buffer-groups): Add docstring.
---
 lisp/tab-line.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 903862a3e8..76c04521d5 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -294,7 +294,10 @@ tab-line-tabs-function
 By default, use function `tab-line-tabs-window-buffers' that
 returns a list of buffers associated with the selected window.
 When `tab-line-tabs-mode-buffers', return a list of buffers
-with the same major mode as the current buffer."
+with the same major mode as the current buffer.
+When `tab-line-tabs-buffer-groups', return a list of buffers
+grouped either by `tab-line-tabs-buffer-group-function', when set,
+or by `tab-line-tabs-buffer-groups'."
   :type '(choice (const :tag "Window buffers"
                         tab-line-tabs-window-buffers)
                  (const :tag "Same mode buffers"
@@ -356,6 +359,11 @@ tab-line-tabs-buffer-group-name
           mode))))
 
 (defun tab-line-tabs-buffer-groups ()
+  "Return a list of tabs that should be displayed in the tab line.
+By default return a list of buffers grouped by major mode,
+according to `tab-line-tabs-buffer-groups'.
+If non nil, `tab-line-tabs-buffer-group-function' is used to
+generate the group name."
   (if (window-parameter nil 'tab-line-groups)
       (let* ((buffers (funcall tab-line-tabs-buffer-list-function))
              (groups
-- 
2.27.0


  reply	other threads:[~2021-03-13 22:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-13  1:35 bug#47117: 28.0.50; [PATCH] Update docstring of 'tab-line-tabs-function' Gabriel
2021-03-13 21:36 ` Juri Linkov
2021-03-13 22:10   ` Gabriel [this message]
2021-03-14  9:13     ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CH2PR01MB58790FEDC00B84318908F4638B6E9@CH2PR01MB5879.prod.exchangelabs.com \
    --to=gabriel376@hotmail.com \
    --cc=47117@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).