Optimize modeline rendering slightly

This commit is contained in:
Henrik Lissner 2017-06-17 11:40:21 +02:00
parent 414363fe38
commit a8df81b259
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -385,12 +385,13 @@ Example:
(defun ,sym ()
(let ((lhs (list ,@lhs-forms))
(rhs (list ,@rhs-forms)))
(list lhs
(propertize
" " 'display
`((space :align-to (- (+ right right-fringe right-margin)
,(+ 1 (string-width (format-mode-line rhs)))))))
rhs)))
(let ((rhs-str (format-mode-line rhs)))
(list lhs
(propertize
" " 'display
`((space :align-to (- (+ right right-fringe right-margin)
,(+ 1 (string-width rhs-str))))))
rhs-str))))
,(unless (bound-and-true-p byte-compile-current-file)
`(let (byte-compile-warnings)
(byte-compile #',sym))))))