From: yamaoka Date: Thu, 13 Oct 2005 14:44:31 +0000 (+0000) Subject: Synch to No Gnus 200510131326. X-Git-Tag: t-gnus-6_17_4-quimby-~304 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d04fbada6de3c207d8521755da339133a97356be;p=elisp%2Fgnus.git- Synch to No Gnus 200510131326. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bbb5cba..dbb5caa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2005-10-13 Reiner Steib + + * gnus-art.el (gnus-mime-view-part-as-type-internal): Try to fetch + `filename' from Content-Disposition if Content-Type doesn't + provide `name'. + (gnus-mime-view-part-as-type): Set default instead of + initial-input. + 2005-10-09 Daniel Brockman * format-spec.el (format-spec): Propagate text properties of % spec. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index ba8b7af..e83033f 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -4666,9 +4666,12 @@ Deleting parts may malfunction or destroy the article; continue? ")) (defun gnus-mime-view-part-as-type-internal () (gnus-article-check-buffer) - (let* ((name (mail-content-type-get - (mm-handle-type (get-text-property (point) 'gnus-data)) - 'name)) + (let* ((handle (get-text-property (point) 'gnus-data)) + (name (or + ;; Content-Type: foo/bar; name=... + (mail-content-type-get (mm-handle-type handle) 'name) + ;; Content-Disposition: attachment; filename=... + (cdr (assq 'filename (cdr (mm-handle-disposition handle)))))) (def-type (and name (mm-default-file-encoding name)))) (and def-type (cons def-type 0)))) @@ -4676,11 +4679,14 @@ Deleting parts may malfunction or destroy the article; continue? ")) "Choose a MIME media type, and view the part as such." (interactive) (unless mime-type - (setq mime-type (completing-read - "View as MIME type: " - (mapcar #'list (mailcap-mime-types)) - nil nil - (gnus-mime-view-part-as-type-internal)))) + (setq mime-type + (let ((default (gnus-mime-view-part-as-type-internal))) + (completing-read + (format "View as MIME type (default %s): " + (car default)) + (mapcar #'list (mailcap-mime-types)) + nil nil nil nil + (car default))))) (gnus-article-check-buffer) (let ((handle (get-text-property (point) 'gnus-data))) (when handle