From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#72309: propertized-buffer-identification with maximum width Date: Sun, 28 Jul 2024 10:55:31 +0000 Message-ID: References: <8eYtcka1bg4aOfbQVrzRShsG1EtNIu1JLO9XlRoQXZ4Q7yqojew5kxXcml4s-JdvwA7hgEdo_0-YEQf0zknb2wq9aS_-rgwEZB0ZT9y6QWM=@protonmail.com> <86plqz0z2g.fsf@gnu.org> <4NGOfJklhGgHco35Z3hgQLAbDA27v3FQW-VrjVbIMZ19Giduj_FYccq70KrUy7HlB2FgttLYBhiUJHL32RFS73-Ex6XnFwoaQqpdfQcn7_8=@protonmail.com> <86o76j0xps.fsf@gnu.org> <86bk2i15f4.fsf@gnu.org> Reply-To: Heime 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="1097"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72309@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 28 12:56:16 2024 Return-path: Envelope-to: geb-bug-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 1sY1ZY-00006q-5o for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Jul 2024 12:56:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sY1ZB-0005dC-6f; Sun, 28 Jul 2024 06:55:53 -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 1sY1Z9-0005d0-Bw for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2024 06:55:51 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sY1Z9-0007rw-1c for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2024 06:55:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:From:Date:To:Subject; bh=+jR1yhh00m4F0Wp68+Z3XE8jmfXXYeTWj2DB4mmDWx0=; b=Q+BRByn+j/4BJnrRjl7koH9wkDowQnXkwAF7PCVahmaRup3RWc0umFL8vJUWxsWNhySg/sBF1B86Wk4+RrZhhG/QSxd+BXLNCaqX1vNX7vpRhOiPIuo27UOCzIlbTLNGC2yZzRAfb7cbx6GBeT5GU4I2s0mkEcvp9RlXapY0oZ2jbfVVnoic8knuHvikvf36w4B6rfZcAStv4qhQ4JN4mbJpGf9EJfUNpzo8uSepV4Zc4FY+CEpK6ik9CA2URaEg71NkGdzoJvNNjuEB7HCQreWz5/RMQSBJSvAryWT77/nkIP1LMWajU0r2bSPA9jI89M3zi1IluoMtJTCH52aOSQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sY1ZJ-0004zI-Va for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2024 06:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Heime Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Jul 2024 10:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72309 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 72309-submit@debbugs.gnu.org id=B72309.172216415819160 (code B ref 72309); Sun, 28 Jul 2024 10:56:01 +0000 Original-Received: (at 72309) by debbugs.gnu.org; 28 Jul 2024 10:55:58 +0000 Original-Received: from localhost ([127.0.0.1]:42731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sY1ZF-0004yx-P9 for submit@debbugs.gnu.org; Sun, 28 Jul 2024 06:55:58 -0400 Original-Received: from mail-4319.protonmail.ch ([185.70.43.19]:60461) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sY1ZB-0004yg-UM for 72309@debbugs.gnu.org; Sun, 28 Jul 2024 06:55:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1722164136; x=1722423336; bh=+jR1yhh00m4F0Wp68+Z3XE8jmfXXYeTWj2DB4mmDWx0=; 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=MXZfZB8PvlTX/UIq9m6BW5xLOMjivy4Ywp96+tbv/n4ZJJUzUSLYZ+oNImxktZbEn RFWSqJyfbo+lF/+gOONgDlotdHzpX3EmagrJ14I/2LnARUZRvC+G97mr5hvSw+vd41 +zuhKZKFAWKokZK4OPSc0zKc1ulI17XGZe2mUqNxwPlZ79eY+BKEUeD1X69+So50Rw niFNH13sg4qSqhP+Uowo6NNtyqlS4szdQ3XehnVJLGzUbh+5qqIFua0eX8WcCnnSIC XxJOgqw9On5FsedaqInplvembFw4oBAlQCMbtHcbxUzx433DKFXT+F1u9QXZaM6e1r Swtvr0IfCkjWg== In-Reply-To: <86bk2i15f4.fsf@gnu.org> Feedback-ID: 57735886:user:proton X-Pm-Message-ID: da0e9ae16dc68cfb331414ca921f18136e1ecc62 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289461 Archived-At: Sent with Proton Mail secure email. On Sunday, July 28th, 2024 at 4:55 PM, Eli Zaretskii wrote: > > Date: Sat, 27 Jul 2024 20:49:05 +0000 > > From: Heime heimeborgia@protonmail.com > > Cc: 72309@debbugs.gnu.org, Eli Zaretskii eliz@gnu.org > >=20 > > On Sunday, July 28th, 2024 at 3:27 AM, Heime via "Bug reports for GNU E= macs, the Swiss army knife of text editors" bug-gnu-emacs@gnu.org wrote: > >=20 > > > Sent with Proton Mail secure email. > > >=20 > > > On Sunday, July 28th, 2024 at 2:56 AM, Heime via "Bug reports for GNU= Emacs, the Swiss army knife of text editors" bug-gnu-emacs@gnu.org wrote: > > >=20 > > > > Sent with Proton Mail secure email. > > > >=20 > > > > On Sunday, July 28th, 2024 at 1:29 AM, Eli Zaretskii eliz@gnu.org w= rote: > > > >=20 > > > > > > Date: Sat, 27 Jul 2024 13:08:31 +0000 > > > > > > From: Heime heimeborgia@protonmail.com > > > > > > Cc: 72309@debbugs.gnu.org > > > > > >=20 > > > > > > On Sunday, July 28th, 2024 at 1:00 AM, Eli Zaretskii eliz@gnu.o= rg wrote: > > > > > >=20 > > > > > > > Yes, but the (WIDTH something) construct is not for truncatin= g long > > > > > > > names, it's for ensuring the string produced by "something" d= oesn't > > > > > > > take too many columns. So you are using this for a wrong purp= ose. If > > > > > > > you want to truncate a buffer's name, use truncate-string-to-= width > > > > > > > instead, which is also capable of showing the ellipsis at the= end. > > > > > >=20 > > > > > > I do not know how to access the buffer name and apply truncate-= string-to-width > > > > > > when setting mode-line-buffer-identification on propertized-buf= fer-identification. > > > > >=20 > > > > > Use :eval. > > > >=20 > > > > I have done it without success > > > >=20 > > > > (defun vodil-rtgbfn (wmin) > > > > (setq-default mode-line-buffer-identification > > > > (propertized-buffer-identification (format " %%%db " wmin)))) > > > >=20 > > > > (vodil-rtgbfn 8) > > > >=20 > > > > (setq-default mode-line-format > > > > '( "%e" (:eval (truncate-string-to-width mode-line-buffer-identific= ation 13)) > > > > vodil-panelit-bfselec)) > > >=20 > > > Have now done, but now the buffer name is not displayed. Why has ther= e > > > to be so much torture to change the defaults ! > > >=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)))) > >=20 > > What is the big problem of showing how to implement this, buffer name > > with truncation ellipses using mode-line-buffer-identification ? >=20 >=20 > We don't have people here whose job is to write code for others. This > is a volunteer-based project, where people help you with ideas, but > the actual job of writing and debugging the code is yours. >=20 > So please take the ideas, read the documentation, and work on the > implementation you want. If you have questions about the > implementation, please ask them on help-gnu-emacs, which is where > user-level help should be sought. Could there be a bug. I have tried the various ideas and suggestions and they did not work as others thought they would. One implementation that worked (using (width rest)) got a lot of gripe and was turned down. Se I am back to where I have started. =20 > > Can there be some additional commands to make this possibility less > > cumbersome. For instance, an option that gives mode-line-buffer-identif= ication > > with truncation ellipses. >=20 > No. And people with small screen, what do they do ? With all the minor modes d= isplaying in the modeline, it becomes unusable (meaning that its contents goes beyond= the window).