Gnus development mailing list
 help / color / mirror / Atom feed
* mailcap-mime-types
@ 2000-08-16 13:45 Toby Speight
  2000-08-16 13:58 ` mailcap-mime-types Toby Speight
  0 siblings, 1 reply; 2+ messages in thread
From: Toby Speight @ 2000-08-16 13:45 UTC (permalink / raw)


The current version of `mailcap-mime-types' returns only those types
that have appropriate filename extensions in mime.types.  Here's one
which also reads mailcap-mime-data to get all types that have handlers
(it still gets those from mime.types - but I don't think it should).

This is useful for `gnus-mime-view-part-as-type', which uses the
result for its (completing-read).  I notice that the mml-attach-*
functions use `mml-minibuffer-read-type' - perhaps that could be
shared instead of applying my change?

(defun mailcap-mime-types ()
  "Return a list of MIME media types."
  (delete nil
          (mm-delete-duplicates
           (apply 'append
                  (mapcar 'cdr mailcap-mime-extensions)
                  (mapcar '(lambda (x)
                             (and (not (string-match "\\.?\\*" (car x)))
                                  (mapcar '(lambda (x)
                                             (and (not (string-match "\\.?\\*" (car x)))
                                                  (cdr (assoc 'type x))))
                                          (cdr x))))
                          mailcap-mime-data)))))



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: mailcap-mime-types
  2000-08-16 13:45 mailcap-mime-types Toby Speight
@ 2000-08-16 13:58 ` Toby Speight
  0 siblings, 0 replies; 2+ messages in thread
From: Toby Speight @ 2000-08-16 13:58 UTC (permalink / raw)


0> In article <873dk5iak4.fsf@delivery.cam.eu.citrix.com>,
0> Toby Speight <URL:mailto:streapadair@gmx.net> ("Toby") wrote:

Toby> I notice that the mml-attach-* functions use
Toby> `mml-minibuffer-read-type' - perhaps that could be shared
Toby> instead of applying my change?

Like this, I mean:

(defun gnus-mime-view-part-as-type (type)
  "Choose a MIME media type, and view the part as such."
  (interactive
   (list
    (let* ((mime-data (cdr (get-text-property (point) 'gnus-data)))
           (name (cdr (or (assoc 'filename (nth 3 mime-data)) (assoc 'name (car mime-data))))))
      (require 'mml)
      (mml-minibuffer-read-type name (car (car mime-data))))))
  (gnus-article-check-buffer)
  (let ((handle (get-text-property (point) 'gnus-data)))
    (setq handle (copy-sequence handle))
    (setcar (cdr handle) (list type))
    (gnus-mm-display-part handle)))



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-08-16 13:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-16 13:45 mailcap-mime-types Toby Speight
2000-08-16 13:58 ` mailcap-mime-types Toby Speight

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).