Fix tab-bar-tab-name-ellipsis initialization
* lisp/tab-bar.el (tab-bar-tab-name-truncated): Evaluate displayable character when generating tab name.
This commit is contained in:
parent
4737d0af75
commit
e7a3ed8a6d
1 changed files with 7 additions and 4 deletions
|
@ -376,19 +376,22 @@ to `tab-bar-tab-name-truncated'."
|
|||
:group 'tab-bar
|
||||
:version "27.1")
|
||||
|
||||
(defvar tab-bar-tab-name-ellipsis
|
||||
(if (char-displayable-p ?…) "…" "..."))
|
||||
(defvar tab-bar-tab-name-ellipsis nil)
|
||||
|
||||
(defun tab-bar-tab-name-truncated ()
|
||||
"Generate tab name from the buffer of the selected window.
|
||||
Truncate it to the length specified by `tab-bar-tab-name-truncated-max'.
|
||||
Append ellipsis `tab-bar-tab-name-ellipsis' in this case."
|
||||
(let ((tab-name (buffer-name (window-buffer (minibuffer-selected-window)))))
|
||||
(let ((tab-name (buffer-name (window-buffer (minibuffer-selected-window))))
|
||||
(ellipsis (cond
|
||||
(tab-bar-tab-name-ellipsis)
|
||||
((char-displayable-p ?…) "…")
|
||||
("..."))))
|
||||
(if (< (length tab-name) tab-bar-tab-name-truncated-max)
|
||||
tab-name
|
||||
(propertize (truncate-string-to-width
|
||||
tab-name tab-bar-tab-name-truncated-max nil nil
|
||||
tab-bar-tab-name-ellipsis)
|
||||
ellipsis)
|
||||
'help-echo tab-name))))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue