[Top][All Lists]

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

Re: Modernize frame-title-format: "%b - GNU Emacs"

From: Eli Zaretskii
Subject: Re: Modernize frame-title-format: "%b - GNU Emacs"
Date: Mon, 31 Aug 2020 18:17:32 +0300

> From: Stefan Kangas <stefan@marxist.se>
> Date: Mon, 31 Aug 2020 14:46:31 +0000
> Cc: emacs-devel@gnu.org
> Eli Zaretskii <eliz@gnu.org> writes:
> > The display engine calls the function which produces the frame's title
> > very frequently.  You have just made redisplay much slower due to this
> > call (abbreviate-file-name is a large and complex function, and you
> > call Lisp on top of that), and caused most redisplay cycles prfoduce
> > more garbage.  Is it really worth it?
> Thanks, I didn't know it was called very frequently.  I think it's most
> definitely not worth slowing down redisplay.  We should probably replace
> it with the "%b" we had before.

We could display the base name of buffer-file-name, if we wanted,
producing that in C.  But %b already does most of that.

> BTW, I assume this caveat applies in equal measure to using `:eval' in
> `frame-title-format'?

Yes, it should be avoided.

> Do they apply also to `icon-title-format' and `mode-line-format'?

When Emacs is iconified, it bypasses redisplay, so icon-title-format
is mostly off the hook.  mode-line-format is indeed slowed down by
:eval and the likes, but there's a crucial difference: the mode line
is drawn by Emacs, and we have tricks up our sleeve to avoid redrawing
those parts that were not changed.  By contrast, the frame's title is
drawn by the window-manager, and we have no control on how it does
that, so we always provide it with the full title, even if some parts
of it haven't changed (and, for example, the "GNU Emacs" part never

> If yes, should we warn users about it in (info "(elisp) Mode Line
> Data") or (info "(elisp) Frame Titles")?

I doubt this is efficient: people who want fancy decorations will do
it regardless, and explaining why it's a bad idea is not easy, because
it requires a detailed description of how redisplay works.

reply via email to

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