aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/tab-bar.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index a1ff2b0ca8b..69863e55ce3 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -376,19 +376,22 @@ to `tab-bar-tab-name-truncated'."
376 :group 'tab-bar 376 :group 'tab-bar
377 :version "27.1") 377 :version "27.1")
378 378
379(defvar tab-bar-tab-name-ellipsis 379(defvar tab-bar-tab-name-ellipsis nil)
380 (if (char-displayable-p ?…) "…" "..."))
381 380
382(defun tab-bar-tab-name-truncated () 381(defun tab-bar-tab-name-truncated ()
383 "Generate tab name from the buffer of the selected window. 382 "Generate tab name from the buffer of the selected window.
384Truncate it to the length specified by `tab-bar-tab-name-truncated-max'. 383Truncate it to the length specified by `tab-bar-tab-name-truncated-max'.
385Append ellipsis `tab-bar-tab-name-ellipsis' in this case." 384Append ellipsis `tab-bar-tab-name-ellipsis' in this case."
386 (let ((tab-name (buffer-name (window-buffer (minibuffer-selected-window))))) 385 (let ((tab-name (buffer-name (window-buffer (minibuffer-selected-window))))
386 (ellipsis (cond
387 (tab-bar-tab-name-ellipsis)
388 ((char-displayable-p ?…) "…")
389 ("..."))))
387 (if (< (length tab-name) tab-bar-tab-name-truncated-max) 390 (if (< (length tab-name) tab-bar-tab-name-truncated-max)
388 tab-name 391 tab-name
389 (propertize (truncate-string-to-width 392 (propertize (truncate-string-to-width
390 tab-name tab-bar-tab-name-truncated-max nil nil 393 tab-name tab-bar-tab-name-truncated-max nil nil
391 tab-bar-tab-name-ellipsis) 394 ellipsis)
392 'help-echo tab-name)))) 395 'help-echo tab-name))))
393 396
394 397