Skip to content

Variable-pitch right-alignment now possible with Emacs 30.1 #17

@mmarshall540

Description

@mmarshall540

This is essentially the same issue as #8, which couldn't be solved at the time. But there's been a new development.

Emacs 30.1 has a new mode line construct, mode-line-format-right-align, along with a new user option to control it, mode-line-right-align-edge.

This new construct right-aligns any constructs that follows it, and it does so in a pixel-wise manner that works for variable-pitch fonts. So it's now possible to enable modus-themes-variable-pitch-ui or ef-themes-variable-pitch-ui and still use Simple-modeline!

Since it depends on Emacs 30.1, I don't know how you'd feel about incorporating it into the package yet. (Maybe adding a dependency for compat.el could make it work on older Emacs versions? Not sure.)

Here's how I'm using it.

(simple-modeline-mode)
(setopt mode-line-right-align-edge 'right-fringe)
(setopt mode-line-format '((:eval (simple-modeline--format-segments
                                   (car simple-modeline-segments)))
                           mode-line-format-right-align
                           (:eval (simple-modeline--format-segments
                                   (cadr simple-modeline-segments)))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions