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#71085: text-scale-adjust does not adjust margin width Date: Tue, 21 May 2024 21:17:37 +0300 Message-ID: <86ed9v81xa.fsf@gnu.org> References: <86r0dv8kes.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24639"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71085@debbugs.gnu.org To: Emre Yolcu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 21 20:21:28 2024 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 1s9U75-00069i-L4 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 May 2024 20:21:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9U6f-0000ce-G0; Tue, 21 May 2024 14:21:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s9U6c-0000cG-MO for bug-gnu-emacs@gnu.org; Tue, 21 May 2024 14:20:58 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s9U6b-000295-6g for bug-gnu-emacs@gnu.org; Tue, 21 May 2024 14:20:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s9U6g-00023Y-4l for bug-gnu-emacs@gnu.org; Tue, 21 May 2024 14:21: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: Tue, 21 May 2024 18:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71085 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 71085-submit@debbugs.gnu.org id=B71085.17163156077867 (code B ref 71085); Tue, 21 May 2024 18:21:02 +0000 Original-Received: (at 71085) by debbugs.gnu.org; 21 May 2024 18:20:07 +0000 Original-Received: from localhost ([127.0.0.1]:50470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9U5m-00022o-59 for submit@debbugs.gnu.org; Tue, 21 May 2024 14:20:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9U5i-00022D-Ki for 71085@debbugs.gnu.org; Tue, 21 May 2024 14:20:04 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s9U3P-0001YL-8O; Tue, 21 May 2024 14:17:40 -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=Xwzdd9fx/4srC0oinGV4wED7QaNiwVpZW6LDOYmMn2k=; b=qRTAjCIjQBap NUVfqQyYBNj3L6swPx7YlOjlOv9DqZdb1IEFKOmvrgPy6ispDr3hrKZu8G39nLToc2CYhAVDT0O71 U+mvpb4NYNusAFXOj0oCFU2fiJ7efMay6AvgSHaG85lwbh5L4aTYi5IDEQgS7s410BjU8Bwk8wICQ z1lvvDjusHj8qki8eFTOJjvM6iOVTQPuX4kMCK08pj3rGOT07yM35nqDRLcEXHf23QXbTJIivx9xr wB4crAfL7vODrHKZlisuipeo10vCQmTgT2yOAbPvH0Vf7p8OYAhLH/WDpBfeLOj9bwfNxR48dzowT r9A3KTsHeyrhS6FIXuyxlg==; In-Reply-To: (message from Emre Yolcu on Tue, 21 May 2024 12:14:41 -0400) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:285547 Archived-At: > Date: Tue, 21 May 2024 12:14:41 -0400 > Cc: 71085@debbugs.gnu.org > From: Emre Yolcu > > Eli Zaretskii wrote: > > I don't understand the expectations: the window and frame geometry are > > not changed by text-scale-adjust, so why did you expect the window > > margins to change? The margins are part of the window geometry. > I was not thinking of the margins as part of the window geometry but as > a special part of the buffer that we set aside and do not interact with. Well, but the fact is the margins _are_ part of the window geometry. And window geometry doesn't change when text size is scaled. So this is a de-facto behavior Emacs had for several releases now, and we must preserve it. > This is partly because the margins display text, the height of which is > affected by text-scale-adjust, and partly because there is no visual > separation between the margin and the buffer (assuming fringes are > disabled). For comparison, the mode line also displays text, but it has > its own face and its text size is not affected by text-scale-adjust (as > one would expect). The fringe also has its own face, as do all of the > other things that I would consider to be part of the window geometry, > but there is no "margin" face. (I am aware that we can affect its > display to some degree by propertizing the text in it.) I see no reason to introduce yet another face. Most stuff displayed in the margin doesn't need to be resized, so modes who write some large enough text there can use a special face as I demonstrated. > > The above is inaccurate: the text shown in the margin can have its own > > distinct face. For example, try this in "emacs -Q": > > > > M-x font-lock-mode RET > > M-< > > M-: (set-window-margins nil 4 4) RET > > M-: (add-text-properties (point) (1+ (point)) (list 'display (list '(margin left-margin) (propertize "FOO" 'face 'warning)))) RET > > > > You will see the string "FOO" displayed in the margin with a distinct > > face. You could define this face to have an absolute :height > > attribute, in which case the text in the margin will not scale, and > > thus will not be clipped when you use text-size-adjust. So there _is_ > > in fact a way to work around, even if you don't want to use > > global-text-scale-adjust-resizes-frames and the globalized > > text-scaling. > I didn't mean to imply that we cannot affect the appearance of the text > displayed in the margins in any way, but simply that there is no > "margin" face that a user can modify via, for instance, > custom-set-faces. The workaround that you suggested requires the user to > patch every single package that displays text in the margins, which is > less than ideal. Not "every package", because not every package has these problems. But yes, packages that want the text in the margins to remain visible even when the text is significantly resized need to define a special face for the margin. I see no problem here, since this is on a per-package basis. > A much nicer workaround would be possible if there > existed a "margin" face: text-scale-mode could simply remap it as it > does the default face. Actually, you want a face that will _not_ be remapped, since you want to make sure the text in the margins will not get clipped. The current behavior is that by default the text in the margin is already remapped, which is why it can get clipped if it becomes too wide. > > I see no bug here. > Fair enough. Please consider it a feature request for a "margin" face I don't see a need for it, sorry.