From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/3070 Path: news.gmane.org!not-for-mail From: Reiner Steib <4.uce.03.r.s@nurfuerspam.de> Newsgroups: gmane.emacs.gnus.user Subject: Re: Change behaviour %k in gnus-summary-line-format? Date: Wed, 08 Oct 2003 17:49:12 +0200 Organization: Dept. of Theoretical Physics, University of Ulm Message-ID: References: Reply-To: reiner.steib@gmx.de NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1138669288 17526 80.91.229.2 (31 Jan 2006 01:01:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2006 01:01:28 +0000 (UTC) Cc: Frank Haun Original-X-From: nobody Tue Jan 17 17:31:39 2006 Original-Newsgroups: gnu.emacs.gnus X-Face: /U7=m^"/-Dn61mAl{g9e3>\G5Tp,oEX|V)g2I1hBk\ML;)7A?6cmB-y7y?'NA^J<=oz7syB =(McAwIHgLX!.B?R3X}98d@?>CrT094KLWh]WU4gDpnL/")MS(XoQTv`Oq225uL>+;CpPXo$N5e>N> $tPd-gbB^F{gQS#1ase]XO~D4p4M"3+F-7~u]dy3I?Pb8RO*H-EFeWDUf?Rf,d]pv\Jvh2Cht!A=im yKAS2Z%Ao^;}W/qzMvMm Mail-Copies-To: nobody User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:rQYvyImD4y88QYrhf5DDXUoT8jY= Original-NNTP-Posting-Host: lumberjack.physik.uni-ulm.de Original-X-Trace: news.uni-ulm.de 1065628627 134.60.10.173 (8 Oct 2003 17:57:07 +0200) Original-Path: quimby.gnus.org!newsfeed1.e.nsc.no!nsc.no!nextra.com!uio.no!feed.news.nacamar.de!news.belwue.de!news.uni-ulm.de!lumberjack.physik.uni-ulm.de!not-for-mail Original-Xref: bridgekeeper.physik.uni-ulm.de gnus-emacs-gnus:3211 Original-Lines: 46 X-Gnus-Article-Number: 3211 Tue Jan 17 17:31:39 2006 Xref: news.gmane.org gmane.emacs.gnus.user:3070 Archived-At: 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))))))) 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 . Is it useful to add another format specifier (say "K") or should we leave it as an exercise for the user? ,----[ (info "(gnus)Summary Buffer Lines") ] | `u' | User defined specifier. The next character in the format string | should be a letter. Gnus will call the function | `gnus-user-format-function-X', where X is the letter following | `%u'. The function will be passed the current header as argument. | The function should return a string, which will be inserted into | the summary just like information from any other summary specifier. `---- Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- PGP key available via WWW http://rsteib.home.pages.de/