Gnus development mailing list
 help / color / mirror / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: ding@gnus.org
Subject: Re: Indicate partial articles (nnimap-fetch-partial-articles)
Date: Wed, 29 Dec 2010 13:32:58 +0100	[thread overview]
Message-ID: <87aajoep39.fsf@member.fsf.org> (raw)
In-Reply-To: <sa3lj38u7ak.fsf@cigue.easter-eggs.fr> (Julien Danjou's message of "Wed, 29 Dec 2010 12:50:43 +0100")

Julien Danjou <julien@danjou.info> writes:

Hi Julien,

>> Looking at `nnimap-request-article', it shouldn't be to hard to
>> detect when a part was skipped, so one could simply append a line
>>
>>     [This is a partial article.]
>>
>> at the end of it, or am I wrong?
>
> Possibly, did not check that. It seems quite useless to me to know
> it's a partial article if there's no way to have its missing parts
> downloaded. :-)

That would be true, but you can fetch the complete article with `A C'.

I've just experimented a bit.  When I change nnimap.el a bit like
that...

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index acbb091..011a51a 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -458,6 +458,11 @@ textual parts.")
 (deffoo nnimap-status-message (&optional server)
   nnimap-status-string)
 
+(defun nnimap-part-count (structure)
+  (if (atom (car structure))
+      0
+    (1+ (nnimap-part-count (cdr structure)))))
+
 (deffoo nnimap-request-article (article &optional group server to-buffer)
   (with-current-buffer nntp-server-buffer
     (let ((result (nnimap-possibly-change-group group server))
@@ -487,6 +492,10 @@ textual parts.")
              (with-current-buffer (or to-buffer nntp-server-buffer)
                (erase-buffer)
                (insert-buffer-substring buffer)
+               (message "%d / %d" (nnimap-part-count structure) (length parts))
+               (when (> (nnimap-part-count structure) (length parts))
+                 (message "INCOMPLETE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
+                 (insert "[This is a partial article.]"))
                (nnheader-ms-strip-cr)
                (cons group article)))))))))
--8<---------------cut here---------------end--------------->8---

...then the INCOMPLETE! message is sometimes shown without the [partial
article] visible in the message...  And even though I have
nnimap-fetch-partial-articles set to "text/", also application/pdf parts
and other parts are included in several messages.

Is it possible that the imap server I used for testing doesn't support
partial article downloads?

Bye,
Tassilo



  reply	other threads:[~2010-12-29 12:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-29 11:04 Tassilo Horn
2010-12-29 11:13 ` Julien Danjou
2010-12-29 11:41   ` Tassilo Horn
2010-12-29 11:50     ` Julien Danjou
2010-12-29 12:32       ` Tassilo Horn [this message]
2010-12-29 13:14         ` Tassilo Horn
2010-12-29 13:18           ` Julien Danjou
2010-12-29 13:58             ` Tassilo Horn
2010-12-29 14:11               ` Tassilo Horn

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=87aajoep39.fsf@member.fsf.org \
    --to=tassilo@member.fsf.org \
    --cc=ding@gnus.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).