emacs-devel
[Top][All Lists]
Advanced

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

Re: master 91418d27e9: Add new functions for computing character metrics


From: Stefan Monnier
Subject: Re: master 91418d27e9: Add new functions for computing character metrics for windows
Date: Fri, 29 Apr 2022 10:55:09 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Lars Ingebrigtsen [2022-04-29 15:53:48] wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> Any reason not to group them under the same heading?
> I thought the "probably introduced" thing only looked in the headings?

Oh, no, it just performs a very naive regexp search over the whole text.

>>> +(defun window-max-characters-per-line (&optional window face)
>>
>> The name says "max", but AFAICT it's basically "window width / *average*
>> char width", so it's not really the "max" number of chars (unsurprisingly).
>>
>> I'm not sure how best to name it (and document it), tho.
>> For that I think I'd need to know what are the use cases (to see what
>> property they rely on).
> The use case basically is that you want to draw monospaced things that
> aren't too wide, but the function was made a bit more general.

So, really it's just another variant of `window-body-width`?
Could we use a name that's "closer" then?

We should try and "bring together" all the window-foo-width variants so
as to try and reduce the probability that someone uses the wrong one by
accident.

Not completely sure what "bring together" should mean here.  Could be
merge them into a single function with an extra argument describing
which elements to include/exclude in the count, or it could be to place
them all under the `window-width-` prefix, or includes links
between them in their docstrings, ...
And of course clearly describe the differences between them.

Maybe in this case, instead of introducing a new function we should
refine the "pixelwise" arg of `window-body-width` so we can choose
between pixelwise, or based on the size of the frame's font, or based on
the size of a particular face's font?


        Stefan




reply via email to

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