From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: Operation of format-mode-line Date: Sun, 28 Jul 2024 17:30:59 +0200 Message-ID: <87y15ljzyk.fsf@ledu-giraud.fr> References: <_01tHilZxepAwWZA2gcrpDUtHoVEW2HZsloVV432KbtYCSGgtnpgjju0nPyLvUaoqaVld3sid3SAWzx3IZM6BOYkN59GQEl81KFPoVUlszI=@protonmail.com> <87ed7f28wy.fsf@web.de> <86frrv2x29.fsf@gnu.org> <8734nv11lh.fsf@web.de> <8cfYmJRUfGW8uFnXYZfI_vL7FrTRVG8bLy4Hs7E1gwea6ehe_92Rr2ktAaTRLA-0NEJEcvUals83-xSVjgBQ5Fva41WuyN3HTRM50NjYnfg=@protonmail.com> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="816"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Michael Heerdegen , help-gnu-emacs@gnu.org To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 28 17:31:36 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 1sY5s0-000AbP-CZ for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 28 Jul 2024 17:31:36 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sY5ra-0002eD-GL; Sun, 28 Jul 2024 11:31:10 -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 1sY5rZ-0002de-CO for help-gnu-emacs@gnu.org; Sun, 28 Jul 2024 11:31:09 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sY5rU-0006Ln-Ra for help-gnu-emacs@gnu.org; Sun, 28 Jul 2024 11:31:09 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=wqJ1JeMm cMFK/SOC5VJMp8gjtzi2PWKnfT/yXTcAO0c=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=LGlu6/ZCfFkQkwGEyWJm488jYr2GGP fhoBu0dQqL+ji8bCFGtg0RQez7Qiu8SW2OP2d+Vv0wY5lM08qlI1r9CA== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=wqJ1JeMmcMFK/SOC 5VJMp8gjtzi2PWKnfT/yXTcAO0c=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=DzZoqpXW+hCzie0ooPhtk4E0kL/xs8AhMCTo6B nY+t1Ozdm7N8E+8Fha1w+8j0OChbjFaoSnPMHbRDA3IPryS0yCyLao6uyFII4vXxIFonOY wGDfG5y2FxwY3TA9DFgMwjE8hjUz0m8P9jSr+kldaf5C2P6uZt1wyVlmwsnRt57Yklsvwt aVlzh6aETdeVC4aJgd+QridSvwttmjQBWiM3GI/8wz+MV7+2I8CFQ6FInCz85YzGdnF0qh dxAeF0DvxptlNKWZBwkTqcAFqinRiPIqGlHSEWHztaVRjfAuN/+IWd+KNNePJUxRib71IG Htk6Cw7meYdps5UHbYgzTGBw== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 03fc31b9 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 28 Jul 2024 17:31:00 +0200 (CEST) In-Reply-To: <8cfYmJRUfGW8uFnXYZfI_vL7FrTRVG8bLy4Hs7E1gwea6ehe_92Rr2ktAaTRLA-0NEJEcvUals83-xSVjgBQ5Fva41WuyN3HTRM50NjYnfg=@protonmail.com> (Heime's message of "Sun, 28 Jul 2024 11:00:44 +0000") Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; helo=ledu-giraud.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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:147414 Archived-At: Heime writes: [...] > Nothing suggested actually solves the problem. So there must get some > fixes to allow the possibilities people think should happen. Hi, I'm replying here because a debbugs is not the place. You were almost there with this piece of code: --8<---------------cut here---------------start------------->8--- (defun vodil-tkbfn-ellipses (wmax) "Get the buffer name truncated to WMAX width with ellipsis." (let* ( (bfname (buffer-name (window-buffer))) (tkname (if (> (length bfname) wmax) (truncate-string-to-width bfname wmax nil nil "...") bfname))) (propertized-buffer-identification (format " %s " tkname)))) (defun vodil-tkbfn (wmax) "Set mode-line-buffer-identification with WMAX maximum width." (setq-default mode-line-buffer-identification '(:eval (vodil-tkbfn-ellipses wmax)))) --8<---------------cut here---------------end--------------->8--- ... but you have an error in your last line. What do you get when you do 'M-: mode-line-buffer-identification'? -- Manuel Giraud