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: Sat, 27 Jul 2024 16:00:39 +0300 Message-ID: <86plqz0z2g.fsf@gnu.org> References: <8eYtcka1bg4aOfbQVrzRShsG1EtNIu1JLO9XlRoQXZ4Q7yqojew5kxXcml4s-JdvwA7hgEdo_0-YEQf0zknb2wq9aS_-rgwEZB0ZT9y6QWM=@protonmail.com> <86jzh72xml.fsf@gnu.org> <86v80r11mk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2329"; 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 Sat Jul 27 15:02:18 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 1sXh3x-0000Rd-Ra for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Jul 2024 15:02:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sXh3c-000627-0M; Sat, 27 Jul 2024 09:01: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 1sXh3Z-00061E-Pm for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2024 09:01:54 -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 1sXh3Y-0008My-1C for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2024 09:01:53 -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=31XkeIfKjR+ZvQN2e8UvmrtaFRVS38glZByFs3zMFvo=; b=UyBmKSNNoTw2mPpLDWq1sQsPLIovlhpW24OF7goaF+3rGcK/uLzhU3RYTL3aN4ka9SluS56hcbdx9o6EpER35vlU2/kYXgePGS57AmrxsWDA8KnoBQymjqfztJ5OMjCt0x5Yew3dcbWU6/zxQj7jgEOHhWsDIuw7soqEpADAY8xabVrnnsGCHn/qs5Qt/OgUelwc5Kc1ovYLYdHC1iCFaHQ/p/4QqRoLDoqOJvYho8JbcpdEWrhNvnVtY38bnSUbINJBIQDuASo/+vkzdS1DF0EqWNHeUr4sbAFc7l8SYc12/i21pKO1MY8AAd7Ju09CBS9TonzotIXROdHQAEb26A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sXh3h-0002xs-Ud for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2024 09:02:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Jul 2024 13:02: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.172208526411252 (code B ref 72309); Sat, 27 Jul 2024 13:02:01 +0000 Original-Received: (at 72309) by debbugs.gnu.org; 27 Jul 2024 13:01:04 +0000 Original-Received: from localhost ([127.0.0.1]:40934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXh2m-0002v9-8O for submit@debbugs.gnu.org; Sat, 27 Jul 2024 09:01:04 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXh2k-0002u1-9C for 72309@debbugs.gnu.org; Sat, 27 Jul 2024 09:01:03 -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 1sXh2U-0007ub-DQ; Sat, 27 Jul 2024 09:00:46 -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=31XkeIfKjR+ZvQN2e8UvmrtaFRVS38glZByFs3zMFvo=; b=QE0JZkh7qPw73PXEJRrU QT2hLmdLPRWNVlvn7RnNtnwQxtLKnTlodAyQK5lwkgPHRZpL5GDmpaCh9fFmHBGSA3VX+keN++YPe +bUwynQYGoOPFsPE2YlmFcQbKvmj3vhqlcscHe2TI5Bp2RXaCJNfJHUgv2r0BU7jIpD/0lMToFwQt e+oHDb0/qvgYqf9DTrgQHW/k8AIGwLqLsM8pjSCmL+wbDsPzoxfeJxOK61cHoeVM1QbUW+N/AnHQF C7UQYEfJ12llGQgHkoqdZ64nnaVaOLsj8dTkvY0jsmq742rAvESbwpDDAAciNwek+PZkFSdfRAtlF jzb19uCXrc0Wlg==; In-Reply-To: (message from Heime on Sat, 27 Jul 2024 12:23:20 +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:289428 Archived-At: > Date: Sat, 27 Jul 2024 12:23:20 +0000 > From: Heime > Cc: 72309@debbugs.gnu.org > > > > > > > Sent with Proton Mail secure email. > > On Sunday, July 28th, 2024 at 12:05 AM, Eli Zaretskii wrote: > > > > Date: Sat, 27 Jul 2024 09:22:21 +0000 > > > From: Heime heimeborgia@protonmail.com > > > Cc: 72309@debbugs.gnu.org > > > > > > On Saturday, July 27th, 2024 at 5:48 PM, Eli Zaretskii eliz@gnu.org wrote: > > > > > > > tags 72309 notabug > > > > thanks > > > > > > > > > Date: Fri, 26 Jul 2024 19:04:14 +0000 > > > > > From: Heime via "Bug reports for GNU Emacs, > > > > > the Swiss army knife of text editors" bug-gnu-emacs@gnu.org > > > > > > > > > > propertized-buffer-identification could be improved so that when using a > > > > > maximum width there are three dots and a space at the end to indicate > > > > > that the buffer name has been truncated. > > > > > > > > Emacs doesn't truncate the buffer name shown on the mode line, so no > > > > ellipsis should be needed, ever. IOW, the maximum width is basically > > > > infinity. > > > > > > > > Where did you see the buffer name truncated on the mode line? > > > > > > There is this construct > > > > > > (width rest…) > > > > > > which specifies truncation or padding of the results of rest. > > > > > > If used on the buffer name it just truncates without specification > > > that truncation occurred. > > > > > > Where in the Emacs code did you see that? I cannot find anything like > > that in bindings.el, which is where we have the code used for > > displaying the buffer name on the mode line. > > The last entry in "24.4.2 The Data Structure of the Mode Line". > > I have tried it and setting a maximum width does work and the abrupt > truncation in the buffer name does occur. Yes, but the (WIDTH something) construct is not for truncating long names, it's for ensuring the string produced by "something" doesn't take too many columns. So you are using this for a wrong purpose. 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.