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#59311: 29.0.50; tab-bar global-mode-string affected by global-display-line-numbers Date: Sat, 19 Nov 2022 21:46:53 +0200 Message-ID: <83mt8m7mmq.fsf@gnu.org> References: <86v8ncdbk1.fsf@mail.linkov.net> <83v8ncbqly.fsf@gnu.org> <86o7t292y3.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26939"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59311@debbugs.gnu.org, gabriel376@hotmail.com To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 19 20:47:15 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 1owTo2-0006q1-BZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Nov 2022 20:47:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owTnr-0005c0-PG; Sat, 19 Nov 2022 14:47:03 -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 1owTnq-0005bc-Mq for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2022 14:47:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1owTnq-0006YE-6Q for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2022 14:47:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1owTnq-00079P-1d for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2022 14:47: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, 19 Nov 2022 19:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59311 X-GNU-PR-Package: emacs Original-Received: via spool by 59311-submit@debbugs.gnu.org id=B59311.166888721327474 (code B ref 59311); Sat, 19 Nov 2022 19:47:02 +0000 Original-Received: (at 59311) by debbugs.gnu.org; 19 Nov 2022 19:46:53 +0000 Original-Received: from localhost ([127.0.0.1]:41484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owTnh-000792-EP for submit@debbugs.gnu.org; Sat, 19 Nov 2022 14:46:53 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owTng-00078r-71 for 59311@debbugs.gnu.org; Sat, 19 Nov 2022 14:46:52 -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 1owTna-00067U-8i; Sat, 19 Nov 2022 14:46:46 -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=yhmMuECBbO3asoTCEnetNAmk428h7chzhSdxCSNEiWs=; b=WgIWv8Gd4gJa gLxjIbNI7v5tIvFQ5SrK8EUqK19wuTJurSU8dhrloFiLox2okalFuDZ4qvPc+u17YgaSavR4KzYcs F8qf78z7Tj4qjvMWDM7CrC4ye3Qbpf1hgSqMxbAw/OachwOwWB23LcO7DDJlVce/PPLrox/X2eHv0 EOcYgOHwkjb9Ok/yuz530aaBSpexGZTveSVko3j3JwfN7w7wbZ+K1nN+gabn566sveCXmptV7dMsF VPhkQggOeO0n+3Xyr9HZHZPHvSbVnFxSciOTNfA1fr/hMjjp1q4CDKTZE6BMEiYLoVNovI3jrWyju uaGXE6WbELbfmuzHi9/9pQ==; Original-Received: from [87.69.77.57] (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 1owTnZ-0007t1-Ou; Sat, 19 Nov 2022 14:46:46 -0500 In-Reply-To: <86o7t292y3.fsf@mail.linkov.net> (message from Juri Linkov on Sat, 19 Nov 2022 21:03:08 +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:248374 Archived-At: > From: Juri Linkov > Cc: gabriel376@hotmail.com, 59311@debbugs.gnu.org > Date: Sat, 19 Nov 2022 21:03:08 +0200 > > >> @@ -322,6 +322,8 @@ string-pixel-width > >> (with-current-buffer (get-buffer-create " *string-pixel-width*") > >> + (when display-line-numbers-mode > >> + (display-line-numbers-mode -1)) > >> (delete-region (point-min) (point-max)) > >> (insert string) > >> (car (buffer-text-pixel-size nil nil t))))) > > > > Yes. Or subtract what (line-number-display-width t) returns (it will > > return zero when line-numbers are turned OFF). > > Shouldn't then buffer-text-pixel-size subtract line-number-display-width? > Isn't this the responsibility of buffer-text-pixel-size, > not responsibility of a caller like string-pixel-width? No, because line-numbers take space, and some use cases of buffer-text-pixel-size want to know that. Only the caller knows whether the line-numbers should or shouldn't be included. The principle is that we measure the space taken in the text-area, no matter how it is used. (There are other display features that affect the result, for example, line-prefix.)