Gnus development mailing list
 help / color / mirror / Atom feed
* nnimap and article line numbers
@ 2001-05-14 10:16 Vladimir Volovich
  2001-05-14 11:10 ` Kai Großjohann
  2001-05-14 20:33 ` Simon Josefsson
  0 siblings, 2 replies; 6+ messages in thread
From: Vladimir Volovich @ 2001-05-14 10:16 UTC (permalink / raw)


Hi,

article line numbers shown in the summary buffer for the nnimap
backend seems to correspond to the parsed message, and does not count
attachments, quoted-printable, alternative, etc.

other backends (nnmbox, nnml) show the line number of the raw article
which tells more information about the article size.

so, is it possible to change the line number reports for the nnimap
backend to show the size of the raw article?

Best,
v.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: nnimap and article line numbers
  2001-05-14 10:16 nnimap and article line numbers Vladimir Volovich
@ 2001-05-14 11:10 ` Kai Großjohann
  2001-05-15 10:27   ` Vladimir Volovich
  2001-05-14 20:33 ` Simon Josefsson
  1 sibling, 1 reply; 6+ messages in thread
From: Kai Großjohann @ 2001-05-14 11:10 UTC (permalink / raw)
  Cc: ding

On 14 May 2001, Vladimir Volovich wrote:

> so, is it possible to change the line number reports for the nnimap
> backend to show the size of the raw article?

No, but I use the number of characters (or bytes?) for this, using the
following hack:

;; Use %c rather than %L because nnimap doesn't inlude the line
;; count for attachments in the line count.
(require 'gnus-sum)
(defsubst kai-gnus-summary-line-message-size (header)
  (let ((c (or (mail-header-chars header) 0)))
    (cond ((< c 1000) (format "%db" c))
          ((< c (* 1000 1000)) (format "%dk" (/ c 1024.0)))
          (t (format "%dM" (/ c (* 1024.0 1024)))))))
(add-to-list 'gnus-summary-line-format-alist
             '(?k (kai-gnus-summary-line-message-size gnus-tmp-header) ?s))

Now you can use %k in your summary line format.  The comment is
slightly off, since it's from an old version.

kai
-- 
The passive voice should never be used.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: nnimap and article line numbers
  2001-05-14 10:16 nnimap and article line numbers Vladimir Volovich
  2001-05-14 11:10 ` Kai Großjohann
@ 2001-05-14 20:33 ` Simon Josefsson
  2001-05-15  7:17   ` Simon Josefsson
  1 sibling, 1 reply; 6+ messages in thread
From: Simon Josefsson @ 2001-05-14 20:33 UTC (permalink / raw)
  Cc: ding

On 14 May 2001, Vladimir Volovich wrote:

> so, is it possible to change the line number reports for the nnimap
> backend to show the size of the raw article?

No.  I believe it's impossible to get a line count of the unparsed message
via IMAP.

You can get the unparsed message and count the lines yourself, but that
didn't seem very efficient to me, so right now it only display the sum
of the line counts on the MIME parts where this information is available
(text/* and message/rfc822 if my memory serve me right).



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: nnimap and article line numbers
  2001-05-14 20:33 ` Simon Josefsson
@ 2001-05-15  7:17   ` Simon Josefsson
  2001-05-15 10:05     ` Vladimir Volovich
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Josefsson @ 2001-05-15  7:17 UTC (permalink / raw)
  Cc: ding

On Mon, 14 May 2001, Simon Josefsson wrote:

> > so, is it possible to change the line number reports for the nnimap
> > backend to show the size of the raw article?
>
> No.  I believe it's impossible to get a line count of the unparsed message
> via IMAP.

Ahem, you said "size" -- if you meant the size in bytes rather than size
in number of lines, try the %c format specifier of `gnus-summary-line-format'.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: nnimap and article line numbers
  2001-05-15  7:17   ` Simon Josefsson
@ 2001-05-15 10:05     ` Vladimir Volovich
  0 siblings, 0 replies; 6+ messages in thread
From: Vladimir Volovich @ 2001-05-15 10:05 UTC (permalink / raw)
  Cc: ding

"SJ" == Simon Josefsson writes:

 >> > so, is it possible to change the line number reports for the
 >> > nnimap backend to show the size of the raw article?
 >> 
 >> No.  I believe it's impossible to get a line count of the unparsed
 >> message via IMAP.

 SJ> Ahem, you said "size" -- if you meant the size in bytes rather
 SJ> than size in number of lines, try the %c format specifier of
 SJ> `gnus-summary-line-format'.

thanks, i'll use %c because it appears to be more informative than %L.

Best,
v.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: nnimap and article line numbers
  2001-05-14 11:10 ` Kai Großjohann
@ 2001-05-15 10:27   ` Vladimir Volovich
  0 siblings, 0 replies; 6+ messages in thread
From: Vladimir Volovich @ 2001-05-15 10:27 UTC (permalink / raw)
  Cc: ding

"KG" == Kai Großjohann writes:

 KG> ;; Use %c rather than %L because nnimap doesn't inlude the line
 KG> ;; count for attachments in the line count.  (require 'gnus-sum)
 KG> (defsubst kai-gnus-summary-line-message-size (header) (let ((c
 KG> (or (mail-header-chars header) 0))) (cond ((< c 1000) (format
 KG> "%db" c)) ((< c (* 1000 1000)) (format "%dk" (/ c 1024.0))) (t
 KG> (format "%dM" (/ c (* 1024.0 1024))))))) (add-to-list
 KG> 'gnus-summary-line-format-alist '(?k
 KG> (kai-gnus-summary-line-message-size gnus-tmp-header) ?s))

 KG> Now you can use %k in your summary line format.  The comment is
 KG> slightly off, since it's from an old version.

thanks. btw, the following format (%us) defined via
gnus-user-format-function-X also works:

(defun gnus-user-format-function-s (header)
  (let ((c (or (mail-header-chars header) 0)))
    (cond ((< c 1000) (format "%db" c))
          ((< c (* 1000 1024)) (format "%dk" (/ c 1024.0)))
          (t (format "%dM" (/ c (* 1024.0 1024)))))))
(setq gnus-summary-line-format "%U%R%z%I%(%[%4us: %-20,20n%]%) %s\n")

Best,
v.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-05-15 10:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-14 10:16 nnimap and article line numbers Vladimir Volovich
2001-05-14 11:10 ` Kai Großjohann
2001-05-15 10:27   ` Vladimir Volovich
2001-05-14 20:33 ` Simon Josefsson
2001-05-15  7:17   ` Simon Josefsson
2001-05-15 10:05     ` Vladimir Volovich

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).