Gnus development mailing list
 help / color / mirror / Atom feed
From: Rod Whitby <list.ding@rwhitby.net>
Subject: Re: Good things to put in mailcap-mime-data for NT?
Date: 28 Jul 2000 11:54:40 +0930	[thread overview]
Message-ID: <64zon36lg7.fsf@a11375-rw.asc.corp.mot.com> (raw)
In-Reply-To: Jonas Steverud's message of "Tue, 25 Jul 2000 11:56:37 +0200"

Jonas Steverud <d4jonas@dtek.chalmers.se> writes:
> Anyone that has some nice elisp/data to add to mailcap-mime-data for
> usage on WinNT? I have a .mailcap on h: but it's also ~ on our
> Solaris-system so I can't add anything Windows-specific stuff there (I
> know I can have tests in .mailcap but I want to avoid it).
> 
> As of now I can't view e.g. MS Word files without having to save them
> and then open them in Word.

What I do on XEmacs/NT to get around the whole problem of deciding
which application to launch is to get Windows to decide for me:

[This might be a useful function to add to mailcap.el ...]

(defun mailcap-mswindows-shell-execute ()
  (goto-char (point-min))
  (unwind-protect
      (let* ((dir (make-temp-name (expand-file-name "emm." mm-tmp-directory)))
	     (filename (mail-content-type-get
			(mm-handle-disposition handle) 'filename))
	     file buffer)
	;; We create a private sub-directory where we store our files.
	(make-directory dir)
	(set-file-modes dir 448)
	(if filename
	    (setq file (expand-file-name (file-name-nondirectory filename)
					 dir))
	  (setq file (make-temp-name (expand-file-name "mm." dir))))
	(message "Saving file %s ..." file)
	(let ((coding-system-for-write mm-binary-coding-system))
	  (write-region (point-min) (point-max) file nil 'nomesg))
	(message "Saving file %s ... done." file)
	(message "Loading application ...")
	(mswindows-shell-execute "open" file)    
	(message "Loading application ... done.")
	'external))
  (progn
    (ignore-errors (delete-file file))
    (ignore-errors (delete-directory
		    (file-name-directory file)))
    (ignore-errors (kill-buffer (current-buffer)))))

(mapcar
 (lambda (arg) (mailcap-add arg 'mailcap-mswindows-shell-execute))
 (list
  "application/dvi"
  "application/msword"
  "application/octet-stream"
  "application/pdf"
  "application/postscript"
  "application/ppt"
  "application/vnd.ms-excel"
  "application/vnd.ms-powerpoint"
  "application/x-mspowerpoint"
  "application/x-msword"
  "application/x-powerpoint"
  "application/x-zip-compressed"
  "application/zip"
  ))


-- 
-- Rod Whitby, Snr Staff Engr, Electronic Design Automation --
-- Motorola Australia Software Centre - Adelaide, Australia --
-- Phone: +61 8 8168 3526, Fax: +61 8 8168 3501, <GMT+9:30> --







       reply	other threads:[~2000-07-28  2:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <wtnpuo2ednu.fsf@licia.dtek.chalmers.se>
2000-07-28  2:24 ` Rod Whitby [this message]
     [not found]   ` <wtnzomqnwa6.fsf@parmer.dtek.chalmers.se>
2000-08-06 23:28     ` Rod Whitby
     [not found] ` <vafem4cdfew.fsf@lucy.cs.uni-dortmund.de>
     [not found]   ` <wtnvgxenw3j.fsf@parmer.dtek.chalmers.se>
2000-08-06 19:31     ` Kai Großjohann
     [not found]       ` <wtnlmy3kfrk.fsf@licia.dtek.chalmers.se>
2000-08-11 21:06         ` Kai Großjohann
     [not found]           ` <wtnn1ifj4nb.fsf@licia.dtek.chalmers.se>
2000-08-14 16:36             ` Kai Großjohann
     [not found]               ` <wtnlmxzq8pb.fsf@licia.dtek.chalmers.se>
2000-08-15  8:02                 ` Kai Großjohann
2000-08-15  8:56                   ` Florian Weimer

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=64zon36lg7.fsf@a11375-rw.asc.corp.mot.com \
    --to=list.ding@rwhitby.net \
    /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).