From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/67734 Path: news.gmane.org!not-for-mail From: Greg Troxel Newsgroups: gmane.emacs.gnus.general Subject: Re: Auto-overriding *.pdf application/octet-stream MIME type? Date: Mon, 03 Nov 2008 07:52:54 -0500 Message-ID: References: <873ai9dp1a.fsf@mocca.josefsson.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1225716832 26176 80.91.229.12 (3 Nov 2008 12:53:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Nov 2008 12:53:52 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M16185@lists.math.uh.edu Mon Nov 03 13:54:54 2008 connect(): Connection refused Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1KwyxJ-0007BI-JC for ding-account@gmane.org; Mon, 03 Nov 2008 13:54:53 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Kwyvb-0000dH-1j; Mon, 03 Nov 2008 06:53:07 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1KwyvZ-0000cw-KW for ding@lists.math.uh.edu; Mon, 03 Nov 2008 06:53:05 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1KwyvW-0000Oh-Ts for ding@lists.math.uh.edu; Mon, 03 Nov 2008 06:53:05 -0600 Original-Received: from linuxpal.mit.edu ([18.62.1.14]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1Kwyvf-0000wu-00 for ; Mon, 03 Nov 2008 13:53:11 +0100 Original-Received: by linuxpal.mit.edu (Postfix, from userid 9545) id D977016E44; Mon, 3 Nov 2008 07:52:58 -0500 (EST) In-Reply-To: <873ai9dp1a.fsf@mocca.josefsson.org> (Simon Josefsson's message of "Mon, 03 Nov 2008 12:31:13 +0100") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.3 (berkeley-unix) X-Hashcash: 1:20:081103:ding@gnus.org::LhsG3I+NoOqNbGVe:00003cct X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:67734 Archived-At: --=-=-= From: Simon Josefsson What do people think about a variable that can be used to auto-override MIME types based on filename extensions? I get a lot of *.pdf marked as application/octet-stream and selecting 'View as Type' feels dull. I have been annoyed by dealing with messages that come with wrong mime types and definitely second the notion that support would be nice. Something like this: (setq mm-content-type-mapping '(("application/octet-stream" "*.pdf" "application/pdf"))) The cells would be of the form (INCOMING-TYPE EXTENSION MAPPED-TYPE), and either of INCOMING-TYPE or EXTENSION can be nil to match anything. That looks good to me. I would have at first left out the first item, but on reflection I think that almost all miscoded objects are labeled application/octet-stream. This lets one have the narrowest effective configuration. Is the extension field going to be a regexp, glob, or string? Probably it should be a regex for an extension, with an implied ".*\." before it. Besides .pdf, .doc, .ppt and .xls labeled as application/octet-stream, the other problem I have is getting patches labeled as application/octet-stream. I tend to call them text/plain, but I think there is application/x-patch. Fixing this would seem to require having a "body test", basically running file on the part, and this seems harder and dangerous. I'm not suggesting that all problems be solved at once - I see no downside to your proposal. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (NetBSD) iEYEARECAAYFAkkO9CYACgkQH9p66AmO1g6gZgCeMmT6jdgJV3cWsO4u1dzxNFBx zGMAn31+qGfFlxKG7ff34CrqJUPVP7iy =EkP1 -----END PGP SIGNATURE----- --=-=-=--