GNU bug report logs - #75495
[PATCH] ibuffer: New defcustom `ibuffer-human-readable-size'

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Sat, 11 Jan 2025 13:29:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75495 in the body.
You can then email your comments to 75495 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#75495; Package emacs. (Sat, 11 Jan 2025 13:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daniel Mendler <mail <at> daniel-mendler.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 11 Jan 2025 13:29:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] ibuffer: New defcustom `ibuffer-human-readable-size'
Date: Sat, 11 Jan 2025 14:28:07 +0100
[Message part 1 (text/plain, inline)]
Tags: patch

This patch adds the customization option `ibuffer-human-readable-size'.
If customized to t, buffer sizes in Ibuffer are shown in human readable
format.

[0001-ibuffer-New-defcustom-ibuffer-human-readable-size.patch (text/patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75495; Package emacs. (Sun, 12 Jan 2025 12:35:02 GMT) Full text and rfc822 format available.

Message #8 received at 75495 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: 75495 <at> debbugs.gnu.org
Subject: Re: bug#75495: [PATCH] ibuffer: New defcustom
 `ibuffer-human-readable-size'
Date: Sun, 12 Jan 2025 13:34:30 +0100
[Message part 1 (text/plain, inline)]
Daniel Mendler <mail <at> daniel-mendler.de> writes:

> This patch adds the customization option `ibuffer-human-readable-size'.
> If customized to t, buffer sizes in Ibuffer are shown in human readable
> format.

I have attached an improved version of the patch to this mail, where it
is ensured that the summarizer works for a left or right aligned size
column.

Daniel

[0001-ibuffer-New-defcustom-ibuffer-human-readable-size.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75495; Package emacs. (Sat, 18 Jan 2025 10:13:01 GMT) Full text and rfc822 format available.

Message #11 received at 75495 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Mendler <mail <at> daniel-mendler.de>
Cc: 75495 <at> debbugs.gnu.org
Subject: Re: bug#75495: [PATCH] ibuffer: New defcustom
 `ibuffer-human-readable-size'
Date: Sat, 18 Jan 2025 12:11:52 +0200
> Date: Sun, 12 Jan 2025 13:34:30 +0100
> From:  Daniel Mendler via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Daniel Mendler <mail <at> daniel-mendler.de> writes:
> 
> > This patch adds the customization option `ibuffer-human-readable-size'.
> > If customized to t, buffer sizes in Ibuffer are shown in human readable
> > format.
> 
> I have attached an improved version of the patch to this mail, where it
> is ensured that the summarizer works for a left or right aligned size
> column.

Thanks.

> +(defcustom ibuffer-human-readable-size nil
> +  "Show buffer sizes in human-readable format."
> +  :type 'boolean)

This needs a :version tag.

Also, I think the doc string should explain in more detail what we
mean by "human-readable format".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75495; Package emacs. (Sat, 18 Jan 2025 10:34:02 GMT) Full text and rfc822 format available.

Message #14 received at 75495 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 75495 <at> debbugs.gnu.org
Subject: Re: bug#75495: [PATCH] ibuffer: New defcustom
 `ibuffer-human-readable-size'
Date: Sat, 18 Jan 2025 11:33:30 +0100
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Sun, 12 Jan 2025 13:34:30 +0100
>> From:  Daniel Mendler via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>> 
>> Daniel Mendler <mail <at> daniel-mendler.de> writes:
>> 
>> > This patch adds the customization option `ibuffer-human-readable-size'.
>> > If customized to t, buffer sizes in Ibuffer are shown in human readable
>> > format.
>> 
>> I have attached an improved version of the patch to this mail, where it
>> is ensured that the summarizer works for a left or right aligned size
>> column.
>
> Thanks.
>
>> +(defcustom ibuffer-human-readable-size nil
>> +  "Show buffer sizes in human-readable format."
>> +  :type 'boolean)
>
> This needs a :version tag.
>
> Also, I think the doc string should explain in more detail what we
> mean by "human-readable format".

Thank you for the review. I have attached an updated patch to this mail.

Daniel

[0001-ibuffer-New-defcustom-ibuffer-human-readable-size.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75495; Package emacs. (Sun, 19 Jan 2025 12:27:02 GMT) Full text and rfc822 format available.

Message #17 received at 75495 <at> debbugs.gnu.org (full text, mbox):

From: Pengji Zhang <me <at> pengjiz.com>
To: 75495 <at> debbugs.gnu.org
Subject: Re: [PATCH] ibuffer: New defcustom `ibuffer-human-readable-size'
Date: Sun, 19 Jan 2025 20:25:58 +0800
Daniel Mendler <mail <at> daniel-mendler.de> writes:

>+             (or (get-text-property (1- (length s)) 'ibuffer-size s)
>+                 (get-text-property 0 'ibuffer-size s) 0))))

Should we consider centered column as well? I know it sounds unusual,
but for completeness I would like to support that as well.

Maybe we could skip the leading spaces:

      (get-text-property 0 'ibuffer-size (string-trim-left s " +"))

What do you think?

Pengji




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75495; Package emacs. (Sun, 19 Jan 2025 13:46:01 GMT) Full text and rfc822 format available.

Message #20 received at 75495 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: Pengji Zhang <me <at> pengjiz.com>
Cc: 75495 <at> debbugs.gnu.org
Subject: Re: bug#75495: [PATCH] ibuffer: New defcustom
 `ibuffer-human-readable-size'
Date: Sun, 19 Jan 2025 14:45:29 +0100
[Message part 1 (text/plain, inline)]
Pengji Zhang <me <at> pengjiz.com> writes:

> Daniel Mendler <mail <at> daniel-mendler.de> writes:
>
>>+             (or (get-text-property (1- (length s)) 'ibuffer-size s)
>>+                 (get-text-property 0 'ibuffer-size s) 0))))
>
> Should we consider centered column as well? I know it sounds unusual,
> but for completeness I would like to support that as well.
>
> Maybe we could skip the leading spaces:
>
>       (get-text-property 0 'ibuffer-size (string-trim-left s " +"))
>
> What do you think?

Yes, we should. I have attached the improved patch to this mail.

Daniel

[0001-ibuffer-New-defcustom-ibuffer-human-readable-size.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75495; Package emacs. (Mon, 20 Jan 2025 00:59:02 GMT) Full text and rfc822 format available.

Message #23 received at 75495 <at> debbugs.gnu.org (full text, mbox):

From: Pengji Zhang <me <at> pengjiz.com>
To: Daniel Mendler <mail <at> daniel-mendler.de>
Cc: 75495 <at> debbugs.gnu.org
Subject: Re: bug#75495: [PATCH] ibuffer: New defcustom
 `ibuffer-human-readable-size'
Date: Mon, 20 Jan 2025 08:57:47 +0800
Daniel Mendler <mail <at> daniel-mendler.de> writes:

> Yes, we should. I have attached the improved patch to this mail.

It works great. Thanks!

Pengji




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75495; Package emacs. (Sat, 25 Jan 2025 07:41:02 GMT) Full text and rfc822 format available.

Message #26 received at 75495 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: 75495 <at> debbugs.gnu.org
Cc: Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#75495: [PATCH] ibuffer: New defcustom
 `ibuffer-human-readable-size'
Date: Sat, 25 Jan 2025 08:40:46 +0100
Pengji Zhang <me <at> pengjiz.com> writes:

> Daniel Mendler <mail <at> daniel-mendler.de> writes:
>
>> Yes, we should. I have attached the improved patch to this mail.
>
> It works great. Thanks!

Hello Eli,

does this patch (and my other Ibuffer patch) look okay to you, such that
they can be installed? Thanks.

Daniel




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75495; Package emacs. (Sat, 25 Jan 2025 08:24:02 GMT) Full text and rfc822 format available.

Message #29 received at 75495 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Mendler <mail <at> daniel-mendler.de>
Cc: 75495 <at> debbugs.gnu.org
Subject: Re: bug#75495: [PATCH] ibuffer: New defcustom
 `ibuffer-human-readable-size'
Date: Sat, 25 Jan 2025 10:23:39 +0200
> From: Daniel Mendler <mail <at> daniel-mendler.de>
> Cc: Eli Zaretskii <eliz <at> gnu.org>
> Date: Sat, 25 Jan 2025 08:40:46 +0100
> 
> Pengji Zhang <me <at> pengjiz.com> writes:
> 
> > Daniel Mendler <mail <at> daniel-mendler.de> writes:
> >
> >> Yes, we should. I have attached the improved patch to this mail.
> >
> > It works great. Thanks!
> 
> Hello Eli,
> 
> does this patch (and my other Ibuffer patch) look okay to you, such that
> they can be installed? Thanks.

Didn't yet have time to review it, will do soon.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 25 Jan 2025 09:44:01 GMT) Full text and rfc822 format available.

Notification sent to Daniel Mendler <mail <at> daniel-mendler.de>:
bug acknowledged by developer. (Sat, 25 Jan 2025 09:44:01 GMT) Full text and rfc822 format available.

Message #34 received at 75495-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Mendler <mail <at> daniel-mendler.de>
Cc: me <at> pengjiz.com, 75495-done <at> debbugs.gnu.org
Subject: Re: bug#75495: [PATCH] ibuffer: New defcustom
 `ibuffer-human-readable-size'
Date: Sat, 25 Jan 2025 11:42:59 +0200
> Cc: 75495 <at> debbugs.gnu.org
> Date: Sun, 19 Jan 2025 14:45:29 +0100
> From:  Daniel Mendler via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Pengji Zhang <me <at> pengjiz.com> writes:
> 
> > Daniel Mendler <mail <at> daniel-mendler.de> writes:
> >
> >>+             (or (get-text-property (1- (length s)) 'ibuffer-size s)
> >>+                 (get-text-property 0 'ibuffer-size s) 0))))
> >
> > Should we consider centered column as well? I know it sounds unusual,
> > but for completeness I would like to support that as well.
> >
> > Maybe we could skip the leading spaces:
> >
> >       (get-text-property 0 'ibuffer-size (string-trim-left s " +"))
> >
> > What do you think?
> 
> Yes, we should. I have attached the improved patch to this mail.

Thanks, installed on master, and closing the bug.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75495; Package emacs. (Sun, 26 Jan 2025 11:17:02 GMT) Full text and rfc822 format available.

Message #37 received at 75495 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Daniel Mendler <mail <at> daniel-mendler.de>, 75495 <at> debbugs.gnu.org
Subject: Re: bug#75495: [PATCH] ibuffer: New defcustom
 `ibuffer-human-readable-size'
Date: Sun, 26 Jan 2025 12:16:16 +0100
>>>>> On Sat, 25 Jan 2025 10:23:39 +0200, Eli Zaretskii <eliz <at> gnu.org> said:

    >> From: Daniel Mendler <mail <at> daniel-mendler.de>
    >> Cc: Eli Zaretskii <eliz <at> gnu.org>
    >> Date: Sat, 25 Jan 2025 08:40:46 +0100
    >> 
    >> Pengji Zhang <me <at> pengjiz.com> writes:
    >> 
    >> > Daniel Mendler <mail <at> daniel-mendler.de> writes:
    >> >
    >> >> Yes, we should. I have attached the improved patch to this mail.
    >> >
    >> > It works great. Thanks!
    >> 
    >> Hello Eli,
    >> 
    >> does this patch (and my other Ibuffer patch) look okay to you, such that
    >> they can be installed? Thanks.

    Eli> Didn't yet have time to review it, will do soon.

It would be good if the patch consistently used either "size" or
"sizes" in the code and docstring, rather than a mix. Iʼd lean
slightly (but only slightly) to "sizes".

Robert
-- 




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 23 Feb 2025 12:24:20 GMT) Full text and rfc822 format available.

This bug report was last modified 119 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.