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: Thu, 25 Jul 2024 13:20:54 +0000 Message-ID: References: <86jzha7wli.fsf@gnu.org> <86jzha5494.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="22569"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , help-gnu-emacs@gnu.org To: Yuri Khan Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 25 15:21: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 1sWyPf-0005d4-Hp for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 25 Jul 2024 15:21:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWyP3-0003Rg-Hx; Thu, 25 Jul 2024 09:21:05 -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 1sWyP1-0003RE-Nj for help-gnu-emacs@gnu.org; Thu, 25 Jul 2024 09:21:03 -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 1sWyOz-0006y9-4E for help-gnu-emacs@gnu.org; Thu, 25 Jul 2024 09:21:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1721913658; x=1722172858; bh=tb130YnO0hs0XIa8TtGeE0OvEz656i8p75tbFsWrHww=; 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=Kx603Y1hyK2Nmk07/+wM6IemNoXfa367p+qILDcu7eLkQMWDPRE5LHIzClwf7vZ+4 dAYfkuzSf5+ujQ5rqmZxoy+Gb2zYGqMonPRNOjysvMVB8u7knOoRg8M5IaI60xqpCI EGqLODvnIfNw17QNEMUIn8bMOuZHMnT2+8EjGCb97PfBYf2GisvnEw11ASGoVOLBi8 LdFGpdqe9q2W2NtOU8SkjNeoxWmSSe0c1z98djfhkJ91q372GU/3s5DNHvAS9AecbU 6saupK8mDxsP4HmY8P+3dcjm/zT9e61nigkG8t/OuVm5axYBu3BKnQA8rVjjA4epJg jmpvHTePuxshw== In-Reply-To: Feedback-ID: 57735886:user:proton X-Pm-Message-ID: 5c0d1d54b4b0a99cc30f740119f18a1817f7a52e 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=unavailable 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:147367 Archived-At: Sent with Proton Mail secure email. On Friday, July 26th, 2024 at 12:50 AM, Yuri Khan w= rote: > On Thu, 25 Jul 2024 at 19:39, Heime heimeborgia@protonmail.com wrote: >=20 > > > The text properties are all generated by > > > propertized-buffer-identification, so if you leave that intact and > > > only change "%12b" to "%20b", all the rest should be as it was before= . > >=20 > > You really need to assist me with the code. Have been working on modify= ing > > the width as seen in vodil-width. > >=20 > > (defun vodil-width (new-width) > > "Update the width of the buffer name in the mode line to NEW-WIDTH." > >=20 > > (let* ( (current-format > > (format-mode-line mode-line-buffer-identification)) > > (new-format > > (replace-regexp-in-string "%[0-9]+b" > > (format "%%%db" new-width) current-format))) > >=20 > > (setq mode-line-buffer-identification new-format))) >=20 >=20 > You are making it much more difficult for yourself. Just put the > following into your init file: >=20 > (setq mode-line-buffer-identification > (propertized-buffer-identification "%20b")) >=20 > If you insist on having a function that accepts the new width as a number= : >=20 > (defun my-set-mode-line-buffer-identification-width (new-width) > (setq mode-line-buffer-identification > (propertized-buffer-identification > (format "%%%db" new-width)))) >=20 > =E2=80=A6but you really should not need this unless you are frequently > switching between very large and very small monitors. I understand. propertized-buffer-identification has hardwired keymap etc and calling it only sets the format used for the buffer identification =20 name. =20 Correct, at work I have very large screen, but very small laptops otherwise= .