From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: backquote upon variable for :eval Date: Sun, 28 Jul 2024 23:04:40 +0200 Message-ID: References: <87wml5i7sn.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="5637"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Manuel Giraud , Heime via Users list for the GNU Emacs text editor To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 28 23:05:43 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 1sYB5L-0001N0-Pv for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 28 Jul 2024 23:05:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sYB4a-000874-LI; Sun, 28 Jul 2024 17:04:56 -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 1sYB4Y-00086o-1z for help-gnu-emacs@gnu.org; Sun, 28 Jul 2024 17:04:54 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sYB4Q-00052t-TG for help-gnu-emacs@gnu.org; Sun, 28 Jul 2024 17:04:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.com; s=s31663417; t=1722200680; x=1722805480; i=dimech@gmx.com; bh=QRNr5IHtufoH89RNnZY+lL5poDlUQVnpJ39/+GSVX+0=; h=X-UI-Sender-Class:MIME-Version:Message-ID:From:To:Cc:Subject: Content-Type:Date:In-Reply-To:References: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=PXPSlI1DKpGWVRO6Lm2bXbbb6ntZXXRj4FmZWz4Yh5ffKQ5HyTDxy/G3YxZBy3cc i9qUkv3dNCmSBd3ohe2Q6itNuPqJufI5MUOl1TU2KLjBhAngKTiYlBJNbYS3Y/tc4 kKwd7V9LZMZEBH9UvmlBOK8ZZfAf5agcyO9dAcVtaA2F296lOXnkl2NVKul4GSCnw WnjdRIodo+ZrO/l4egS0U8uqohtWn3UGF/ieY/M8A1IpYxE9nXUc0gRg7qQqtgSQ3 pTjmTPElYtAMpLP6U54KMOnijG9e/jIidfaUWQr3gPe0Hg8jrdtYaj2BAiGVdYF7x lFPgdWVTCedFHxytYQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [92.251.79.197] ([92.251.79.197]) by web-mail.gmx.net (3c-app-mailcom-bs05.server.lan [172.19.170.173]) (via HTTP); Sun, 28 Jul 2024 23:04:40 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:gw3lqUcaMrb3Xxbyq86JKZaxkQUsArPcolZXrLctknY5JsOsNT19NXP0bY+1Jf7tQfYCR HmvCS6/SoA/TXA0KD4r6aCUShyqFOeDL0+b7+3beKS6wZsXtdOQxTrVdrSuRPdXo64hr4BpxfuZ+ 4RAAENuNWi3AizZHzV6vR3iRW4xYaFOvZM/d66s4BOoPN6HZNTn6IJPBsuL/N6QEmhfTzLMpIqtx GZTT5YzoM09/OMaElqbL/yoeggO/LeY+lff/GVRVbqjfdfUiBFlUpzvtexqak5vdBBqJ3wj2tJl0 UA= UI-OutboundReport: notjunk:1;M01:P0:R7BenAcZUlc=;zvsLhm+B2ZGpJ8sr4C/iQIdPfAL flDiExJ8vCAWU5Pw4RKfDbUpOjfCd1fg5zTwg7RtxbaorrnthwzWAlEd5dqTE8bI/6W6ktw32 P2aMxjBuf4w0W7gOY3xquT+HEPlYyp8li3lUfabbjtfrmWolMDy5Or8Uvgbv9AMVNeuV8pR2N NRHakU9EQ96kFOOZomok1oDa6iaz8nPWXN9aMFjfuO0uWu4YuXDMvws1M2BF4a2C/bRK5cemx ShQM/o/zfrfWon+CSglcpaHCTXGZPfT9yIXhJS+C/zviko1ybmNq6U1yXiTGzcGAfRuLcfem2 znfhAautALkGCqDzx+7tSYgvVml9Qgx75mkjX8P2Nxnlb9A2VUxMLRGKZpXDbTlWR0Ssgejgw h7xJfGh1ch/xqYB5kwG0wx6BPY3z7gie3y27IfnUdLmPcLvwxz9zijg+KTM3cDPfDxbUEAYsL OtFwAXMo5gjyZscD65Oiu2Ga39A7fHgEHiCVtc7WJv/GApXXEH+PCMiRS2/S+6qG+Jt1HlK3k FqPOaUpZuGMkbqaGdti4AmPR7KB2baIWW3LLkTJPYnMSK1ocsEmmq+jt/4CsgEcIA0I+mB3sk P1xNIVgpxn6EsqRHuWryFf4ciyqdp+wnn7MCqNwUQw/WzDmyopRDupIwhfjm8sCcAmM9E8MWP mteo9wRfzt1l6R1TZMi+9Pd/EfYVOyUxNsNamz4q+g== Received-SPF: pass client-ip=212.227.15.18; envelope-from=dimech@gmx.com; helo=mout.gmx.net 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 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:147427 Archived-At: > Sent: Monday, July 29, 2024 at 8:44 AM > From: "Heime" > To: "Manuel Giraud" > Cc: "Heime via Users list for the GNU Emacs text editor" > Subject: Re: backquote upon variable for :eval > > > > > > > Sent with Proton Mail secure email. > > On Monday, July 29th, 2024 at 8:24 AM, Manuel Giraud via Users list for = the GNU Emacs text editor wrote: > > > Heime heimeborgia@protonmail.com writes: > > > > > I am using the backquote, but I get errors when using ,tknm > > > > > > How can this be fixed ? Perhaps I got to arrange the code in a > > > different way ? > > > > > > Yes I think that you should re-arrange and re-read "(elisp) Backquote" > > and maybe "(elisp) Evaluation" too. > > > > [...] > > > > > (defun vodil-bfnap (wmax &optional actn) > > > > > > (setq-default mode-line-buffer-identification > > > `(:eval > > > (let* ( (bfnm (buffer-name (window-buffer))) > > > (tknm (if (> (length bfnm) wmax) > > > (vodil-ellipses bfnm wmax actn) > > > bfnm)) ) > > > (propertized-buffer-identification (format " %s " ,tknm)))))) > > > > > > What could contain an evaluation of tknm here? > > -- > > Manuel Giraud > > Have done this, but although it works, the buffer name is always *scratc= h* > > (defun vodil-bfnap (wmax &optional actm) > > (let* ( (bfnm (buffer-name (window-buffer))) > (tknm (if (> (length bfnm) wmax) > (vodil-ellipses bfnm wmax actm) > bfnm))) > (setq-default mode-line-buffer-identification > `(:eval (propertized-buffer-identification (format " %s " ,tknm))= )))) In your function, the values of wmax and actm need to be evaluated because= they are external variables passed as arguments. The other variables (bfnm and tkn= m) are local to the let* block and do not require special handling with the backquote-c= omma syntax for evaluation. (defun vodil-bfnap (wmax &optional actn) (setq-default mode-line-buffer-identification `(:eval (let* ( (bfnm (buffer-name (window-buffer))) (tknm (if (> (length bfnm) ,wmax) (vodil-ellipses bfnm ,wmax ,actn) bfnm)) ) (propertized-buffer-identification (format " %s " tknm))))))