summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2022-01-17 17:13:10 -0600
committerCase Duckworth2022-01-17 17:13:10 -0600
commit4236a39dfb897c26edfde061f79ea4b397780df7 (patch)
tree00060339fb8e6c5d3439b3db3c87627822592e5c /lisp
parentFix function calls (diff)
downloademacs-4236a39dfb897c26edfde061f79ea4b397780df7.tar.gz
emacs-4236a39dfb897c26edfde061f79ea4b397780df7.zip
Add unworking sketch for fluid-width tabs
Diffstat (limited to 'lisp')
-rw-r--r--lisp/+tab-bar.el46
1 files changed, 46 insertions, 0 deletions
diff --git a/lisp/+tab-bar.el b/lisp/+tab-bar.el index ffbdd70..2e9198c 100644 --- a/lisp/+tab-bar.el +++ b/lisp/+tab-bar.el
@@ -37,6 +37,52 @@
37 (file-name-nondirectory tab-file-name) 37 (file-name-nondirectory tab-file-name)
38 (+tab-bar-tab-name-truncated-left))))) 38 (+tab-bar-tab-name-truncated-left)))))
39 39
40;;; FIXME this doesn't work...
41;; (defvar +tab-bar-tab-min-width 8
42;; "Minimum width of a tab on the tab bar.")
43
44;; (defvar +tab-bar-tab-max-width 24
45;; "Maximum width of a tab on the tab bar.")
46
47;; (defun +tab-bar-fluid-calculate-width ()
48;; "Calculate the width of each tab in the tab-bar."
49;; (let* ((tab-bar-list (cdr (tab-bar-make-keymap-1)))
50;; (tab-bar-avail-width (frame-width))
51;; (tab-bar-tab-count (length (tab-bar-tabs)))
52;; (tab-bar-close-button-char-width 1)
53;; (tab-bar-add-tab-button-char-width 1)
54;; (tab-bar-total-width
55;; (length (mapconcat
56;; (lambda (el)
57;; (when-let ((str (car-safe (cdr-safe (cdr-safe el)))))
58;; (substring-no-properties (eval str))))
59;; tab-bar-list)))
60;; (tab-bar-total-tab-width
61;; (+ (* tab-bar-tab-count tab-bar-close-button-char-width)
62;; tab-bar-add-tab-button-char-width
63;; (length (mapconcat
64;; (lambda (el)
65;; (substring-no-properties (alist-get 'name el)))
66;; (tab-bar-tabs)))))
67;; (tab-bar-total-nontab-width (- tab-bar-total-width
68;; tab-bar-total-tab-width)))
69;; (min +tab-bar-tab-max-width
70;; (max +tab-bar-tab-min-width
71;; (/ (- tab-bar-avail-width
72;; tab-bar-total-tab-width
73;; tab-bar-total-nontab-width)
74;; tab-bar-tab-count)))))
75
76;; (defun +tab-bar-fluid-width ()
77;; "Generate the tab name to fluidly fit in the given space."
78;; (let* ((tab-file-name (buffer-file-name (window-buffer
79;; (minibuffer-selected-window)))))
80;; (format (format " %%s%%%ds" (+tab-bar-fluid-calculate-width))
81;; (if tab-file-name
82;; (file-name-nondirectory tab-file-name)
83;; (+tab-bar-tab-name-truncated-left))
84;; " ")))
85
40(defun +tab-bar-tab-name-truncated-left () 86(defun +tab-bar-tab-name-truncated-left ()
41 "Generate the tab name from the buffer of the selected window. 87 "Generate the tab name from the buffer of the selected window.
42This is just like `tab-bar-tab-name-truncated', but truncates the 88This is just like `tab-bar-tab-name-truncated', but truncates the