From: Narendra Joshi <narendraj9@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 61239@debbugs.gnu.org
Subject: bug#61239: 30.0.50; Display property value `((space :align-to))` doesn't handle line numbers
Date: Fri, 3 Feb 2023 11:08:56 +0100 [thread overview]
Message-ID: <CAHCj4z5x=MvNDCLfP7h2s=2GFx0dD5hopHrM-nB+fbAXAp6f8w@mail.gmail.com> (raw)
In-Reply-To: <83r0v7uo1g.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2087 bytes --]
Thank a lot for the explanation :)
Best,
Narendra
On Fri, Feb 3, 2023, 09:54 Eli Zaretskii <eliz@gnu.org> wrote:
> tags 61239 notabug wontfix
> thanks
>
> > From: Narendra Joshi <narendraj9@gmail.com>
> > 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.
>
[-- Attachment #2: Type: text/html, Size: 2968 bytes --]
next prev parent reply other threads:[~2023-02-03 10:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-02 21:26 bug#61239: 30.0.50; Display property value `((space :align-to))` doesn't handle line numbers Narendra Joshi
2023-02-03 8:54 ` Eli Zaretskii
2023-02-03 10:08 ` Narendra Joshi [this message]
2023-02-03 14:48 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAHCj4z5x=MvNDCLfP7h2s=2GFx0dD5hopHrM-nB+fbAXAp6f8w@mail.gmail.com' \
--to=narendraj9@gmail.com \
--cc=61239@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).