From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/31985 Path: main.gmane.org!not-for-mail From: Rod Whitby Newsgroups: gmane.emacs.gnus.general Subject: Re: Good things to put in mailcap-mime-data for NT? Date: 28 Jul 2000 11:54:40 +0930 Sender: owner-ding@hpc.uh.edu Message-ID: <64zon36lg7.fsf@a11375-rw.asc.corp.mot.com> References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035168335 17275 80.91.224.250 (21 Oct 2002 02:45:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:45:35 +0000 (UTC) Return-Path: Original-Received: from fisher.math.uh.edu (fisher.math.uh.edu [129.7.128.35]) by mailhost.sclp.com (Postfix) with ESMTP id 62E23D051E for ; Sun, 6 Aug 2000 15:06:30 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by fisher.math.uh.edu (8.9.1/8.9.1) with ESMTP id XAC22733; Sun, 30 Jul 2000 23:32:24 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sun, 30 Jul 2000 23:31:29 -0500 (CDT) Original-Received: from mailhost.sclp.com (postfix@[209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id XAA23658 for ; Sun, 30 Jul 2000 23:31:08 -0500 (CDT) Original-Received: from motgate.mot.com (motgate.mot.com [129.188.136.100]) by mailhost.sclp.com (Postfix) with ESMTP id 65102D051F for ; Mon, 31 Jul 2000 00:31:35 -0400 (EDT) Original-Received: [from mothost.mot.com (mothost.mot.com [129.188.137.101]) by motgate.mot.com (motgate 2.1) with ESMTP id VAA25112 for ; Sun, 30 Jul 2000 21:31:29 -0700 (MST)] Original-Received: [from fraser.asc.corp.mot.com (fraser.asc.corp.mot.com [217.1.104.8]) by mothost.mot.com (MOT-mothost 2.0) with ESMTP id VAA14142 for ; Sun, 30 Jul 2000 21:31:25 -0700 (MST)] Original-Received: from a11375-rw.asc.corp.mot.com.asc.corp.mot.com (a11375-rw [217.1.106.149]) by fraser.asc.corp.mot.com (8.8.7/8.8.7) with SMTP id OAA27886 for ; Mon, 31 Jul 2000 14:01:23 +0930 (CST) Original-To: ding@gnus.org In-Reply-To: Jonas Steverud's message of "Tue, 25 Jul 2000 11:56:37 +0200" Original-Lines: 67 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.2 (Molpe) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:31985 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:31985 Jonas Steverud 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, --