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#67248: 30.0.50; string-pixel-width is affected by the global value of display-line-numbers Date: Sat, 18 Nov 2023 09:14:24 +0200 Message-ID: <83fs13o7n3.fsf@gnu.org> References: <8cc52908-98c6-b853-a679-b4ac29755555@yandex.ru> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24161"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67248@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 18 08:15:36 2023 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 1r4FYF-00063p-Kd for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Nov 2023 08:15:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4FXr-00028y-Qj; Sat, 18 Nov 2023 02:15:11 -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 1r4FXp-00027q-Iy for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2023 02:15:09 -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 1r4FXh-0008R8-VG for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2023 02:15:08 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r4FXi-0004PP-Bl for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2023 02:15: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: Sat, 18 Nov 2023 07:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67248 X-GNU-PR-Package: emacs Original-Received: via spool by 67248-submit@debbugs.gnu.org id=B67248.170029167616894 (code B ref 67248); Sat, 18 Nov 2023 07:15:02 +0000 Original-Received: (at 67248) by debbugs.gnu.org; 18 Nov 2023 07:14:36 +0000 Original-Received: from localhost ([127.0.0.1]:47708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4FXI-0004OQ-6I for submit@debbugs.gnu.org; Sat, 18 Nov 2023 02:14:36 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4FXG-0004OD-RT for 67248@debbugs.gnu.org; Sat, 18 Nov 2023 02:14:35 -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 1r4FXA-0008N3-Im; Sat, 18 Nov 2023 02:14:28 -0500 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=DkSNol4LqRxhccHx5ogg7cn56TeqmqGsQJ23PvEBFB8=; b=eDkC6z6/CqbG mjAZRkZo9bThRYksjtXtIrIee/sZPX0xrtQUs3HbGigiLJMtgVZhawHvoxYCYk1ytCj4VFzfrKB5t 8Tucivjm8bX/dmGLi+SqvpdFNakzOHlxQIRbw2AJhez2eRQ6Pv3pK/fkvUmlo8o9QMVmbb4INdyxh 92eisFVXs5QhDH2jRfGZK5/YxOcXwJZhyzdPt3R4IIhx9p8fv0u7CRlCdDVLHIaz2QcaUykObpp2H 8/xT6fAf8h+PqXnkL90RYfDXOD8ZzPn1L4FqvxqonqRn562Cbm2/VZQXeXTcj4J99wUpLVrI5F+pk Rj328r7WOy38/wc8jUrOQw==; In-Reply-To: <8cc52908-98c6-b853-a679-b4ac29755555@yandex.ru> (message from Dmitry Gutov on Fri, 17 Nov 2023 23:23:58 +0200) 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:274528 Archived-At: > Date: Fri, 17 Nov 2023 23:23:58 +0200 > From: Dmitry Gutov > > 1. (string-pixel-width "abc") ; => 51 > 2. (customize-set-variable 'display-line-numbers t) > 3. (string-pixel-width "abc") ; => 119 > > This function's implementation makes provision for > display-line-numbers-mode, but not for the original variable > display-line-numbers, which will be t independent of the value of > display-line-numbers-mode. > > I think it's a bad idea to have these two different ways to do the same > thing, and it can lead to bugs like this one. I would suggest obsoleting > the public use of display-line-numbers -- making it private, probably. > At least removing it from the customization group display-line-numbers. I don't see a need for such drastic measures, certainly not due to this bug. Having the variable and the mode in this case is not different from other similar cases, for example, word-wrap vs visual-line-mode. You have just discovered that the test in string-pixel-width was not the correct one, that's all. > Barring that, the patch below seems to work. Although it proliferates > the differences between Emacs versions which one would have to be on the > lookout for. Thanks, I think this is indeed the right solution. Please install the patch on the emacs-29 branch.