unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47117: 28.0.50; [PATCH] Update docstring of 'tab-line-tabs-function'
@ 2021-03-13  1:35 Gabriel
  2021-03-13 21:36 ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Gabriel @ 2021-03-13  1:35 UTC (permalink / raw)
  To: 47117

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

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.


[-- 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: 1654 bytes --]

From 17036ccb9e6e2be23cb8db6c41a818e9225f07da Mon Sep 17 00:00:00 2001
From: Gabriel do Nascimento Ribeiro <gabriel.nascimento@nubank.com.br>
Date: Fri, 12 Mar 2021 22:28:06 -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 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 903862a3e8..eb1921181b 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,9 @@ tab-line-tabs-buffer-group-name
           mode))))
 
 (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'."
   (if (window-parameter nil 'tab-line-groups)
       (let* ((buffers (funcall tab-line-tabs-buffer-list-function))
              (groups
-- 
2.27.0


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

* bug#47117: 28.0.50; [PATCH] Update docstring of 'tab-line-tabs-function'
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2021-03-13 21:36 UTC (permalink / raw)
  To: Gabriel; +Cc: 47117

> 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")





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

* bug#47117: 28.0.50; [PATCH] Update docstring of 'tab-line-tabs-function'
  2021-03-13 21:36 ` Juri Linkov
@ 2021-03-13 22:10   ` Gabriel
  2021-03-14  9:13     ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Gabriel @ 2021-03-13 22:10 UTC (permalink / raw)
  To: 47117

[-- 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


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

* bug#47117: 28.0.50; [PATCH] Update docstring of 'tab-line-tabs-function'
  2021-03-13 22:10   ` Gabriel
@ 2021-03-14  9:13     ` Juri Linkov
  0 siblings, 0 replies; 4+ messages in thread
From: Juri Linkov @ 2021-03-14  9:13 UTC (permalink / raw)
  To: Gabriel; +Cc: 47117

tags 47117 fixed
close 47117 28.0.50
thanks

> 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.

Thanks, now your patch is pushed (after adding the bug reference
to the commit message).





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

end of thread, other threads:[~2021-03-14  9:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-03-14  9:13     ` 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).