1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

* lisp/bindings.el (mode--line-format-right-align): Add 'mode-line' face.

Like in `tab-bar-format-align-right', use `add-face-text-property' to
add 'mode-line' face on the `rest-str' string for `string-pixel-width'
to calculate the correct pixel width (bug#62606).
This commit is contained in:
Juri Linkov 2023-07-17 20:56:29 +03:00
parent 157e735ce8
commit bec707da4d

View file

@ -338,7 +338,10 @@ the symbol `mode-line-format-right-align' is processed by
(let* ((rest (cdr (memq 'mode-line-format-right-align
mode-line-format)))
(rest-str (format-mode-line `("" ,@rest)))
(rest-width (string-pixel-width rest-str)))
(rest-width (progn
(add-face-text-property
0 (length rest-str) 'mode-line t rest-str)
(string-pixel-width rest-str))))
(propertize " " 'display
;; The `right' spec doesn't work on TTY frames
;; when windows are split horizontally (bug#59620)