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 14:38:19 +0300 Message-ID: <86r0dv8kes.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6973"; 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 13:39:20 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 1s9Npu-0001Rk-Es for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 May 2024 13:39:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9Npc-0000NN-AQ; Tue, 21 May 2024 07:39:00 -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 1s9NpZ-0000Ko-HS for bug-gnu-emacs@gnu.org; Tue, 21 May 2024 07:38:57 -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 1s9NpZ-0008C3-5f for bug-gnu-emacs@gnu.org; Tue, 21 May 2024 07:38:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s9Npe-0001yO-3g for bug-gnu-emacs@gnu.org; Tue, 21 May 2024 07:39: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 11:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71085 X-GNU-PR-Package: emacs Original-Received: via spool by 71085-submit@debbugs.gnu.org id=B71085.17162915197572 (code B ref 71085); Tue, 21 May 2024 11:39:02 +0000 Original-Received: (at 71085) by debbugs.gnu.org; 21 May 2024 11:38:39 +0000 Original-Received: from localhost ([127.0.0.1]:48694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9NpH-0001y3-3R for submit@debbugs.gnu.org; Tue, 21 May 2024 07:38:39 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54716) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9NpC-0001xu-Ce; Tue, 21 May 2024 07:38:37 -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 1s9Np1-000884-FD; Tue, 21 May 2024 07:38:23 -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=e9MoNcgq9nydniRVv0+DQ7cTto266uBQAJjSV71ANaQ=; b=KLrvZ+PW5/0J cf96cuNFaIp78X4TzId/O2RfeEmAdpHZgCf6P9llHhKH762+V+Ne6o17iha6cu1S0gt/7OnvicmiA 2XTp3UnHNfLVZ3NSGSSqMJ49iL2oW0f6kRgSmIjol3zsCkRVsep9qugdKGu59hgOU/nffqnlAlZtb ZnnRh2tPVbVPrSPcRyla8VDTiniaIKfx0Ch0nVUbQC7gxe6pVnmFzEPoT60y1FIuS9L8FrWDMY6r4 eFPrIkyaOBl98GH3v4TALSz+w8yLxPbk5S1mYdWLOVEl8OJt/XjcWZ8hOgmM34lo2vLRue4dQTKny b/crQa9LVWgqPae8jPBQHw==; In-Reply-To: (message from Emre Yolcu on Mon, 20 May 2024 18:50:28 -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:285528 Archived-At: tags 71085 notabug thanks > From: Emre Yolcu > Date: Mon, 20 May 2024 18:50:28 -0400 > > As of Emacs 29.3, changing the text size in a buffer using > text-scale-adjust has no affect on margin width. Since the text displayed > in the margins has the same height as the text in the buffer, this > behavior causes the text in the margin to be clipped if we increase the > text size too much by using text-scale-adjust. Here are the steps to > confirm: > > 1. Launch with "emacs -Q". > 2. Evaluate: > > (set-window-fringes nil 0) > (set-window-margins nil 1) > > 3. Switch to a scratch buffer. > 4. Place the cursor, which should be box-shaped by default, on the > first-column of the buffer. > 5. Increase the text size in the buffer by pressing C-x C-= several times. > > Expected behavior: Left margin has exactly the same width as that of the cursor. > Current behavior: Left margin has width much smaller than that of the cursor. 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. Since Emacs 29.1, we have global-text-scale-adjust-resizes-frames, which, if non-nil, causes the frame to resize when you change the text-size globally (e.g., with C-M-+ or C-M-mouse-wheel). If you do that, the window-margins resize as well, which in this case is indeed expected (and works for me). > It also seems to me that there is no way to work around this problem in > the Elisp layer, because text-scale-mode works by remapping faces in a > buffer-local manner; however, > - there is no face defined for the margins, and > - it seems that the pixel width of the margins is not determined in a > buffer-local manner. > > Given that {left,right}-margin-width are buffer-local variables, I would > expect their pixel width to be determined in a buffer-local manner. 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 see no bug here.