]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix tab-bar-tab-name-ellipsis initialization
authorMatthias Meulien <orontee@gmail.com>
Sun, 17 May 2020 22:32:47 +0000 (00:32 +0200)
committerJuri Linkov <juri@linkov.net>
Sun, 24 May 2020 22:01:24 +0000 (01:01 +0300)
* lisp/tab-bar.el (tab-bar-tab-name-truncated): Evaluate displayable
character when generating tab name.

lisp/tab-bar.el

index a1ff2b0ca8b06a81ae6c1fd99f01b67d28b840f2..69863e55ce3ba442546ffc7b075aeb5cfebedfea 100644 (file)
@@ -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))))
 
 \f