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: Wed, 24 Jul 2024 16:45:14 +0000 Message-ID: References: <86plr36kbb.fsf@gnu.org> <86msm76jl1.fsf@gnu.org> <86jzha7wli.fsf@gnu.org> <86a5i67no6.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="35226"; 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 Wed Jul 24 18:45:59 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 1sWf7m-0008xL-P6 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 24 Jul 2024 18:45:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWf7M-0007Dh-LT; Wed, 24 Jul 2024 12:45:32 -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 1sWf7J-0007DF-VA for help-gnu-emacs@gnu.org; Wed, 24 Jul 2024 12:45:30 -0400 Original-Received: from mail-43167.protonmail.ch ([185.70.43.167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWf7H-0007t3-BR; Wed, 24 Jul 2024 12:45:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1721839523; x=1722098723; bh=3Ee8X1+M02c2m7P2QKuIrRCQGC0y8UENrsi2GpTqb5c=; 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=yXZ4J7OI7qVCogV35AQ9uFQW+DiM/uqMm4+eRcKkda/oblryumu36L3qWuzsW+vhk E4RNX+VQLRFHukbF+/xYY8kqZlmSX9KW1dlV8xYkprYlrmij1uCBeQJBDSLGHOdHDx XV/gpyg/K5vVejWNUMAg7hl+++VjfujRMEk44t1ig0OQBLBLTABI9hf32lmQHSVxp9 SA7ZdbKLEH19RzQYn0UYRic+FnnfKl9Y/URZbE/zRbyV++ecXzvAhn8QhlbsbwrFa2 iAEopjp6jQIFSdgbQoXP+GBMAGe8CZqGeToi7/ShTgjMfRj7bgu1ZMQz5a2vxxcbs6 n7TRL9iiYCnsg== In-Reply-To: <86a5i67no6.fsf@gnu.org> Feedback-ID: 57735886:user:proton X-Pm-Message-ID: 9329f68f9d387a62739d8462bff3e83f01022cbc Received-SPF: pass client-ip=185.70.43.167; envelope-from=heimeborgia@protonmail.com; helo=mail-43167.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:147349 Archived-At: On Thursday, July 25th, 2024 at 4:35 AM, Eli Zaretskii wrote= : > > Date: Wed, 24 Jul 2024 15:40:01 +0000 > > From: Heime heimeborgia@protonmail.com > > Cc: help-gnu-emacs@gnu.org > >=20 > > > mode-line-format is a variable, so you can use setq to modify its > > > value. Or you could modify just the value of > > > mode-line-buffer-identification, another variable (which is used to > > > construct the value of mode-line-format), which is where "%12b" comes > > > from. > > >=20 > > > More generally, take a look at lisp/bindings.el, where all the parts > > > of mode-line-format are defined and then used to produce the final > > > value of that variable. > >=20 > > If I change mode-line-buffer-identification, would I not loose the text > > properties and the local-map for the mouse action ? Somehow I have to p= ut > > those back. >=20 >=20 > If you only change the "12" part of the value of that variable, and > leave the rest (in particular, the 'propertize' part) intact, the > properties will still be the same. Like this ? (let ((current-value (symbol-value 'mode-line-buffer-identification))) (when (and (listp current-value) (stringp (car current-value)) ) (let ((new-value (replace-regexp-in-string "%12b" "%20b" (car current-= value)))) (setcar current-value new-value) (setq mode-line-buffer-identification current-value))))