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 08:04:59 -0400 Message-ID: <87vesmj8wr.fsf-monnier+emacs@gnu.org> References: <87irum4tka.fsf-monnier+emacs@gnu.org> <8764q7lenq.fsf-monnier+emacs@gnu.org> <873bgcns63.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 1146744467 24402 80.91.229.2 (4 May 2006 12:07:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 4 May 2006 12:07:47 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 04 14:07:44 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 1FbccF-0006fC-9q for ged-emacs-devel@m.gmane.org; Thu, 04 May 2006 14:07:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FbccE-0004xl-GX for ged-emacs-devel@m.gmane.org; Thu, 04 May 2006 08:07:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FbcZz-0003RE-Kc for emacs-devel@gnu.org; Thu, 04 May 2006 08:05:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FbcZu-0003P1-QK for emacs-devel@gnu.org; Thu, 04 May 2006 08:05:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FbcZu-0003Ov-A0 for emacs-devel@gnu.org; Thu, 04 May 2006 08:05:06 -0400 Original-Received: from [209.226.175.110] (helo=tomts43-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FbcaV-0003nA-EH for emacs-devel@gnu.org; Thu, 04 May 2006 08:05:43 -0400 Original-Received: from alfajor ([70.55.147.184]) by tomts43-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060504120503.LXJI1543.tomts43-srv.bellnexxia.net@alfajor>; Thu, 4 May 2006 08:05:03 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 07DDCD865D; Thu, 4 May 2006 08:05:00 -0400 (EDT) Original-To: ding@gnus.org In-Reply-To: (Reiner Steib's message of "Thu, 04 May 2006 13:01:29 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:53893 gmane.emacs.gnus.general:63162 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. Sorry 'bout that. Stefan --- orig/lisp/gnus/mm-decode.el +++ mod/lisp/gnus/mm-decode.el @@ -562,7 +562,7 @@ description) (setq type (split-string (car ctl) "/")) (setq subtype (cadr type) - type (pop type)) + type (car type)) (setq result (cond @@ -641,16 +641,15 @@ (defun mm-copy-to-buffer () "Copy the contents of the current buffer to a fresh buffer." - (save-excursion (let ((obuf (current-buffer)) beg) (goto-char (point-min)) (search-forward-regexp "^\n" nil t) (setq beg (point)) - (set-buffer + (with-current-buffer ;; Preserve the data's unibyteness (for url-insert-file-contents). (let ((default-enable-multibyte-characters (mm-multibyte-p))) - (generate-new-buffer " *mm*"))) + (generate-new-buffer " *mm*")) (insert-buffer-substring obuf beg) (current-buffer)))) @@ -701,7 +701,8 @@ (forward-line 1) (mm-insert-inline handle (mm-get-part handle)) 'inline) - (if (and method ;; If nil, we always use "save". + (setq external + (and method ;; If nil, we always use "save". (stringp method) ;; 'mailcap-save-binary-file (or (eq mm-enable-external t) (and (eq mm-enable-external 'ask) @@ -714,9 +715,7 @@ (concat " \"" (format method filename) "\"") "") - "? "))))) - (setq external t) - (setq external nil)) + "? ")))))) (if external (mm-display-external handle (or method 'mailcap-save-binary-file)) @@ -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)