emacs-devel
[Top][All Lists]
Advanced

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

Re: How to make Emacs popular again: Use monospaced fonts less


From: Eli Zaretskii
Subject: Re: How to make Emacs popular again: Use monospaced fonts less
Date: Mon, 12 Oct 2020 19:49:26 +0300

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: emacs-devel@gnu.org
> Date: Mon, 12 Oct 2020 00:21:10 +0200
> 
> > Btw, if there were such a property, how would you calculate the value
> > to put there?
> 
> It depends -- for instance, when calculating tabular layouts, I'd know
> the number of pixels already.  In the mode line, I'd take 5x
> typical-character-width if I wanted to display something that should
> typically not take more than 5 characters.

If this is what you already know, then calculating the goal
coordinates for :align-to should be a simple matter of adding up the
column widths.  Right?

> OK, here's another random idea for padding variable-pitch elements in
> the mode lines in particular:
> 
>         (setq mode-line-thing
>               `(:propertize
>                 "some-string"
>                 :min-width 15))
> 
> which could have well-defined semantics, like "this element should have
> the width of at least 15 typical characters", and be pretty easy to use?

This stuff is basically unworkable without having a window in whose
context the string will be shown.  That's because we need metrics of
each character glyph, and that presumes fonts, and that presumes faces
and other stuff.

This is why we use 'display' property: when the text is displayed, we
have this data by definition.  But not when we just have a string.



reply via email to

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