emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master bec707da4db: * lisp/bindings.el (mode--line-format-right-align):


From: Juri Linkov
Subject: master bec707da4db: * lisp/bindings.el (mode--line-format-right-align): Add 'mode-line' face.
Date: Mon, 17 Jul 2023 13:57:37 -0400 (EDT)

branch: master
commit bec707da4dbcc64485ee5815d91f40d0babad3a9
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * 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).
---
 lisp/bindings.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/bindings.el b/lisp/bindings.el
index f1a75b080be..0a0fef1b564 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]