help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Line breaks in mode line?


From: Eli Zaretskii
Subject: Re: Line breaks in mode line?
Date: Fri, 15 Jul 2022 09:21:50 +0300

> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]