From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: Re: Operation of format-mode-line Date: Sat, 27 Jul 2024 11:08:49 +0000 Message-ID: References: <875xss2siz.fsf@web.de> <_01tHilZxepAwWZA2gcrpDUtHoVEW2HZsloVV432KbtYCSGgtnpgjju0nPyLvUaoqaVld3sid3SAWzx3IZM6BOYkN59GQEl81KFPoVUlszI=@protonmail.com> <87ed7f28wy.fsf@web.de> <86frrv2x29.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34703"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 27 13:10:01 2024 Return-path: Envelope-to: geh-help-gnu-emacs@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 1sXfJI-0008u7-Id for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 27 Jul 2024 13:10:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sXfIN-0002fj-Ew; Sat, 27 Jul 2024 07:09:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sXfIL-0002fa-NW for help-gnu-emacs@gnu.org; Sat, 27 Jul 2024 07:09:01 -0400 Original-Received: from mail-43166.protonmail.ch ([185.70.43.166]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sXfIK-0000mA-05; Sat, 27 Jul 2024 07:09:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1722078536; x=1722337736; bh=JcvmApmbAjG4/pBgbVcf8eKD+qRbjtxDrPyhKZrczyU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=MJTWIZD49oYUrRYntQWucQSKzFNtsU5lQ5eIKUMFCoF6IGwp9ROzgl/Ct0kaWgXSJ FTPE9CHA8kL0lTPWqhmsMI93ZDygk6BmgAp0Ini2USjfYlVsAlbE2loqCtliG0Rtc2 NKYICtOxsV126kjHH8QFaUnMSlIOCV/Pb97d0Z/PVP2r7UHMutZggeDjj3auB2OdTy tGavMQvmPFrXbloXV/GnXvNrN2ELrSD8/4rHumbGjbdLPEz6t8cgzUqOklL0J1uK77 kvd8r6Rr3rGobxETi3PvY3etm0cxpgkOrTjpOk0ShRxxIZRG5mtrwvVwt2wLszvXHQ OwaROE9eisoTw== In-Reply-To: <86frrv2x29.fsf@gnu.org> Feedback-ID: 57735886:user:proton X-Pm-Message-ID: aadc7436d0e7b02530c2b00e5cb7566b3f332e98 Received-SPF: pass client-ip=185.70.43.166; envelope-from=heimeborgia@protonmail.com; helo=mail-43166.protonmail.ch X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147394 Archived-At: On Saturday, July 27th, 2024 at 6:01 PM, Eli Zaretskii wrote= : > > Date: Fri, 26 Jul 2024 22:30:21 +0200 > > From: Michael Heerdegen via Users list for the GNU Emacs text editor he= lp-gnu-emacs@gnu.org > >=20 > > > (setq-default mode-line-buffer-identification > > > (propertized-buffer-identification > > > (format " %s " > > > (let ( (name (buffer-name)) ) > > > (if (> (length name) wmax) > > > (concat (substring name 0 (- wmax 3)) "...") > > > name))))) ) > >=20 > > This is expected: the display engine doesn't switch buffers when drawin= g > > mode-lines all the time. With other words: In the above context the > > return value of `buffer-name' does not always correspond to the buffer > > of the window whose mode-line gets computed. >=20 >=20 > IOW, instead of (buffer-name), one should probably use something like >=20 > (buffer-name (window-buffer)) With your replacement, the buffer name is still not getting updated, even t= hough the window gets updated with the correct buffer.