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.devel Subject: Re: Modernize frame-title-format: "%b - GNU Emacs" Date: Mon, 31 Aug 2020 18:17:32 +0300 Message-ID: <83r1rmx2sz.fsf@gnu.org> References: <83y2lux5hm.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32424"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Aug 31 17:18:18 2020 Return-path: Envelope-to: ged-emacs-devel@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 1kClZa-0008Jj-EL for ged-emacs-devel@m.gmane-mx.org; Mon, 31 Aug 2020 17:18:18 +0200 Original-Received: from localhost ([::1]:51512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kClZZ-0001b9-8K for ged-emacs-devel@m.gmane-mx.org; Mon, 31 Aug 2020 11:18:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kClZ4-0001CG-KA for emacs-devel@gnu.org; Mon, 31 Aug 2020 11:17:46 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57686) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kClZ4-0007FM-2N; Mon, 31 Aug 2020 11:17:46 -0400 Original-Received: from [176.228.60.248] (port=2525 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kClZ3-0006i4-Hx; Mon, 31 Aug 2020 11:17:45 -0400 In-Reply-To: (message from Stefan Kangas on Mon, 31 Aug 2020 14:46:31 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:254445 Archived-At: > From: Stefan Kangas > Date: Mon, 31 Aug 2020 14:46:31 +0000 > Cc: emacs-devel@gnu.org > > Eli Zaretskii 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 will). > 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.