aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2025-08-12 20:49:02 +0300
committerJuri Linkov2025-08-12 20:49:02 +0300
commitd487591edb9652e1ae5effe384f46b6485993761 (patch)
tree8345fe01029ae568bb70a40d9df9e14e5a0b3542
parent8f08cb386efa989d75d10b95b26999b8ff38cb72 (diff)
downloademacs-d487591edb9652e1ae5effe384f46b6485993761.tar.gz
emacs-d487591edb9652e1ae5effe384f46b6485993761.zip
* lisp/tab-bar.el: Revert caching in 'tab-bar-format-align-right'.
(tab-bar--align-right-cache): Remove variable. (tab-bar-format-align-right): Remove uses of 'tab-bar--align-right-cache' (bug#79141).
-rw-r--r--lisp/tab-bar.el11
1 files changed, 1 insertions, 10 deletions
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 396658af640..4c585985fb6 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1194,9 +1194,6 @@ when the tab is current. Return the result as a keymap."
1194 `((add-tab menu-item ,tab-bar-new-button tab-bar-new-tab 1194 `((add-tab menu-item ,tab-bar-new-button tab-bar-new-tab
1195 :help "New tab")))) 1195 :help "New tab"))))
1196 1196
1197(defvar tab-bar--align-right-cache nil
1198 "Optimization for `tab-bar-format-align-right'.")
1199
1200(defun tab-bar-format-align-right (&optional rest) 1197(defun tab-bar-format-align-right (&optional rest)
1201 "Align the rest of tab bar items to the right. 1198 "Align the rest of tab bar items to the right.
1202The argument `rest' is used for special handling of this item 1199The argument `rest' is used for special handling of this item
@@ -1209,13 +1206,7 @@ This prevents calling other non-idempotent items like
1209 (rest (mapconcat (lambda (item) (nth 2 item)) rest "")) 1206 (rest (mapconcat (lambda (item) (nth 2 item)) rest ""))
1210 (hpos (progn 1207 (hpos (progn
1211 (add-face-text-property 0 (length rest) 'tab-bar t rest) 1208 (add-face-text-property 0 (length rest) 'tab-bar t rest)
1212 (or (and tab-bar--align-right-cache 1209 (string-pixel-width rest)))
1213 (equal-including-properties
1214 (car tab-bar--align-right-cache) rest)
1215 (cdr tab-bar--align-right-cache))
1216 (let ((width (string-pixel-width rest)))
1217 (setq tab-bar--align-right-cache (cons rest width))
1218 width))))
1219 (str (propertize " " 'display 1210 (str (propertize " " 'display
1220 ;; The `right' spec doesn't work on TTY frames 1211 ;; The `right' spec doesn't work on TTY frames
1221 ;; when windows are split horizontally (bug#59620) 1212 ;; when windows are split horizontally (bug#59620)