From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72309: propertized-buffer-identification with maximum width Date: Sun, 28 Jul 2024 15:29:21 +0300 Message-ID: <861q3d1yzi.fsf@gnu.org> 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31593"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72309@debbugs.gnu.org To: Heime Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 28 14:32:15 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 1sY34Q-000854-Ak for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Jul 2024 14:32:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sY349-0005Tl-C0; Sun, 28 Jul 2024 08:31:57 -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 1sY347-0005TN-If for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2024 08:31:55 -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 1sY343-0008Ur-2d for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2024 08:31:52 -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=ZaoUM7ScGm2xDBcExQHxu7Hocigi9p8K+8OJSGjcnFY=; b=CmEfe11mbgipGwEKiPMKiLEJO3f6fiEtKyFPrTJdd40auDgcrLkQgi89ZVEqU+ecCPABJm4hSOPnPkdPi4FGEhvsybcAUSwiCZLKzpUs+opmH2vb8PLqEgDJ+6R/pzS66SvkjmlV0B/QNhMMa0iMY7TFMzMty2kSPOSA9eWybO4mjGJTTC0Ih6UIeRKcP06eMg5B1Ad193A9F5aVu3p6qGwdZmSHserrCju1X8dWKRw6d5bVCJKlyfnlbOFf7Vhhr6+k5KRJCbDlPMiuHiVnVbfBgZKdU/TV7jYm3XCZhaSmxjOAaennK4H/+z0MopjaafNQuInh3lhwQAlZf56jYA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sY34E-0007Q6-Bv for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2024 08:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Jul 2024 12:32:02 +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.172216991228504 (code B ref 72309); Sun, 28 Jul 2024 12:32:02 +0000 Original-Received: (at 72309) by debbugs.gnu.org; 28 Jul 2024 12:31:52 +0000 Original-Received: from localhost ([127.0.0.1]:42809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sY343-0007Pg-Vv for submit@debbugs.gnu.org; Sun, 28 Jul 2024 08:31:52 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sY342-0007PT-T3 for 72309@debbugs.gnu.org; Sun, 28 Jul 2024 08:31:51 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sY31g-0007wC-Jt; Sun, 28 Jul 2024 08:29:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:Subject:In-Reply-To:To:From: Date; bh=ZaoUM7ScGm2xDBcExQHxu7Hocigi9p8K+8OJSGjcnFY=; b=ZJrLrHW223uJhqT/YtPQ Z2CVlxe4m6nkhwQoTunDm4yx9M9aFthMplTEYS3IZBRAZct/KGMqMI+d6PFyqFLE5SON/rqiUg0wu boZKXlmjxQNcfnYnYqA/p5K75sAmI4wM7y3+1vcQHFD6aa3cSBlWCP27ixJUavfJXKt185KSBciww jrg7HiXglWXJ0jELWnZeWux4jfvrE3ud5+iLwUoezSqgISRGb1CpJq/fbX9iO7YrsJWsT0RMliCf1 JNqyvA6RJjT37TWIEuvbVSbZnLtCfY2yYxgwmwBVEXWbsdnxqJRr03Mu/L9eBWCbBcEs0i0fJ2JiO LhE8MFzK9zA8qQ==; In-Reply-To: (message from Heime on Sun, 28 Jul 2024 12:18:32 +0000) 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:289468 Archived-At: > Date: Sun, 28 Jul 2024 12:18:32 +0000 > From: Heime > Cc: Eli Zaretskii , 72309@debbugs.gnu.org > > > > > What is the big problem of showing how to implement this, buffer name > > > > with truncation ellipses using mode-line-buffer-identification ? > > > > > > 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. > > > > > > 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. > > The implementations do not work. > > For instance, using > > (name (buffer-name)) > > or with > > (buffer-name (window-buffer)) > > See > > (setq-default mode-line-buffer-identification > (propertized-buffer-identification > (format " %s " > (let ( (name (buffer-name)) ) > (if (> (length name) wmax) > (concat (substring name 0 (- wmax 3)) "...") > name))))) ) > > And neither does this > > (let* ( (bfname (buffer-name (window-buffer))) > (tkname (if (> (length bfname) wmax) > (truncate-string-to-width bfname wmax nil nil "...") > bfname))) > (propertized-buffer-identification (format " %s " tkname)))) > > So there is no option other than using %b, where one has no control about > how it gets displayed. Your conclusions are wrong.