Gnus development mailing list
 help / color / mirror / Atom feed
* Indicate partial articles (nnimap-fetch-partial-articles)
@ 2010-12-29 11:04 Tassilo Horn
  2010-12-29 11:13 ` Julien Danjou
  0 siblings, 1 reply; 9+ messages in thread
From: Tassilo Horn @ 2010-12-29 11:04 UTC (permalink / raw)
  To: ding

Hi all,

I've set `nnimap-fetch-partial-articles' to "text/", so that I only get
the text parts of messages by default.  That works pretty well, except
that currently it's not visible that a message is incomplete.

Would it be possible for Gnus to add some buttons (like the MIME
buttons) for each part that is not fetched, and clicking these buttons
would download the part it question?

For the time being, even a simple text note that a message is not
complete would be much better than nothing.

Bye,
Tassilo
-- 
Sent from my Emacs



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

* Re: Indicate partial articles (nnimap-fetch-partial-articles)
  2010-12-29 11:04 Indicate partial articles (nnimap-fetch-partial-articles) Tassilo Horn
@ 2010-12-29 11:13 ` Julien Danjou
  2010-12-29 11:41   ` Tassilo Horn
  0 siblings, 1 reply; 9+ messages in thread
From: Julien Danjou @ 2010-12-29 11:13 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 955 bytes --]

On Wed, Dec 29 2010, Tassilo Horn wrote:

> Hi all,
>
> I've set `nnimap-fetch-partial-articles' to "text/", so that I only get
> the text parts of messages by default.  That works pretty well, except
> that currently it's not visible that a message is incomplete.
>
> Would it be possible for Gnus to add some buttons (like the MIME
> buttons) for each part that is not fetched, and clicking these buttons
> would download the part it question?
>
> For the time being, even a simple text note that a message is not
> complete would be much better than nothing.

I've already requested things like that, but it seems far from trivial
actually. The whole mime code expect all the part to have been
downloaded, there's no way to request a download of a part later on.

So it's totally doable, but not easily, it needs a big rework of the
mime code to handle not-downloaded-yet-part.

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: Indicate partial articles (nnimap-fetch-partial-articles)
  2010-12-29 11:13 ` Julien Danjou
@ 2010-12-29 11:41   ` Tassilo Horn
  2010-12-29 11:50     ` Julien Danjou
  0 siblings, 1 reply; 9+ messages in thread
From: Tassilo Horn @ 2010-12-29 11:41 UTC (permalink / raw)
  To: ding

Julien Danjou <julien@danjou.info> writes:

Hi Julien,

>> Would it be possible for Gnus to add some buttons (like the MIME
>> buttons) for each part that is not fetched, and clicking these
>> buttons would download the part it question?
>>
>> For the time being, even a simple text note that a message is not
>> complete would be much better than nothing.
>
> I've already requested things like that, but it seems far from trivial
> actually. The whole mime code expect all the part to have been
> downloaded, there's no way to request a download of a part later on.
>
> So it's totally doable, but not easily, it needs a big rework of the
> mime code to handle not-downloaded-yet-part.

Does that apply to my buttons question or also to the request of simply
indicating somehow that an article is incomplete?

While I think that the former is useful, I don't consider is as urgent.
But the inability to see that an article has additional parts is kinda a
showstopper.

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?

Bye,
Tassilo
-- 
Sent from my Emacs



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

* Re: Indicate partial articles (nnimap-fetch-partial-articles)
  2010-12-29 11:41   ` Tassilo Horn
@ 2010-12-29 11:50     ` Julien Danjou
  2010-12-29 12:32       ` Tassilo Horn
  0 siblings, 1 reply; 9+ messages in thread
From: Julien Danjou @ 2010-12-29 11:50 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 466 bytes --]

On Wed, Dec 29 2010, Tassilo Horn wrote:

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

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: Indicate partial articles (nnimap-fetch-partial-articles)
  2010-12-29 11:50     ` Julien Danjou
@ 2010-12-29 12:32       ` Tassilo Horn
  2010-12-29 13:14         ` Tassilo Horn
  0 siblings, 1 reply; 9+ messages in thread
From: Tassilo Horn @ 2010-12-29 12:32 UTC (permalink / raw)
  To: ding

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



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

* Re: Indicate partial articles (nnimap-fetch-partial-articles)
  2010-12-29 12:32       ` Tassilo Horn
@ 2010-12-29 13:14         ` Tassilo Horn
  2010-12-29 13:18           ` Julien Danjou
  0 siblings, 1 reply; 9+ messages in thread
From: Tassilo Horn @ 2010-12-29 13:14 UTC (permalink / raw)
  To: ding

Hi again,

now I'm totally stunned.  Is it possible that Gnus already insert mime
buttons for parts that are not downloaded?

I wrote a mail to myself containing some text, a PDF attachment, a jpeg
image, and a vcard (text/vcf).  nnimap-fetch-partial-articles is set to
"\\(text\\|image\\)/".

The article buffer showed the text, a button [2. application/pdf]...,
the image, and the vcard contents (including a button).  Hitting RET on
the PDF button fires up my PDF viewer which errors that it couldn't open
the PDF somewhere in /tmp/.

Now I hit `A C', and the mime button of the PDF part contains also the
description text, and the PDF can be opened as usual.

The image is not displayed anymore, but there is a mime button that
toggles its display and also shows the description text.

Ditto for the VCF attachment.

So for this mail, I cannot miss that it was downloaded only partially.

But now I've found another mail whose body contents is only

--8<---------------cut here---------------start------------->8---
WARNING: contains banned part
--8<---------------cut here---------------end--------------->8---

when fetched partially.  After hitting `A C', the contents are

--8<---------------cut here---------------start------------->8---
WARNING: contains banned part
[2. Original message --- message/rfc822; message.txt]...
--8<---------------cut here---------------end--------------->8---

So here, I have no indication that the mail was incomplete... :-(

Bye,
Tassilo
-- 
Sent from my Emacs



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

* Re: Indicate partial articles (nnimap-fetch-partial-articles)
  2010-12-29 13:14         ` Tassilo Horn
@ 2010-12-29 13:18           ` Julien Danjou
  2010-12-29 13:58             ` Tassilo Horn
  0 siblings, 1 reply; 9+ messages in thread
From: Julien Danjou @ 2010-12-29 13:18 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

On Wed, Dec 29 2010, Tassilo Horn wrote:

> now I'm totally stunned.  Is it possible that Gnus already insert mime
> buttons for parts that are not downloaded?

I think: yes, but only if they are not inlined.

> WARNING: contains banned part
> [2. Original message --- message/rfc822; message.txt]...
>
> So here, I have no indication that the mail was incomplete... :-(

Because a message/rfc822 is inlined (by Gnus or set to inline in the
mail, whatever).

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: Indicate partial articles (nnimap-fetch-partial-articles)
  2010-12-29 13:18           ` Julien Danjou
@ 2010-12-29 13:58             ` Tassilo Horn
  2010-12-29 14:11               ` Tassilo Horn
  0 siblings, 1 reply; 9+ messages in thread
From: Tassilo Horn @ 2010-12-29 13:58 UTC (permalink / raw)
  To: ding

Julien Danjou <julien@danjou.info> writes:

Hi Julien,

>> now I'm totally stunned.  Is it possible that Gnus already insert
>> mime buttons for parts that are not downloaded?
>
> I think: yes, but only if they are not inlined.
>
>> WARNING: contains banned part
>> [2. Original message --- message/rfc822; message.txt]...
>>
>> So here, I have no indication that the mail was incomplete... :-(
>
> Because a message/rfc822 is inlined (by Gnus or set to inline in the
> mail, whatever).

Ok, that explains it.

Bye,
Tassilo



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

* Re: Indicate partial articles (nnimap-fetch-partial-articles)
  2010-12-29 13:58             ` Tassilo Horn
@ 2010-12-29 14:11               ` Tassilo Horn
  0 siblings, 0 replies; 9+ messages in thread
From: Tassilo Horn @ 2010-12-29 14:11 UTC (permalink / raw)
  To: ding

Tassilo Horn <tassilo@member.fsf.org> writes:

>>> now I'm totally stunned.  Is it possible that Gnus already insert
>>> mime buttons for parts that are not downloaded?
>>
>> I think: yes, but only if they are not inlined.
>
> Ok, that explains it.

As a workaround, I have set

  (setq gnus-inhibit-mime-unbuttonizing t)

and now it seems I have mime buttons also for inlined, non-downloaded
parts.

The only issue with that is that you can only guess that a (text or
message) part was not downloaded because hitting the button simply
shows/narrows some empty lines.  But at least, you cannot miss parts as
easily as without that.

Bye,
Tassilo
-- 
Sent from my Emacs



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

end of thread, other threads:[~2010-12-29 14:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-29 11:04 Indicate partial articles (nnimap-fetch-partial-articles) 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
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

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