Skip to content

Commit

Permalink
Merge pull request #30 from DivineDominion/patch-1
Browse files Browse the repository at this point in the history
Use space :align-to instead of manual computations
  • Loading branch information
rougier committed Nov 22, 2021
2 parents 2aba642 + c2de027 commit d901cf9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions elegant.el
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ background color that is barely perceptible."

(defun mode-line-render (left right)
"Function to render the modeline LEFT to RIGHT."
(let* ((available-width (- (window-width) (length left) )))
(format (format "%%s %%%ds" available-width) left right)))
(concat left
(propertize " " 'display `(space :align-to (- right ,(length right))))
right))
(setq-default mode-line-format
'((:eval
(mode-line-render
Expand Down

0 comments on commit d901cf9

Please sign in to comment.