aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2019-10-14 01:00:38 +0300
committerJuri Linkov2019-10-14 01:00:38 +0300
commitf0e220af088384599b5206f2b6efca05252e578a (patch)
treeb031f93d8bf3cdb733c922c3dc7f806ce381b26d
parentdafd329771f5028cdac1a2691a236ffa296c360c (diff)
downloademacs-f0e220af088384599b5206f2b6efca05252e578a.tar.gz
emacs-f0e220af088384599b5206f2b6efca05252e578a.zip
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.
-rw-r--r--lisp/tab-bar.el18
1 files changed, 13 insertions, 5 deletions
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 8abe14138a5..52245dd78f8 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'."
249(defvar tab-bar-separator nil) 249(defvar tab-bar-separator nil)
250 250
251 251
252(defcustom tab-bar-tab-name-function #'tab-bar-tab-name-selected-window 252(defcustom tab-bar-tab-name-function #'tab-bar-tab-name-current
253 "Function to get a tab name. 253 "Function to get a tab name.
254Function gets no arguments. 254Function gets no arguments.
255The choice is between displaying only the name of the current buffer 255The choice is between displaying only the name of the current buffer
256in the tab name (default), or displaying the names of all buffers 256in the tab name (default), or displaying the names of all buffers
257from all windows in the window configuration." 257from all windows in the window configuration."
258 :type '(choice (const :tag "Selected window buffer" tab-bar-tab-name-selected-window) 258 :type '(choice (const :tag "Selected window buffer"
259 (const :tag "All window buffers" tab-bar-tab-name-all-windows) 259 tab-bar-tab-name-current)
260 (const :tag "Selected window buffer with window count"
261 tab-bar-tab-name-current-with-count)
262 (const :tag "All window buffers"
263 tab-bar-tab-name-all)
260 (function :tag "Function")) 264 (function :tag "Function"))
261 :initialize 'custom-initialize-default 265 :initialize 'custom-initialize-default
262 :set (lambda (sym val) 266 :set (lambda (sym val)
@@ -265,7 +269,11 @@ from all windows in the window configuration."
265 :group 'tab-bar 269 :group 'tab-bar
266 :version "27.1") 270 :version "27.1")
267 271
268(defun tab-bar-tab-name-selected-window () 272(defun tab-bar-tab-name-current ()
273 "Generate tab name from the buffer of the selected window."
274 (window-buffer (minibuffer-selected-window)))
275
276(defun tab-bar-tab-name-current-with-count ()
269 "Generate tab name from the buffer of the selected window. 277 "Generate tab name from the buffer of the selected window.
270Also add the number of windows in the window configuration." 278Also add the number of windows in the window configuration."
271 (let ((count (length (window-list-1 nil 'nomini))) 279 (let ((count (length (window-list-1 nil 'nomini)))
@@ -274,7 +282,7 @@ Also add the number of windows in the window configuration."
274 (format "%s (%d)" name count) 282 (format "%s (%d)" name count)
275 (format "%s" name)))) 283 (format "%s" name))))
276 284
277(defun tab-bar-tab-name-all-windows () 285(defun tab-bar-tab-name-all ()
278 "Generate tab name from buffers of all windows." 286 "Generate tab name from buffers of all windows."
279 (mapconcat #'buffer-name 287 (mapconcat #'buffer-name
280 (delete-dups (mapcar #'window-buffer 288 (delete-dups (mapcar #'window-buffer