From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Re: Displaying MIME parts internally/externally in Gnus Date: Thu, 04 May 2006 11:18:38 -0400 Message-ID: References: <87irum4tka.fsf-monnier+emacs@gnu.org> <8764q7lenq.fsf-monnier+emacs@gnu.org> <873bgcns63.fsf-monnier+emacs@gnu.org> <87vesmj8wr.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1146756459 5078 80.91.229.2 (4 May 2006 15:27:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 4 May 2006 15:27:39 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 04 17:27:28 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fbfii-0005ub-6Q for ged-emacs-devel@m.gmane.org; Thu, 04 May 2006 17:26:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fbfih-0004TC-J5 for ged-emacs-devel@m.gmane.org; Thu, 04 May 2006 11:26:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FbfiU-0004Sd-OG for emacs-devel@gnu.org; Thu, 04 May 2006 11:26:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FbfiS-0004SB-4C for emacs-devel@gnu.org; Thu, 04 May 2006 11:26:09 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FbfiR-0004S5-US for emacs-devel@gnu.org; Thu, 04 May 2006 11:26:07 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fbfj5-0005dA-4P for emacs-devel@gnu.org; Thu, 04 May 2006 11:26:47 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id E72CB2CF437; Thu, 4 May 2006 11:26:06 -0400 (EDT) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 10F5547BB; Thu, 4 May 2006 11:18:44 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id DA7DD716B9; Thu, 4 May 2006 11:18:38 -0400 (EDT) Original-To: ding@gnus.org In-Reply-To: (Reiner Steib's message of "Thu, 04 May 2006 14:43:51 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:53910 gmane.emacs.gnus.general:63165 Archived-At: >>> 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 * 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 > * 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