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: Fri, 29 Apr 2022 10:55:09 -0400 Message-ID: References: <165123811050.20687.5215165731843845332@vcs2.savannah.gnu.org> <20220429131511.9BD62C01683@vcs2.savannah.gnu.org> <87v8usc7wz.fsf@gnus.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="27922"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Titus von der Malsburg , emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 29 16:58: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 1nkS4j-00075N-Ib for ged-emacs-devel@m.gmane-mx.org; Fri, 29 Apr 2022 16:58:29 +0200 Original-Received: from localhost ([::1]:60634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkS4g-0003oB-BI for ged-emacs-devel@m.gmane-mx.org; Fri, 29 Apr 2022 10:58:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkS1c-00087D-HI for emacs-devel@gnu.org; Fri, 29 Apr 2022 10:55:16 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:55498) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkS1Z-00020J-LU for emacs-devel@gnu.org; Fri, 29 Apr 2022 10:55:15 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 442784424A5; Fri, 29 Apr 2022 10:55:12 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A91A64424AD; Fri, 29 Apr 2022 10:55:10 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1651244110; bh=lU7yZi1QE/99WQ/077iJe81YntlaasUi17wl56uchks=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Cnw6U/yG0XmRqfX8K0fiwUShlew/IIZSTSeMf51A+PVdAJFzRWMxd+Imwo7WKFcsI GNwSgYFOqtMaUCZLnLQnV4jICBHNeSbuKCajVdeJVXXsg5LbpHyNjUPf2e4JU5+RY/ 7ymBGav3Qh8wnb5xSD4CrvtEKnNaSfHftXzwxlh66t4k+FOMLcDQt6cpLKuj6ZVwzK A+21CjIoUbWtfQYE3wKG/Fx/v++nMBVOtfeuydhgbqvaDx1fIuD7uBMrPk2Gq9qxV6 cc70PKZlTviVo2oxYBMt+iNlG6GXhHE276gUMQ1nUFZQTSBh4Xio5BK77avLSeHs9j bPj7IrEyWclDA== Original-Received: from pastel (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7F461120163; Fri, 29 Apr 2022 10:55:10 -0400 (EDT) In-Reply-To: <87v8usc7wz.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 29 Apr 2022 15:53:48 +0200") 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:288998 Archived-At: Lars Ingebrigtsen [2022-04-29 15:53:48] wrote: > Stefan Monnier 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