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: Sat, 30 Apr 2022 19:19:35 +0300

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: larsi@gnus.org,  malsburg@posteo.de,  emacs-devel@gnu.org
> Date: Sat, 30 Apr 2022 11:52:44 -0400
> 
> > Emacs is still 85% fixed-pitch.  We still don't "have the technology"
> > to work with variable-pitch fonts as simply and efficiently as with
> > fixed-pitch.  In this situation, lamenting the fact that an API is
> > less helpful with variable-pitch fonts strikes me as a clear case of
> > premature optimization.
> 
> That's not my point.  All I'm saying is that it's just another function
> that does the ~90% work.

Any function that deals with integer columns and lines will never be
able to do a 100% job.  And yet we have quite a few of those, and they
are used all over, with generally good results.

> > No, I didn't.  If someone needs to use text with different faces, then
> > calling this function is a mistake.
> 
> Most of the code that will want to use this function can be confronted
> with text with different faces completely out of its control
> (e.g. because of hi-lock, goto-address-mode, you name it).
> So you're saying that in practice most uses are "a mistake".

That's not the use case this function supports.  It supports the use
case where some Lisp program produces text under its control, and
wants to know how much of the text can be put on a single screen line.

> > I cannot disagree more.  The function has a place and serves a class
> > of use cases well enough to be justified.  It prevents Lisp programs
> > from using low-level interfaces like font-get-glyphs etc., on the one
> > hand, and OTOH is simpler and faster than window-text-pixel-size.
> 
> I'm not arguing against the new functionality.
> I'm arguing against the way it's exposed.

The way it's exposed reflects the needs of the use cases it serves.



reply via email to

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