From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/3071 Path: news.gmane.org!not-for-mail From: Svend Tollak Munkejord Newsgroups: gmane.emacs.gnus.user Subject: Re: Change behaviour %k in gnus-summary-line-format? Date: Wed, 08 Oct 2003 18:49:45 +0200 Organization: The Royal Society for Putting Things on Top of Other Things Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1138669289 17527 80.91.229.2 (31 Jan 2006 01:01:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2006 01:01:29 +0000 (UTC) Original-X-From: nobody Tue Jan 17 17:31:39 2006 Original-Path: quimby.gnus.org!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-NNTP-Posting-Host: bacchus.pvv.ntnu.no Original-X-Trace: quimby.gnus.org 1065631786 27580 129.241.210.178 (8 Oct 2003 16:49:46 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: Wed, 8 Oct 2003 16:49:46 +0000 (UTC) Mail-Copies-To: never User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (berkeley-unix) X-Face: (2vS>!nr@2"*^KO{^8A<,_lGWx3HpnuA1UCA5vbsLl|2fZAV\T'x(3E`4@UJ >_mn@3S(.`C]g9DoFSSNAB@hftp\f-b#!UjRVfG5e#~H*^RvP+:meH63245"^?Zs7S[dE(SL`cn Cancel-Lock: sha1:pceNO4cceh9m66xfdaurqFDx7wI= Original-Xref: bridgekeeper.physik.uni-ulm.de gnus-emacs-gnus:3212 Original-Lines: 38 X-Gnus-Article-Number: 3212 Tue Jan 17 17:31:39 2006 Xref: news.gmane.org gmane.emacs.gnus.user:3071 Archived-At: 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 > , some the latter > . 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