* Line breaks in mode line?
@ 2022-07-15 3:39 Vladimir Nikishkin
2022-07-15 6:21 ` Eli Zaretskii
0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Nikishkin @ 2022-07-15 3:39 UTC (permalink / raw)
To: help-gnu-emacs
Hello, everyone.
I have recently tried to customize `mode-line-format` , and found that
line breaks are rendered as ^J rather than an actual line break.
Is that intentional? How hard would it be to patch Emacs to make them
actual line breaks? Or, maybe, add a new percent-sign for line
breaking?
--
Yours sincerely, Vladimir Nikishkin
(Sent from GMail web interface.)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Line breaks in mode line?
2022-07-15 3:39 Line breaks in mode line? Vladimir Nikishkin
@ 2022-07-15 6:21 ` Eli Zaretskii
0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2022-07-15 6:21 UTC (permalink / raw)
To: help-gnu-emacs
> From: Vladimir Nikishkin <lockywolf@gmail.com>
> Date: Fri, 15 Jul 2022 11:39:20 +0800
>
> I have recently tried to customize `mode-line-format` , and found that
> line breaks are rendered as ^J rather than an actual line break.
>
> Is that intentional?
Yes. The assumption that the mode line takes exactly one screen line
in each window, and that this single line is at the bottom of the
window, is hard-coded into the Emacs display engine.
You need to realize and keep in mind that the way newlines behave in
buffer text, i.e. the line breaks they cause, is not some formatting
issue, it's a deliberate action taken by the display engine. The
newline doesn't have any glyph for it on display, it disappears
without a trace because the display engine starts a new screen line.
If you disable that, the ^J thing will appear inside buffer text as
well.
> How hard would it be to patch Emacs to make them actual line breaks?
> Or, maybe, add a new percent-sign for line breaking?
You'd need non-trivial changes to the display engine. In particular,
all the geometry-related layout decisions will be affected, because we
currently blindly add 1 to the number of lines in the window body.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-15 6:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-15 3:39 Line breaks in mode line? Vladimir Nikishkin
2022-07-15 6:21 ` Eli Zaretskii
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).