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.bugs Subject: bug#55696: 28.1; eshell fails to respect text-scale-increase Date: Fri, 03 Jun 2022 09:31:21 +0300 Message-ID: <831qw6dzra.fsf@gnu.org> References: <37af046b-4257-6370-c765-9290eae73fd4@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25195"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 55696@debbugs.gnu.org, jeff.kowalski@gmail.com To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 03 08:34:14 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1nx0su-0006QV-UK for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Jun 2022 08:34:13 +0200 Original-Received: from localhost ([::1]:52550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nx0st-0006p5-Jj for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Jun 2022 02:34:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nx0rm-0006m5-Pf for bug-gnu-emacs@gnu.org; Fri, 03 Jun 2022 02:33:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32916) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nx0rm-0004HY-Ao for bug-gnu-emacs@gnu.org; Fri, 03 Jun 2022 02:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nx0rm-0004rD-7Q for bug-gnu-emacs@gnu.org; Fri, 03 Jun 2022 02:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Jun 2022 06:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55696 X-GNU-PR-Package: emacs Original-Received: via spool by 55696-submit@debbugs.gnu.org id=B55696.165423792617349 (code B ref 55696); Fri, 03 Jun 2022 06:33:02 +0000 Original-Received: (at 55696) by debbugs.gnu.org; 3 Jun 2022 06:32:06 +0000 Original-Received: from localhost ([127.0.0.1]:55046 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nx0qs-0004VV-97 for submit@debbugs.gnu.org; Fri, 03 Jun 2022 02:32:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42964) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nx0qn-0004O1-RC for 55696@debbugs.gnu.org; Fri, 03 Jun 2022 02:32:04 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48376) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nx0qi-0004BF-59; Fri, 03 Jun 2022 02:31:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=bokEWn7AgnjIAX0KGtM1XGIEVyg0SLR6gBaODT7zbkU=; b=TbxzdGnJo85DMPUpqM6H gdroifxKg0dL2326uVl3WrCgQOTDmKeynSpQRBjK12fbGpsZANKleCR7S7AY2JV7lhlWm1WEwLFEn IBX7xRh6lubSiLHQqmD+pPVKvlsv8GAaCxqBp3+jfCzw0zNMyANhxT0TMrJASW9QeibtjpNIcYmHa RoUjs2kCMcM8wfm84/C0sB1Pp7uOEzPFQLHgSVQdv127yCzswBwOfM9QYtlInxVvnB3wwGaj11b9A pgTh6hbxEOVez6tGXIiupX489hSRW3s5zGiL850tqbj9Tl56ZG37SXtyLrz5D7JFTGMVF6JfXzJT6 +DfuCON8lxFcCA==; Original-Received: from [87.69.77.57] (port=4228 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 1nx0py-0002cV-JR; Fri, 03 Jun 2022 02:31:12 -0400 In-Reply-To: <37af046b-4257-6370-c765-9290eae73fd4@gmail.com> (message from Jim Porter on Thu, 2 Jun 2022 21:41:33 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:233587 Archived-At: > From: Jim Porter > Date: Thu, 2 Jun 2022 21:41:33 -0700 > > > M-x text-scale-increase > > ls /etc > > > > At this point, the listing is very poorly wrapped.  It appears to ignore > > the increased width of the font relative to the width of the window > > Thanks for the bug report. I think this patch fixes things. I added > `window-max-lines' as the Y-axis correspondent to the X-axis version > `window-max-chars-per-line'; maybe there's a function for this already, > but I didn't see one after a bit of searching. Thanks, but I'm not too happy with adding such a function to Emacs. I understand why it could make sense for Eshell, or any other package that uses fixed-size characters, like terminal emulators in term.el. But in general, it makes no sense in Emacs to ask how many lines of a given non-default font can fit in a window, because you cannot guarantee that a single font will be used in the entire window -- it is enough to have some of the text having the bold or italic face attribute, or have some non-ASCII characters that will be displayed in a different font, to disrupt the results. We could perhaps make window-body-width and window-body-height optionally pay attention to the remapping of the default face, which should handle the case such as this one. Would that be acceptable for you? > + (with-selected-window (window-normalize-window window t) > + (let ((window-height (window-body-height window t)) > + (font-height (window-font-height window face))) > + (/ window-height font-height)))) Is integer division here really TRT? Shouldn't we round to the nearest integer instead of truncating?