unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Displaying MIME parts internally/externally in Gnus
Date: Thu, 04 May 2006 11:18:38 -0400	[thread overview]
Message-ID: <jwvk6913nvf.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <v98xpiyn7c.fsf@marauder.physik.uni-ulm.de> (Reiner Steib's message of "Thu, 04 May 2006 14:43:51 +0200")

>>> 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  <monnier@iro.umontreal.ca>

	* 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  <monnier@iro.umontreal.ca>

> 	* 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	other threads:[~2006-05-04 15:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-21  2:42 Displaying MIME parts internally/externally in Gnus Stefan Monnier
2005-12-02 15:11 ` Stefan Monnier
     [not found]   ` <m31wvwgt0w.fsf@quimbies.gnus.org>
     [not found]     ` <873bgcns63.fsf-monnier+emacs@gnu.org>
     [not found]       ` <m3mzekdxn0.fsf@quimbies.gnus.org>
     [not found]         ` <jwvwtdomay3.fsf-monnier+emacs@gnu.org>
     [not found]           ` <m3vet8p2w4.fsf@quimbies.gnus.org>
2006-05-03 14:01             ` Reiner Steib
2006-05-03 16:36               ` Lars Magne Ingebrigtsen
2006-05-03 23:32               ` Katsumi Yamaoka
2006-05-04 11:01                 ` Reiner Steib
2006-05-04 12:04                   ` Stefan Monnier
2006-05-04 12:43                     ` Reiner Steib
2006-05-04 15:18                       ` Stefan Monnier [this message]
2006-05-06 12:42                         ` Reiner Steib
2005-12-02 16:27 ` Reiner Steib
2005-12-02 21:28   ` Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvk6913nvf.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).