Gnus development mailing list
 help / color / mirror / Atom feed
From: Lars Magne Ingebrigtsen <larsi@gnus.org>
Subject: Re: User interface confusion; p0.30 invokes VM?
Date: Sun, 20 Oct 2002 23:17:01 +0000 (UTC)	[thread overview]
Message-ID: <m3iuisotk3.fsf@sparky.gnus.org> (raw)
In-Reply-To: Karl Kleinpaste's message of "13 Sep 1998 09:48:51 -400"

Karl Kleinpaste <karl@jprc.com> writes:

> [message/rfc822] 

[...]

> Once I get there, hitting RET on "[message/rfc822]" invokes VM.

[Tale of woe elided.]  :-)

The defaults for many of the parts are, perhaps, less than optimal.
Below is the current default; new, improved and spiffy defaults are
welcome, as are defaults for new and spiffy things.  (Hey!  No mp3 or
realadio viewer!)

I think the format should be self-explanitory, but here's the
explanation: `viewer' can be a string (shell process) or a function
and `test' is a form that can be executed to see if that viewer can be
run.

Hm.  Wouldn't the following be nice to use?  Then you could use
`(mailcap-command-p "mpeg_play")' to check for that command,
and stuff.

(defun mailcap-command-p (command)
  "Say whether COMMAND is in the exec path."
  (let ((path exec-path)
	file)
    (catch 'found
      (while path
	(when (and (file-exists-p
		    (setq file (expand-file-name command (pop path))))
		   (file-executable-p file))
	  (throw 'found file))))))

(Ok, so I've rediscovered `goto', and it makes me feel warm an fuzzy.) 

Feel free to write new and wonderful functions to display weird
formats and stuff.  Mail your things to this mailing list as you
develop it.

Here's the current value:

  '(("application"
     ("x-x509-ca-cert"
      (viewer . ssl-view-site-cert)
      (test . (fboundp 'ssl-view-site-cert))
      (type . "application/x-x509-ca-cert"))
     ("x-x509-user-cert"
      (viewer . ssl-view-user-cert)
      (test . (fboundp 'ssl-view-user-cert))
      (type . "application/x-x509-user-cert"))
     ("octet-stream"
      (viewer . mailcap-save-binary-file)
      (type ."application/octet-stream"))
     ("dvi"
      (viewer . "open %s")
      (type   . "application/dvi")
      (test   . (eq (mm-device-type) 'ns)))
     ("dvi"
      (viewer . "xdvi %s")
      (test   . (eq (mm-device-type) 'x))
      ("needsx11")
      (type   . "application/dvi"))
     ("dvi"
      (viewer . "dvitty %s")
      (test   . (not (getenv "DISPLAY")))
      (type   . "application/dvi"))
     ("emacs-lisp"
      (viewer . mailcap-maybe-eval)
      (type   . "application/emacs-lisp"))
     ("x-tar"
      (viewer . mailcap-save-binary-file)
      (type   . "application/x-tar"))
     ("x-latex"
      (viewer . tex-mode)
      (test   . (fboundp 'tex-mode))
      (type   . "application/x-latex"))
     ("x-tex"
      (viewer . tex-mode)
      (test   . (fboundp 'tex-mode))
      (type   . "application/x-tex"))
     ("latex"
      (viewer . tex-mode)
      (test   . (fboundp 'tex-mode))
      (type   . "application/latex"))
     ("tex"
      (viewer . tex-mode)
      (test   . (fboundp 'tex-mode))
      (type   . "application/tex"))
     ("texinfo"
      (viewer . texinfo-mode)
      (test   . (fboundp 'texinfo-mode))
      (type   . "application/tex"))
     ("zip"
      (viewer . mailcap-save-binary-file)
      (type   . "application/zip")
      ("copiousoutput"))
     ("pdf"
      (viewer . "acroread %s")
      (type   . "application/pdf"))
     ("postscript"
      (viewer . "open %s")
      (type   . "application/postscript")
      (test   . (eq (mm-device-type) 'ns)))
     ("postscript" 
      (viewer . "ghostview %s")
      (type . "application/postscript")
      (test   . (eq (mm-device-type) 'x))
      ("needsx11"))
     ("postscript"
      (viewer . "ps2ascii %s")
      (type . "application/postscript")
      (test . (not (getenv "DISPLAY")))
      ("copiousoutput")))
    ("audio"
     ("x-mpeg"
      (viewer . "maplay %s")
      (type   . "audio/x-mpeg"))
     (".*"
      (viewer . mm-view-sound-file)
      (test   . (or (featurep 'nas-sound)
		      (featurep 'native-sound)))
      (type   . "audio/*"))
     (".*"
      (viewer . "showaudio")
      (type   . "audio/*")))
    ("message"
     ("rfc-*822"
      (viewer . vm-mode)
      (test   . (fboundp 'vm-mode))
      (type   . "message/rfc-822"))
     ("rfc-*822"
      (viewer . w3-mode)
      (test   . (fboundp 'w3-mode))
      (type   . "message/rfc-822"))
     ("rfc-*822"
      (viewer . view-mode)
      (test   . (fboundp 'view-mode))
      (type   . "message/rfc-822"))
     ("rfc-*822" 
      (viewer . fundamental-mode)
      (type   . "message/rfc-822")))
    ("image"
     ("x-xwd"
      (viewer  . "xwud -in %s")
      (type    . "image/x-xwd")
      ("compose" . "xwd -frame > %s")
      (test    . (eq (mm-device-type) 'x))
      ("needsx11"))
     ("x11-dump"
      (viewer . "xwud -in %s")
      (type . "image/x-xwd")
      ("compose" . "xwd -frame > %s")
      (test   . (eq (mm-device-type) 'x))
      ("needsx11"))
     ("windowdump"
      (viewer . "xwud -in %s")
      (type . "image/x-xwd")
      ("compose" . "xwd -frame > %s")
      (test   . (eq (mm-device-type) 'x))
      ("needsx11"))
     (".*"
      (viewer . "aopen %s")
      (type   . "image/*")
      (test   . (eq (mm-device-type) 'ns)))
     (".*"
      (viewer . "xv -perfect %s")
      (type . "image/*")
      (test   . (eq (mm-device-type) 'x))
      ("needsx11")))
    ("text"
     ("plain"
      (viewer  . w3-mode)
      (test    . (fboundp 'w3-mode))
      (type    . "text/plain"))
     ("plain"
      (viewer  . view-mode)
      (test    . (fboundp 'view-mode))
      (type    . "text/plain"))
     ("plain"
      (viewer  . fundamental-mode)
      (type    . "text/plain"))
     ("enriched"
      (viewer . enriched-decode-region)
      (test   . (fboundp 'enriched-decode-region))
      (type   . "text/enriched"))
     ("html"
      (viewer . mm-w3-prepare-buffer)
      (test   . (fboundp 'w3-prepare-buffer))
      (type   . "text/html")))
    ("video"
     ("mpeg"
      (viewer . "mpeg_play %s")
      (type   . "video/mpeg")
      (test   . (eq (mm-device-type) 'x))
      ("needsx11")))
    ("x-world"
     ("x-vrml"
      (viewer  . "webspace -remote %s -URL %u")
      (type    . "x-world/x-vrml")
      ("description"
       "VRML document")))
    ("archive"
     ("tar"
      (viewer . tar-mode)
      (type . "archive/tar")
      (test . (fboundp 'tar-mode)))))


-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


  parent reply	other threads:[~2002-10-20 23:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-13 13:48 Karl Kleinpaste
1998-09-13 16:04 ` William M. Perry
2002-10-20 23:17 ` Lars Magne Ingebrigtsen [this message]
1998-09-13 18:48   ` Hallvard B Furuseth
1998-09-14  5:38     ` Lars Magne Ingebrigtsen
1998-09-16 13:22     ` Hrvoje Niksic
1998-09-16 14:43       ` Edward J. Sabol
1998-09-19 12:02         ` Lars Magne Ingebrigtsen
1998-09-13 19:13   ` Karl Kleinpaste
1998-09-13 20:05     ` William M. Perry
1998-09-13 20:15       ` Karl Kleinpaste
1998-09-13 16:35         ` Chris Halverson
1998-09-14  6:31         ` SL Baur
1998-09-14  5:44     ` Lars Magne Ingebrigtsen

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=m3iuisotk3.fsf@sparky.gnus.org \
    --to=larsi@gnus.org \
    /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).