From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: master 91418d27e9: Add new functions for computing character metrics for windows Date: Sat, 30 Apr 2022 11:52:44 -0400 Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35928"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: larsi@gnus.org, malsburg@posteo.de, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 30 17:53:49 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 1nkpPp-00097o-0G for ged-emacs-devel@m.gmane-mx.org; Sat, 30 Apr 2022 17:53:49 +0200 Original-Received: from localhost ([::1]:55212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkpPn-0005Fp-KY for ged-emacs-devel@m.gmane-mx.org; Sat, 30 Apr 2022 11:53:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkpOy-0004ZZ-Tp for emacs-devel@gnu.org; Sat, 30 Apr 2022 11:52:56 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:19918) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkpOw-0000Bz-2k; Sat, 30 Apr 2022 11:52:55 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3B4CA440F6B; Sat, 30 Apr 2022 11:52:52 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7AE80440A6E; Sat, 30 Apr 2022 11:52:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1651333970; bh=z6VSZQ3HF/y73bBVdA/MYMOFCWBu4ewt/wxpwxzKjoo=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=prPQtIEepXqOmUSKsgz67ZGXKFZjEWRfc1q2Nky3cNhRwuE6XiZ92Bp2UpKQCJLXr XWOs4u1bXmFbCF5Pqt6W3aM2/y17GCJJqDngy2ug1HBJ9hvuTmmD0UCVLUl5Rid4pg UAMyUyz8rxeox+8B2Uq3T+7oiplSzln18OwN4iYlMubhNtM58K8c6hcFDHnoK46LC5 dYK9qWqqdZv0Lpc0xWLvcJkrUugjEt2QRd29ohOxBiNh1LY0fFg8D8YqGKOjwlYRM7 V0PaDmHIOcBSWmP3bpClMjHk3XMQdQ+30GPiN9hlgUOiYls5W83WZ2nyW88XdCTUOy Kcckvn7/SFcJw== Original-Received: from pastel (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 16EA01206B0; Sat, 30 Apr 2022 11:52:50 -0400 (EDT) In-Reply-To: <8335hu8uey.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 30 Apr 2022 18:25:57 +0300") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:289062 Archived-At: > 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. Maybe it's a bit closer to 100% but that doesn't make it qualitatively different and that makes it part of the same family as those other functions. And having such wildly different naming between those functions is not helpful. > 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". > Any API can be used mistakenly, but that fact doesn't yet mean the API > is not useful when used correctly. I think you misunderstand me: I'm not at all opposed to the functionality offered by this new function. >> > (And I wonder why this sudden crusade against this function.) >> For one, because it's name makes it impossible to find when you're >> looking for "one of those functions that returns some notion of text >> width". > I disagree. But anyway, if you or someone can come up with a better > name, and do it soon enough, we can easily rename it. I think it should match window-*-width since that's the most common pattern shared by other functions in that family, AFAICT. >> For two, because this was already a nasty mess and this function just >> adds insult to injury, IMO. > 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. Stefan