From: Svend Tollak Munkejord <stm@bacchus.pvv.org>
Subject: Re: Change behaviour %k in gnus-summary-line-format?
Date: Wed, 08 Oct 2003 18:49:45 +0200 [thread overview]
Message-ID: <hddhe2jllna.fsf@bacchus.pvv.ntnu.no> (raw)
In-Reply-To: <v9n0cb91c7.fsf@marauder.physik.uni-ulm.de>
Today, Reiner Steib <4.uce.03.r.s@nurfuerspam.de> wrote:
> On Wed, Oct 08 2003, Svend Tollak Munkejord wrote:
>
> [...]
>> the size of the message is displayed due to the %k. If it is in the
>> range of 100k, I see "0.1M".
>>
>> Would it be possible to tell Gnus to display, say, "103k" instead,
>> 1) making it easier to read, and 2) increasing the number of
>> significant digits by two?
>
> (defsubst gnus-summary-line-message-size (head)
> "Return pretty-printed version of message size.
> This function is intended to be used in
> `gnus-summary-line-format-alist'."
> (let ((c (or (mail-header-chars head) -1)))
> (cond ((< c 0) "n/a") ;; chars not available
> ((< c (* 1000)) (format "%db" c))
> ((< c (* 1000 10)) (format "%1.1fk" (/ c 1024.0)))
> ((< c (* 1000 1000)) (format "%dk" (/ c 1024.0)))
> ((< c (* 1000 10000)) (format "%1.1fM" (/ c (* 1024.0 1024))))
> (t (format "%dM" (/ c (* 1024.0 1024)))))))
That was nice. Thanks!
> This will print the numbers as "941b", "1.1k", " 86k", "102k", "472k",
> "1.1M". It seems that users have different preferences here: 100k or
> 0.1M? 900k or 0.9M? Some people prefer the former
> <news:8665yqqqlp.fsf@pille.fhaun.de>, some the latter
> <news:r8hevize.fsf@hschmi22.userfqdn.rz-online.de>.
As implicit in my question, I support the former, since "0." takes up the
space of two characters without conveying information.
Regards,
--
Svend Tollak Munkejord
prev parent reply other threads:[~2003-10-08 16:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-08 8:12 Svend Tollak Munkejord
2003-10-08 15:49 ` Reiner Steib
2003-10-08 16:49 ` Svend Tollak Munkejord [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=hddhe2jllna.fsf@bacchus.pvv.ntnu.no \
--to=stm@bacchus.pvv.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).