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#61239: 30.0.50; Display property value `((space :align-to))` doesn't handle line numbers Date: Fri, 03 Feb 2023 10:54:35 +0200 Message-ID: <83r0v7uo1g.fsf@gnu.org> References: <87357npxlq.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8799"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61239@debbugs.gnu.org To: Narendra Joshi Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 03 09:55:52 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 1pNrrL-000274-FS for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Feb 2023 09:55:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNrr6-0006O9-Ml; Fri, 03 Feb 2023 03:55:38 -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 1pNrqZ-0006GT-6t for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2023 03:55:17 -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 1pNrqY-0002lF-Lh for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2023 03:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pNrqY-0008Cl-62 for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2023 03:55: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: Fri, 03 Feb 2023 08:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61239 X-GNU-PR-Package: emacs Original-Received: via spool by 61239-submit@debbugs.gnu.org id=B61239.167541447931501 (code B ref 61239); Fri, 03 Feb 2023 08:55:02 +0000 Original-Received: (at 61239) by debbugs.gnu.org; 3 Feb 2023 08:54:39 +0000 Original-Received: from localhost ([127.0.0.1]:36474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNrqB-0008Bz-8Q for submit@debbugs.gnu.org; Fri, 03 Feb 2023 03:54:39 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNrq9-0008Bj-Er; Fri, 03 Feb 2023 03:54:38 -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 1pNrq4-0002dZ-70; Fri, 03 Feb 2023 03:54:32 -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=gtaZT7tcIqt2yeLt0yBrUMXqS2f76TB1kuRQcHFQHDI=; b=WE0kWtWodPIT 6gUbEwcijH5pnmbdoQt/THpHCnP32KTPGrLu6LjMlzHcIKNeXxnKFG66DJAHKesOznChWufOvHFsq fFvuL1vVzzeOHCPLffqtN1CMm5AbesrGSkAihJ7PA/9pr9mJx0QDnekefscRy8d5iORFUvMUEN2eM 2U+gklyrkxrGp9ziKiU8W9VX/EaRC32nqcK/pQo1w6osrh064O1UiOMgbqgWn4zwyKrf/VlizeYh+ t2wvUKtBOJrNcCZKYcBTCbpMn6jRaNKu8Ikf6xnLHwaobYgOz/3/khENX3wYRoESj0LzsKUG5oY+6 YcAcaEq7c72/GbKkhpDB3g==; 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 1pNrq3-0000F6-NC; Fri, 03 Feb 2023 03:54:32 -0500 In-Reply-To: <87357npxlq.fsf@gmail.com> (message from Narendra Joshi on Thu, 02 Feb 2023 22:26:57 +0100) 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:254722 Archived-At: tags 61239 notabug wontfix thanks > From: Narendra Joshi > Date: Thu, 02 Feb 2023 22:26:57 +0100 > > > The following code demonstrates the behavior: > > (display-line-numbers-mode +1) > (setq header-line-format > (concat (propertize " " 'display '((space :align-to 0))) "Column")) > > With line numbers displayed, the text above, i.e. "Column" doesn't align > wit the text in the buffer. This is problematic for modes like SES mode > (https://www.gnu.org/software/emacs/manual/html_node/ses/index.html). The :align-to values in header-line and mode-line do not automatically account for line numbers when display-line-numbers-mode is turned on. This is because the display engine cannot possibly know whether the application does or doesn't want this; we certainly don't want that for mode-line, for example. For header lines, there's no guarantee that the text there must align with the buffer text: that is up to the application to decide. So if a Lisp program wants the header-line indentation to be updated according to the screen estate taken by line numbers, it should do the following: . turn on the minor mode header-line-indent-mode . include header-line-indent-width in the :align-to expression In your case, the following change in the :align-to should do what you want: (setq header-line-format (concat (propertize " " 'display '(space :align-to (+ header-line-indent-width 0))) "Column")) You can see further examples of using this in tabulated-list-mode.el. I see that the ELisp manual doesn't mention this minor mode, and moreover, has some text which might mislead you into thinking that the header-line display will automatically be updated to account for the line numbers; I will fix the manual soon.