emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master f0e220a: Don't display the number of windows in tab


From: Juri Linkov
Subject: [Emacs-diffs] master f0e220a: Don't display the number of windows in tab name in tab-bar by default.
Date: Sun, 13 Oct 2019 18:00:45 -0400 (EDT)

branch: master
commit f0e220af088384599b5206f2b6efca05252e578a
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>

    Don't display the number of windows in tab name in tab-bar by default.
    
    * lisp/tab-bar.el (tab-bar-tab-name-function): Change the default value.
    (tab-bar-tab-name-current): Rename from tab-bar-tab-name-selected-window.
    (tab-bar-tab-name-current-with-count): New function.
    (tab-bar-tab-name-all): Rename from tab-bar-tab-name-all-windows.
---
 lisp/tab-bar.el | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 8abe141..52245dd 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -249,14 +249,18 @@ This helps to select the tab by its number using 
`tab-bar-select-tab'."
 (defvar tab-bar-separator nil)
 
 
-(defcustom tab-bar-tab-name-function #'tab-bar-tab-name-selected-window
+(defcustom tab-bar-tab-name-function #'tab-bar-tab-name-current
   "Function to get a tab name.
 Function gets no arguments.
 The choice is between displaying only the name of the current buffer
 in the tab name (default), or displaying the names of all buffers
 from all windows in the window configuration."
-  :type '(choice (const :tag "Selected window buffer" 
tab-bar-tab-name-selected-window)
-                 (const :tag "All window buffers" tab-bar-tab-name-all-windows)
+  :type '(choice (const :tag "Selected window buffer"
+                        tab-bar-tab-name-current)
+                 (const :tag "Selected window buffer with window count"
+                        tab-bar-tab-name-current-with-count)
+                 (const :tag "All window buffers"
+                        tab-bar-tab-name-all)
                  (function  :tag "Function"))
   :initialize 'custom-initialize-default
   :set (lambda (sym val)
@@ -265,7 +269,11 @@ from all windows in the window configuration."
   :group 'tab-bar
   :version "27.1")
 
-(defun tab-bar-tab-name-selected-window ()
+(defun tab-bar-tab-name-current ()
+  "Generate tab name from the buffer of the selected window."
+  (window-buffer (minibuffer-selected-window)))
+
+(defun tab-bar-tab-name-current-with-count ()
   "Generate tab name from the buffer of the selected window.
 Also add the number of windows in the window configuration."
   (let ((count (length (window-list-1 nil 'nomini)))
@@ -274,7 +282,7 @@ Also add the number of windows in the window configuration."
         (format "%s (%d)" name count)
       (format "%s" name))))
 
-(defun tab-bar-tab-name-all-windows ()
+(defun tab-bar-tab-name-all ()
   "Generate tab name from buffers of all windows."
   (mapconcat #'buffer-name
              (delete-dups (mapcar #'window-buffer



reply via email to

[Prev in Thread] Current Thread [Next in Thread]