From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/61136 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.general Subject: Bug in "View as type"? Date: Tue, 11 Oct 2005 23:04:41 +0200 Organization: Dept. of Theoretical Physics, University of Ulm Message-ID: Reply-To: Reiner Steib NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1129065343 23801 80.91.229.2 (11 Oct 2005 21:15:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Oct 2005 21:15:43 +0000 (UTC) Original-X-From: ding-owner+m9669@lists.math.uh.edu Tue Oct 11 23:15:42 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EPRPp-0000EK-NF for ding-account@gmane.org; Tue, 11 Oct 2005 23:12:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1EPRPl-0003jP-00; Tue, 11 Oct 2005 16:12:01 -0500 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1EPRPC-0003jJ-00 for ding@lists.math.uh.edu; Tue, 11 Oct 2005 16:11:26 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1EPRP7-00020p-Q3 for ding@lists.math.uh.edu; Tue, 11 Oct 2005 16:11:26 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1EPRP6-00012O-00 for ; Tue, 11 Oct 2005 23:11:20 +0200 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1EPRMv-0007kZ-Hv for ding@gnus.org; Tue, 11 Oct 2005 23:09:05 +0200 Original-Received: from bridgekeeper.physik.uni-ulm.de ([134.60.10.123]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 11 Oct 2005 23:09:05 +0200 Original-Received: from Reiner.Steib by bridgekeeper.physik.uni-ulm.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 11 Oct 2005 23:09:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-To: ding@gnus.org Original-Lines: 72 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: bridgekeeper.physik.uni-ulm.de X-Face: /U7=m^"/-Dn61mAl{g9e3>\G5Tp,oEX|V)g2I1hBk\ML;)7A?6cmB-y7y?'NA^J<=oz7syB =(McAwIHgLX!.B?R3X}98d@?>CrT094KLWh]WU4gDpnL/")MS(XoQTv`Oq225uL>+;CpPXo$N5e>N> $tPd-gbB^F{gQS#1ase]XO~D4p4M"3+F-7~u]dy3I?Pb8RO*H-EFeWDUf?Rf,d]pv\Jvh2Cht!A=im yKAS2Z%Ao^;}W/qzMvMm Mail-Copies-To: nobody User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:hS1uZgEQn/cmLSi5LCJNMLYbZ0E= X-Spam-Score: -2.4 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:61136 Archived-At: Hi, if I understand the code correctly, `gnus-mime-view-part-as-type' (bound to `t' on MIME buttons) is supposed to offer the type by calling `mm-default-file-encoding' in `gnus-mime-view-part-as-type-internal'. I.e. when the content type is application/octet-stream and the file is in fact image/whatever or application/pdf (some broken mailers do), the user should be offered as more reasonable default. But in fact this doesn't work (at least for me): (get-text-property (point) 'gnus-data) => (#> ("application/octet-stream") base64 nil ("attachment" (filename . "cookies.txt")) nil nil nil) (mm-handle-type ...) => ("application/octet-stream") (mail-content-type-get ... 'name) => nil The following seems to do better. The only use of `gnus-mime-view-part-as-type-internal' is in `gnus-mime-view-part-as-type'. Or can anyone imaging a situation where the current implementation is preferable? Do we have some shortcut for this? (cdr (assq 'name (cdr (mm-handle-disposition handle)))) --8<---------------cut here---------------start------------->8--- --- gnus-art.el 27 Sep 2005 17:50:05 +0200 7.128 +++ gnus-art.el 11 Oct 2005 22:59:23 +0200 @@ -4317,9 +4317,9 @@ (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 (cdr (assq 'name (cdr (mm-handle-disposition handle)))) + (cdr (assq 'filename (cdr (mm-handle-disposition handle)))))) (def-type (and name (mm-default-file-encoding name)))) (and def-type (cons def-type 0)))) @@ -4328,10 +4328,12 @@ (interactive) (unless mime-type (setq mime-type (completing-read - "View as MIME type: " + (format "View as MIME type (default %s): " + (car (gnus-mime-view-part-as-type-internal))) (mapcar #'list (mailcap-mime-types)) nil nil - (gnus-mime-view-part-as-type-internal)))) + nil nil + (car (gnus-mime-view-part-as-type-internal))))) (gnus-article-check-buffer) (let ((handle (get-text-property (point) 'gnus-data))) (when handle --8<---------------cut here---------------end--------------->8--- Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/