From: Kim-Minh Kaplan <kmkaplan@vocatex.fr>
Subject: Re: Guessing based on file extension
Date: 05 Jan 2000 19:29:25 +0100 [thread overview]
Message-ID: <87wvpo5q4a.fsf@kloug.western.fr> (raw)
In-Reply-To: <whg0wdrmc0.fsf@viffer.metis.no>
[-- Attachment #1: Type: text/plain, Size: 568 bytes --]
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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: =?nil?b?bW9kaWZpY2F0aW9uIHRvIGdudXMtYXJ0LmVs?= --]
[-- Type: text/x-elisp, Size: 992 bytes --]
(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)))))
prev parent reply other threads:[~2000-01-05 18:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-01-02 7:24 Lars Magne Ingebrigtsen
2000-01-02 7:43 ` Daniel Pittman
2000-01-02 8:02 ` Hans de Graaff
2000-01-02 16:09 ` Alan Shutko
2000-01-02 22:42 ` Hans de Graaff
2000-01-02 15:35 ` Per Abrahamsen
2000-01-02 16:11 ` Steinar Bang
2000-01-02 21:24 ` Simon Josefsson
2000-01-03 12:05 ` Steinar Bang
2000-01-04 19:41 ` François Pinard
2000-01-04 23:32 ` Kai Großjohann
2000-01-05 0:02 ` Stainless Steel Rat
2000-01-05 7:47 ` Steinar Bang
2000-01-05 18:29 ` Kim-Minh Kaplan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wvpo5q4a.fsf@kloug.western.fr \
--to=kmkaplan@vocatex.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).