emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying MIME parts internally/externally in Gnus


From: Stefan Monnier
Subject: Re: Displaying MIME parts internally/externally in Gnus
Date: Thu, 04 May 2006 11:18:38 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>>> In `mm-inlinable-p', TYPE is the value of (mm-handle-media-type handle):
>> [...]
>>> Stefan, maybe you forgot to send a patch for `mm-decode.el' as well?
>> Oops, looks like you're right.  The patch is the obvious one.
> Thanks.  Could you provide a ChangeLog entry, please?

OK:

2006-05-04  Stefan Monnier  <address@hidden>

        * mm-decode.el (mm-dissect-buffer): Remove spurious double assignment.
        (mm-copy-to-buffer): Use with-current-buffer.
        (mm-display-part): Simplify.
        (mm-inlinable-p): Add optional arg `type'.

> AFAICS, the first two hunks are unrelated (maybe the ChangeLog entry will
> clarify).

Indeed, they're just "clean up".

> For the `gnus-art.el' changes, I've added the following.  Feel free to
> suggest a better entry.

> --8<---------------cut here---------------start------------->8---
> 2006-05-03  Stefan Monnier  <address@hidden>

>       * gnus-art.el (gnus-mime-view-part-as-type): Add optional PRED
>       argument.
>       (gnus-mime-view-part-externally, gnus-mime-view-part-internally):
>       Try harder to show the attachment internally or externally using
>       gnus-mime-view-part-as-type.
> --8<---------------cut here---------------end--------------->8---

Sounds good.

>> @@ -1019,10 +1017,10 @@
>> methods nil)))
>> result))
>> 
>> -(defun mm-inlinable-p (handle)
>> +(defun mm-inlinable-p (handle &optional type)
>> "Say whether HANDLE can be displayed inline."
>> +  (unless type (setq type (mm-handle-media-type handle)))
>> (let ((alist mm-inline-media-tests)
>> -    (type (mm-handle-media-type handle))
>> test)
>> (while alist
>> (when (string-match (caar alist) type)

> IMHO, the doc string should explain the use of TYPE, i.e. if TYPE is
> given, HANDLE is ignored.

Yes, sorry.  I just sent my "current diff" without massaging it.
The docstring should also say:

TYPE is the mime-type of the object; it defaults to the one given in HANDLE.

And AFAICT the `handle' is not ignored: it's passed to the inline-media
test function.

> BTW, I did some test with *.pdf and *.png files attached as
> application/octet-stream.  Using `e', I get "View as MIME type
> (default image/png)" but TAB doesn't offer me any completion.

Hmm.. can't test it right now, but it's worked for me.  Note that part of
the reason why I originally sent my patch rather than just install it
(other than the fact that it needed approval) is because I have no idea
whether it's doing things The Right Way.  I have very little familiarity
with Gnus (and MM) code.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]