summary refs log tree commit diff stats
path: root/lisp/+tab-bar.el
diff options
context:
space:
mode:
authorCase Duckworth2022-01-11 16:01:03 -0600
committerCase Duckworth2022-01-11 16:01:03 -0600
commite4f7ed9609d85f80f3f54dae7485f06a49fc4d3c (patch)
treef45f690e7c720177e359ad4a5d4f2f015f011103 /lisp/+tab-bar.el
parentMerge branch 'main' of https://tildegit.org/acdw/emacs (diff)
downloademacs-e4f7ed9609d85f80f3f54dae7485f06a49fc4d3c.tar.gz
emacs-e4f7ed9609d85f80f3f54dae7485f06a49fc4d3c.zip
Lots o changes at work
I need to fix +circe-define-filter or something
Diffstat (limited to 'lisp/+tab-bar.el')
-rw-r--r--lisp/+tab-bar.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/lisp/+tab-bar.el b/lisp/+tab-bar.el index 2a03121..1dc1f68 100644 --- a/lisp/+tab-bar.el +++ b/lisp/+tab-bar.el
@@ -21,6 +21,26 @@
21(defvar +tab-bar-show-original nil 21(defvar +tab-bar-show-original nil
22 "Original value of `tab-bar-show'.") 22 "Original value of `tab-bar-show'.")
23 23
24(defun +tab-bar-tab-name-truncated-left ()
25 "Generate the tab name from the buffer of the selected window.
26This is just like `tab-bar-tab-name-truncated', but truncates the
27name to the left."
28 (let* ((tab-name (buffer-name (window-buffer (minibuffer-selected-window))))
29 (ellipsis (cond
30 (tab-bar-tab-name-ellipsis)
31 ((char-displayable-p ?…) "…")
32 ("...")))
33 (l-ell (length ellipsis))
34 (l-name (length tab-name)))
35 (if (< (length tab-name) tab-bar-tab-name-truncated-max)
36 tab-name
37 (propertize (concat
38 (when (> (+ l-name l-ell) tab-bar-tab-name-truncated-max)
39 ellipsis)
40 (truncate-string-to-width tab-name l-name
41 (max 0 (- l-name tab-bar-tab-name-truncated-max l-ell))))
42 'help-echo tab-name))))
43
24 44
25;; Emacs 27 45;; Emacs 27
26 46