diff options
| author | Matthias Meulien | 2020-05-18 00:32:47 +0200 |
|---|---|---|
| committer | Juri Linkov | 2020-05-25 01:01:24 +0300 |
| commit | e7a3ed8a6dddb6e16c83d27a04dfa6ec8160e580 (patch) | |
| tree | 8a9814c4d3a6d2d8ae3006113c6e85b1bf72bf45 | |
| parent | 4737d0af7583f18424e2e0957fddb16228d33530 (diff) | |
| download | emacs-e7a3ed8a6dddb6e16c83d27a04dfa6ec8160e580.tar.gz emacs-e7a3ed8a6dddb6e16c83d27a04dfa6ec8160e580.zip | |
Fix tab-bar-tab-name-ellipsis initialization
* lisp/tab-bar.el (tab-bar-tab-name-truncated): Evaluate displayable
character when generating tab name.
| -rw-r--r-- | lisp/tab-bar.el | 11 |
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. |
| 384 | Truncate it to the length specified by `tab-bar-tab-name-truncated-max'. | 383 | Truncate it to the length specified by `tab-bar-tab-name-truncated-max'. |
| 385 | Append ellipsis `tab-bar-tab-name-ellipsis' in this case." | 384 | Append 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 | ||