From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/28580 Path: main.gmane.org!not-for-mail From: Kim-Minh Kaplan Newsgroups: gmane.emacs.gnus.general Subject: Re: Guessing based on file extension Date: 05 Jan 2000 19:29:25 +0100 Organization: Gnus Information Center Sender: owner-ding@hpc.uh.edu Message-ID: <87wvpo5q4a.fsf@kloug.western.fr> References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035165404 30611 80.91.224.250 (21 Oct 2002 01:56:44 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 01:56:44 +0000 (UTC) Return-Path: Original-Received: from spinoza.math.uh.edu (spinoza.math.uh.edu [129.7.128.18]) by mailhost.sclp.com (Postfix) with ESMTP id 26EC0D051E for ; Wed, 5 Jan 2000 13:31:43 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by spinoza.math.uh.edu (8.9.1/8.9.1) with ESMTP id MAB15365; Wed, 5 Jan 2000 12:31:21 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 05 Jan 2000 12:31:16 -0600 (CST) Original-Received: from mailhost.sclp.com (postfix@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id MAA12868 for ; Wed, 5 Jan 2000 12:31:05 -0600 (CST) Original-Received: from quimby.gnus.org (quimby.gnus.org [193.69.4.139]) by mailhost.sclp.com (Postfix) with ESMTP id A1FA7D051E for ; Wed, 5 Jan 2000 13:29:30 -0500 (EST) Original-Received: (from news@localhost) by quimby.gnus.org (8.9.3/8.9.3) id TAA01042 for ding@gnus.org; Wed, 5 Jan 2000 19:31:34 +0100 (CET) Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 55 Original-NNTP-Posting-Host: ext0.western.fr Original-X-Trace: quimby.gnus.org 947097094 22297 195.101.52.192 (5 Jan 2000 18:31:34 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 5 Jan 2000 18:31:34 GMT Mail-Copies-To: poster X-Face: C!5Mk_!qB]35}VpD|H>GN/@fk%~7:*/x8&~\]|r|)/zV?rJ){uX4Nh`a$L/z__Kx4Gt!mDU 3kZlj)F2]Ds$?l';SO9]v^|[i2nY`pZ+mu+HT%5ITkuP#e]@8F4@Hc.=]oN1+d\M@Rl>-$C?h$yntf -JVx)3L2}VzG.!bQEy]~I_3fup`HtZ^t/Iz.|Vh$~o`^g\ User-Agent: Gnus/5.0804 (Gnus v5.8.4) XEmacs/20.4 (Emerald) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:28580 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:28580 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Steinar Bang writes: > Hm... indeed. If it did, I would lose one of the two reasons I > currently have for dragging my heels wrt. a switch to IMAP: editing > the MIME types of attachments (the other one is reparenting of > articles, both are related to article editing). Ohh, I must have forgotten to post a patch that fixes a bug in the MIME parts menus on the "View As Type..." entry. I just upgraded it with François Pinard's idea: default to a guessing based on file extension. Now you can easily view attached parts without editing the article. Kim-Minh. --=-=-= Content-Type: text/x-elisp Content-Description: =?nil?b?bW9kaWZpY2F0aW9uIHRv?= =?nil?b?IGdudXMtYXJ0LmVs?= (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)) (def-type (and name (mm-default-file-encoding name)))) (and def-type (cons def-type 0)))) (defun gnus-mime-view-part-as-type (mime-type) "Choose a MIME media type, and view the part as such." (interactive (list (completing-read "View as MIME type: " (mapcar (lambda (i) (list i i)) (mailcap-mime-types)) nil nil (gnus-mime-view-part-as-type-internal)))) (gnus-article-check-buffer) (let* ((handle (get-text-property (point) 'gnus-data))) (gnus-mm-display-part (mm-make-handle (mm-handle-buffer handle) (cons mime-type (cdr (mm-handle-type handle))) (mm-handle-encoding handle) (mm-handle-undisplayer handle) (mm-handle-disposition handle) (mm-handle-description handle) (mm-handle-cache handle) (mm-handle-id handle))))) --=-=-=--