[Top][All Lists]

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

Re: Variable pitch text filling

From: Eli Zaretskii
Subject: Re: Variable pitch text filling
Date: Thu, 02 Dec 2021 19:53:36 +0200

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: emacs-devel@gnu.org
> Date: Wed, 01 Dec 2021 18:35:31 +0100
> Eli Zaretskii <eliz@gnu.org> writes:
> >> 1) Be able to specify a min width based on a "standard" char width (for
> >> "-" in the mode line, for instance)
> >> 
> >> 2) A specific pixel width (for justification, for instance)
> >> 
> >> 3) The integral multiple (i.e., "grid")
> >
> > 1) is for mode line, and is satisfied with min-width display spec
> > (which needs to be fixed, perhaps, see bug#52183).
> > 2) is for pixel-resolution justification, and will be satisfied by a
> > new kind of display spec.
> > 3) will should be per-buffer (or globally), and will be satisfied by a new
> > buffer-local variable.
> >
> > Is something missing?
> Yes.
> 1) is difficult to achieve, because we haven't implemented a recursive
> `min-width'.  To do so it possible, but finicky, since we have to look
> far ahead in the buffer to see whether a new min-width spec ends the
> current one, or starts a new recursive one.  I'd rather not do that,
> because it'd be ugly and weird. 
> So all three of these should be a new kind of text property.  In
> addition, 3) should also be a buffer-local variable in addition to being
> a text property.  (The text property is useful if you have a monospace
> table in a buffer, but there may be other text in the buffer that you
> don't want to quantise.)

I've now implemented the "variable" part of 3).  To try it, set the
new variable align-columns-display (suggestions for a better name are
welcome) to a non-nil value.  I'd like our CJK users to try this and
tell if they like the results, before implementing also the
text-property part of the feature, as that is significantly more
complex to code.

Note: there's currently a heuristic in the code I installed, meant to
detect fixed-pitch fonts (the above feature only affects fixed-pitch
faces).  In the long run, we probably should extend 'struct font' to
have this flag readily available, so there should be no need for that

reply via email to

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