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#75168: 31.0.50; text-scale confuses ruler-mode when display-line-number-mode is active Date: Sun, 29 Dec 2024 08:37:17 +0200 Message-ID: <86o70vq9k2.fsf@gnu.org> References: <86o70vv79r.fsf@aarsen.me> 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="24365"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 75168@debbugs.gnu.org To: Arsen =?UTF-8?Q?Arsenovi=C4=87?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 29 07:40:24 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 1tRmyO-0006DU-I8 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 29 Dec 2024 07:40:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRmy4-00051X-RN; Sun, 29 Dec 2024 01:40:04 -0500 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 1tRmy2-00051K-Pm for bug-gnu-emacs@gnu.org; Sun, 29 Dec 2024 01:40:02 -0500 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 1tRmy2-0001l7-G9 for bug-gnu-emacs@gnu.org; Sun, 29 Dec 2024 01:40:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=yBuThpNJpDvgnH0sxtrlLa/w2b5nuTVYJZrb/cVEzMk=; b=CIzKoFfP+ZTeMPPlsJVP32U7x9oWN4uNOxxzEglSdLjcSgwTdQSFXm7iWFmPhHBTpkSbNao5mgiWNkBps3GnMirS0ymRjpX019U5wM1h9lHPPZLmcXY+nGZhIPfl+ASU60/9xSnFiPfb6+hXdSQ2/adn3UaKNRHb987hrFiTAA1NDviGBBuO2wwRDi+Fs2sDsrkhJd/NJ8xsEGp4q7Yl+ot62ExVrq7ENhsu9KI7DR2duGSucwiocKLXTFajLFuPgiXPNY7r1PtSsKfD+2maVYQN0+3PS7F5NtJkp+aLCAlndxOyN3JuVzJsITlsM58hgH/hF0z/puqd9IV7IVKNgg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tRmy2-0005Ez-9B for bug-gnu-emacs@gnu.org; Sun, 29 Dec 2024 01:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Dec 2024 06:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75168 X-GNU-PR-Package: emacs Original-Received: via spool by 75168-submit@debbugs.gnu.org id=B75168.173545438520102 (code B ref 75168); Sun, 29 Dec 2024 06:40:02 +0000 Original-Received: (at 75168) by debbugs.gnu.org; 29 Dec 2024 06:39:45 +0000 Original-Received: from localhost ([127.0.0.1]:53528 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRmxk-0005EA-Ue for submit@debbugs.gnu.org; Sun, 29 Dec 2024 01:39:45 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35562) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRmxj-0005Dt-7v for 75168@debbugs.gnu.org; Sun, 29 Dec 2024 01:39:43 -0500 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 1tRmvY-0000Xn-Is; Sun, 29 Dec 2024 01:37:28 -0500 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=yBuThpNJpDvgnH0sxtrlLa/w2b5nuTVYJZrb/cVEzMk=; b=WnPXhSfX+/lBmgQzOkbx M9A1wvXINRVLjor5xKYrno2MDPzUb1pIkxOIpGaQfSQ2ph+pVIcTxEqJCkRcnKrs7+a5L4JGP4CZl o0z7TpxzgDoFjwVbS78/K/B7i/s1k1OraRzhQhIy6jYcK6HWMLXgtsWwImgauQQ4TjaKZUhy4zvMp jDqfMHHIOn4jLdASaz3gmFDfg4o93IyEdlSfQCXUPMCtKxvOhORxJp4E1+JoMv6ozZ2Tr6CryNaw/ SpEwaI86CtR6911BnFB0B7yaykVPGXaglX11sNuhfspgO9cYrjsv8X7LP9tQM+/9w7Gxz3YEJyg1v uusL3W+a/bhXYA==; In-Reply-To: <86o70vv79r.fsf@aarsen.me> (bug-gnu-emacs@gnu.org) 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:297931 Archived-At: > Date: Sat, 28 Dec 2024 22:15:28 +0100 > From: Arsen Arsenović via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Reproduction steps: > 1. emacs -Q > 2. M-x display-line-numbers-mode RET > 3. M-x ruler-mode RET > 4. C-x C-+ C-+ C-+ C-+ > > You should notice that the ruler is misaligned. Ruler mode doesn't work well with text-scale, as the comment there says. > I've hotfixed this in my running Emacs by applying: > > modified lisp/ruler-mode.el > @@ -636,7 +636,7 @@ ruler-mode-ruler > ;; FIXME: ruler-mode relies on I being an integer, so > ;; the column numbers might be slightly off if the > ;; line-number face is customized. > - (round (line-number-display-width 'columns)) > + (+ (round (line-number-display-width)) 2) > 0)) > (j (ruler-mode-text-scaled-window-hscroll)) > ;; Setup the scrollbar, fringes, and margins areas. > > ... and re-evaling the ruler-mode-ruler defun. > > Per the line-number-display-width doc, when it is called with 'columns, > it returns the number of columns in the frames canonical font size, but > that's not the font size that is used for the fringes: the fringes seem > to use the font the buffer is using, at least after text-scale-mode does > its thing. I'm not sure I understand what you mean by "fringes seem to use the font the buffer is using". When I type "C-x C-+ C-+...", the fringes stay at their original width. Do you see something different? Anyway, the change you suggest is basically going back to what we had before fixing bug#28855, so I don't think we can make such a change, at least not literally. We need something more complex to account for the use cases described in that bug. > Interestingly, changing text-scale-remap-header-line appears to have no > effect, but that variable ought to be accounted for somehow also, I > think? Though, if the line-numbers and header line always use the same > face, then the above should be correct, I think? If you take a look at ruler-mode.el, you will see that it overrides header-line-format by its own code.