From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/36818 Path: main.gmane.org!not-for-mail From: Colin Walters Newsgroups: gmane.emacs.gnus.general Subject: Re: first MIME part not displayed Date: Mon, 09 Jul 2001 16:56:48 -0400 Organization: The Ohio State University Dept. of Computer and Info. Science Message-ID: <87hewl3jov.church.of.emacs@cis.ohio-state.edu> References: <87y9pxx37u.church.of.emacs@cis.ohio-state.edu> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035172341 10628 80.91.224.250 (21 Oct 2002 03:52:21 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 03:52:21 +0000 (UTC) Return-Path: Return-Path: Original-Received: (qmail 10050 invoked from network); 9 Jul 2001 21:00:12 -0000 Original-Received: from mail.cis.ohio-state.edu (HELO cis.ohio-state.edu) (root@164.107.115.5) by gnus.org with SMTP; 9 Jul 2001 21:00:12 -0000 Original-Received: from verbum.org (root@gold.cis.ohio-state.edu [164.107.112.16]) by cis.ohio-state.edu (8.9.1/8.9.1) with ESMTP id RAA02966 for ; Mon, 9 Jul 2001 17:00:10 -0400 (EDT) Original-Received: from space-ghost (space-ghost.verbum.org [192.168.5.90]) by verbum.org (Postfix (Debian/GNU)) with ESMTP id 8C92271EC for ; Mon, 9 Jul 2001 16:55:15 -0400 (EDT) Original-Received: by space-ghost (Postfix, from userid 1000) id B4473A3FF6; Mon, 9 Jul 2001 16:56:48 -0400 (EDT) Original-To: ding@gnus.org X-Attribution: Colin X-Face: %'w-_>8Mj2_'=;I$myE#]G"'D>x3CY_rk,K06:mXFUvWy>;3I"BW3_-MAiUby{O(mn"wV@m dd`)Vk[27^^Sa (Colin Walters's message of "Mon, 09 Jul 2001 16:22:13 -0400") Original-Lines: 113 Xref: main.gmane.org gmane.emacs.gnus.general:36818 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:36818 Colin Walters writes: > Yeah, this is my fault, I think. Patch in the works. Ok, this should fix the problems, I hope. I think it's better anyways than the previous patch, because now we leave the choice of "defaulting" to text/plain up to the user, by putting it in `mm-inline-media-tests'. 2001-07-09 Colin Walters * mm-decode.el (mm-inline-media-tests): Default to displaying as text/plain if the type doesn't match any other media types. (mm-inlined-types): Doc fix. (mm-display-inline): Revert previous change (now handled by a default type in `mm-inline-media-tests'. (mm-inlinable-p): Revive. (mm-display-part): Call `mm-inlinable-p'. (mm-attachment-override-p): Ditto. (mm-inlined-p): Doc fix. * gnus-art.el (gnus-mime-display-single): Call `mm-inlinable-p' as well as `mm-inlined-p'. --- gnus-art.el.~6.86.~ Mon Jul 9 14:57:41 2001 +++ gnus-art.el Mon Jul 9 16:51:04 2001 @@ -3869,7 +3869,9 @@ "inline") (mm-attachment-override-p handle)))) (mm-automatic-display-p handle) - (or (mm-inlined-p handle) + (or (and + (mm-inlinable-p handle) + (mm-inlined-p handle)) (mm-automatic-external-display-p type))) (setq display t) (when (equal (mm-handle-media-supertype handle) "text") --- mm-decode.el.~6.38.~ Thu Jul 5 15:07:49 2001 +++ mm-decode.el Mon Jul 9 16:42:12 2001 @@ -178,7 +178,9 @@ ("application/pkcs7-signature" ignore identity) ("multipart/alternative" ignore identity) ("multipart/mixed" ignore identity) - ("multipart/related" ignore identity)) + ("multipart/related" ignore identity) + ;; Default to displaying as text + (".*" mm-inline-text identity)) "Alist of media types/tests saying whether types can be displayed inline." :type '(repeat (list (string :tag "MIME type") (function :tag "Display function") @@ -192,8 +194,7 @@ "application/pkcs7-signature") "List of media types that are to be displayed inline. See also `mm-inline-media-tests', which says how to display a media -type inline. If no media test is defined, the default is to treat the -type as plain text." +type inline." :type '(repeat string) :group 'mime-display) @@ -541,7 +542,8 @@ (mm-remove-part handle) (let* ((type (mm-handle-media-type handle)) (method (mailcap-mime-info type))) - (if (mm-inlined-p handle) + (if (and (mm-inlinable-p handle) + (mm-inlined-p handle)) (progn (forward-line 1) (mm-display-inline handle) @@ -744,7 +746,7 @@ (defun mm-display-inline (handle) (let* ((type (mm-handle-media-type handle)) (function (cadr (mm-assoc-string-match mm-inline-media-tests type)))) - (funcall (or function #'mm-inline-text) handle) + (funcall function handle) (goto-char (point-min)))) (defun mm-assoc-string-match (alist type) @@ -764,8 +766,21 @@ methods nil))) result)) +(defun mm-inlinable-p (handle) + "Say whether HANDLE can be displayed inline." + (let ((alist mm-inline-media-tests) + (type (mm-handle-media-type handle)) + test) + (while alist + (when (string-match (caar alist) type) + (setq test (caddar alist) + alist nil) + (setq test (funcall test handle))) + (pop alist)) + test)) + (defun mm-inlined-p (handle) - "Say whether the user wants HANDLE to be displayed automatically." + "Say whether the user wants HANDLE to be displayed inline." (let ((methods mm-inlined-types) (type (mm-handle-media-type handle)) method result) @@ -783,7 +798,8 @@ ty) (catch 'found (while (setq ty (pop types)) - (when (string-match ty type) + (when (and (string-match ty type) + (mm-inlinable-p ty)) (throw 'found t)))))) (defun mm-inline-override-p (handle)