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: Sun, 28 Jul 2024 16:53:35 +0000 Message-ID: References: <_01tHilZxepAwWZA2gcrpDUtHoVEW2HZsloVV432KbtYCSGgtnpgjju0nPyLvUaoqaVld3sid3SAWzx3IZM6BOYkN59GQEl81KFPoVUlszI=@protonmail.com> <87ed7f28wy.fsf@web.de> <86frrv2x29.fsf@gnu.org> <8734nv11lh.fsf@web.de> <8cfYmJRUfGW8uFnXYZfI_vL7FrTRVG8bLy4Hs7E1gwea6ehe_92Rr2ktAaTRLA-0NEJEcvUals83-xSVjgBQ5Fva41WuyN3HTRM50NjYnfg=@protonmail.com> <87y15ljzyk.fsf@ledu-giraud.fr> 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="6297"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Manuel Giraud , 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 18:54:19 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 1sY7A3-0001VQ-3n for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 28 Jul 2024 18:54:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sY79a-0001fr-16; Sun, 28 Jul 2024 12:53:50 -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 1sY79W-0001fb-Le for help-gnu-emacs@gnu.org; Sun, 28 Jul 2024 12:53:46 -0400 Original-Received: from mail-40137.protonmail.ch ([185.70.40.137]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sY79U-0005pz-8a for help-gnu-emacs@gnu.org; Sun, 28 Jul 2024 12:53:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1722185621; x=1722444821; bh=ad+FX3EtzSXo6rVQ02lPvZNzhEjLCZFGBe0Syin42wA=; 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=ZQg/uWTLzrtkanAvp3FLcopb5Y3df/AuBp0s4k4Q4Qmsg8HXVMSauGEQXigxRN0f+ /UVvO06lcb09kQSne0j3KQVeKZ0nONIF0eD+EsR+9oJM6yTigTDHcsrmYzcBkqY/x6 r8NpRcy9Y8/BEEXoaePjZDjYUJQOeq3ICBEy7rn0/ro/iJ29kOhEjuVUxA/Z5IoEY4 EMZVTLdNLYXykta3m5WUXyG+Z5jVXlPBH3gP5nrLMXS4iUmy4lpaYc1AzoGxFsdpqC VKRNZKPQpiSRYnaVa59p1vYQJ86zym3wIj9wO2VkB14+Zz84S2gvcJW/9mAEZtiuyH xGUrodZ08ZkNA== In-Reply-To: Feedback-ID: 57735886:user:proton X-Pm-Message-ID: 01af4ab94da3d70b66bd97beff6ed49e4653453f Received-SPF: pass client-ip=185.70.40.137; envelope-from=heimeborgia@protonmail.com; helo=mail-40137.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.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, TO_EQ_FM_DIRECT_MX=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:147416 Archived-At: Sent with Proton Mail secure email. On Monday, July 29th, 2024 at 4:14 AM, Heime w= rote: >=20 >=20 >=20 >=20 >=20 > Sent with Proton Mail secure email. >=20 >=20 > On Monday, July 29th, 2024 at 3:30 AM, Manuel Giraud via Users list for t= he GNU Emacs text editor help-gnu-emacs@gnu.org wrote: >=20 > > Heime heimeborgia@protonmail.com writes: > >=20 > > [...] > >=20 > > > Nothing suggested actually solves the problem. So there must get some > > > fixes to allow the possibilities people think should happen. > >=20 > > Hi, > >=20 > > I'm replying here because a debbugs is not the place. > >=20 > > You were almost there with this piece of code: > > --8<---------------cut here---------------start------------->8--- > >=20 > > (defun vodil-tkbfn-ellipses (wmax) > > "Get the buffer name truncated to WMAX width with ellipsis." > >=20 > > (let* ( (bfname (buffer-name (window-buffer))) > > (tkname (if (> (length bfname) wmax) > >=20 > > (truncate-string-to-width bfname wmax nil nil "...") > > bfname))) > > (propertized-buffer-identification (format " %s " tkname)))) > >=20 > > (defun vodil-tkbfn (wmax) > > "Set mode-line-buffer-identification with WMAX maximum width." > >=20 > > (setq-default mode-line-buffer-identification > > '(:eval (vodil-tkbfn-ellipses wmax)))) > > --8<---------------cut here---------------end--------------->8--- > >=20 > > ... but you have an error in your last line. What do you get when you > > do 'M-: mode-line-buffer-identification'? > > -- > > Manuel Giraud I got this=20 Error during redisplay:=20 (eval (prevodilac-tkbfn-ellipses wmax)) signaled (void-variable wmax) [77 t= imes] =20 I do (vodil-tkbfn 8) after the function declaration =20 (defun vodil-tkbfn (wmax) (setq-default mode-line-buffer-identification '(:eval (vodil-tkbfn-ellipses wmax)))) =20 (vodil-tkbfn 8) =20 (setq-default mode-line-format '( "%e" (:eval (if vodil-deploy-bfname vodil-panelit-bfname mode-line-buffer-identification))))