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: Eli Zaretskii
Subject: Re: master 91418d27e9: Add new functions for computing character metrics for windows
Date: Fri, 29 Apr 2022 22:59:11 +0300

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Titus von der Malsburg <malsburg@posteo.de>,  emacs-devel@gnu.org
> Date: Fri, 29 Apr 2022 10:55:09 -0400
> 
> So, really it's just another variant of `window-body-width`?

Not really, no.

> Could we use a name that's "closer" then?

Please suggest a better name.

> 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.

The latter part is impossible.  Most Lisp programmers don't understand
the fine details and issues with different measures of "window-width",
and it's infeasible to teach them all that complexity.

> 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.

IMNSHO, that way lies madness.  There are too many variations and too
many special cases.

> 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?

Why does it make sense to complicate a single API instead of having N
simpler APIs that do the different jobs?  What practical problem will
this solve?



reply via email to

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