From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 91418d27e9: Add new functions for computing character metrics for windows Date: Sat, 30 Apr 2022 19:19:35 +0300 Message-ID: <83tuaa7dd4.fsf@gnu.org> References: <165123811050.20687.5215165731843845332@vcs2.savannah.gnu.org> <20220429131511.9BD62C01683@vcs2.savannah.gnu.org> <87v8usc7wz.fsf@gnus.org> <83czgzacfk.fsf@gnu.org> <87ilqq4yfc.fsf@gnus.org> <837d768ywx.fsf@gnu.org> <8335hu8uey.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7937"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, malsburg@posteo.de, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 30 18:20:29 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nkppd-0001rS-48 for ged-emacs-devel@m.gmane-mx.org; Sat, 30 Apr 2022 18:20:29 +0200 Original-Received: from localhost ([::1]:41268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkppb-0007ca-QZ for ged-emacs-devel@m.gmane-mx.org; Sat, 30 Apr 2022 12:20:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkpoh-0006kQ-Oo for emacs-devel@gnu.org; Sat, 30 Apr 2022 12:19:31 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47724) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkpoh-0003UJ-CL; Sat, 30 Apr 2022 12:19:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=PNbPK7jKtt8z2180iP4TuukCGtNkluJVo4VoCmlp8sU=; b=k29qXA5U4hFA 8WYKcbf8VWQGm0P3JcXyEZDnW/p66rt0feeXMzg0NEVwH3jYyJpPck3mCtR83d3oqs+x9S0LnDBxS XPEkAdwPpW94BTK7Kp9jQA1NcS/tmT459kuHEDfT9qD8rPUwkZP0+kj9NcE3v840QFL8fbVTHUVqd rzmQKqdhG26k5Ufiu4xuHLxWES0dN3htRcMPeaiqpVYjZyVKxnhnLqSf05XTZf+VxvBGBw72ofxnb dMpnw+C/4u5lT8UwNiYEWoIVL7/7BbucRuG9b326WUY+LMecbbXrEczDtndzvDxzFmvXXUkcE4nPg ME/m5wiTOkW/U1BN91BrlA==; Original-Received: from [87.69.77.57] (port=4052 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkpog-0004PV-5L; Sat, 30 Apr 2022 12:19:31 -0400 In-Reply-To: (message from Stefan Monnier on Sat, 30 Apr 2022 11:52:44 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:289063 Archived-At: > From: Stefan Monnier > 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.