Gnus development mailing list
 help / color / mirror / Atom feed
* Re: Good things to put in mailcap-mime-data for NT?
       [not found] <wtnpuo2ednu.fsf@licia.dtek.chalmers.se>
@ 2000-07-28  2:24 ` Rod Whitby
       [not found]   ` <wtnzomqnwa6.fsf@parmer.dtek.chalmers.se>
       [not found] ` <vafem4cdfew.fsf@lucy.cs.uni-dortmund.de>
  1 sibling, 1 reply; 7+ messages in thread
From: Rod Whitby @ 2000-07-28  2:24 UTC (permalink / raw)


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







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

* Re: Good things to put in mailcap-mime-data for NT?
       [not found]   ` <wtnvgxenw3j.fsf@parmer.dtek.chalmers.se>
@ 2000-08-06 19:31     ` Kai Großjohann
       [not found]       ` <wtnlmy3kfrk.fsf@licia.dtek.chalmers.se>
  0 siblings, 1 reply; 7+ messages in thread
From: Kai Großjohann @ 2000-08-06 19:31 UTC (permalink / raw)


On 06 Aug 2000, Jonas Steverud wrote:

> Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:
> 
>> application/msword; start %s
> 
> Since I rarely need to use .mailcap on Solaris I currently use this
> scheme but I have problems with files that contains a space.

Well, maybe this one does the trick.  But I don't use Windows.

application/msword; start "%s"

Maybe Gnus should run shell-quote-argument on the filename before
passing it to the command.

kai
-- 
I like BOTH kinds of music.



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

* Re: Good things to put in mailcap-mime-data for NT?
       [not found]   ` <wtnzomqnwa6.fsf@parmer.dtek.chalmers.se>
@ 2000-08-06 23:28     ` Rod Whitby
  0 siblings, 0 replies; 7+ messages in thread
From: Rod Whitby @ 2000-08-06 23:28 UTC (permalink / raw)


Jonas Steverud <d4jonas@dtek.chalmers.se> writes:
> Rod Whitby <list.ding@rwhitby.net> writes:
> > Jonas Steverud <d4jonas@dtek.chalmers.se> writes:
> > > Anyone that has some nice elisp/data to add to mailcap-mime-data for
> > > usage on WinNT?
> 
> [...]
> > 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:
> [...]
> > (defun mailcap-mswindows-shell-execute ()
> [...]
> > 	(mswindows-shell-execute "open" file)    
> 
> Is that a function that comes with XEmacs? I couldn't find it in
> NTEmacs/Gnus (I can't say wich version I use since I'm not at my
> office on a sunday evening...). Otherwise ot looks good code.

Yes, that's an XEmacs function.  But it should be available on all NT
Emacsen (or should be easy for someone to add if it's not).  I believe
it pretty much maps straight to a single Windows call.

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




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

* Re: Good things to put in mailcap-mime-data for NT?
       [not found]       ` <wtnlmy3kfrk.fsf@licia.dtek.chalmers.se>
@ 2000-08-11 21:06         ` Kai Großjohann
       [not found]           ` <wtnn1ifj4nb.fsf@licia.dtek.chalmers.se>
  0 siblings, 1 reply; 7+ messages in thread
From: Kai Großjohann @ 2000-08-11 21:06 UTC (permalink / raw)


On 11 Aug 2000, Jonas Steverud wrote:

> Didn't work:
> 
> Displaying start "c:/TEMP/emm.228xNB/127 02-.doc"...

And is `127 02-.doc' the right file name?  The trailing dash looks
suspicious.

Does it work to save the `127 02-.doc' file somewhere manually, then
open a DOS box and type `start "c:/path/to/dir/127 02-.doc"'?  If this
doesn't work, what command line do you need to have Word open the
file? 

A workaround might be to edit the message and to change the file name,
before invoking Word on it.

kai
-- 
I like BOTH kinds of music.



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

* Re: Good things to put in mailcap-mime-data for NT?
       [not found]           ` <wtnn1ifj4nb.fsf@licia.dtek.chalmers.se>
@ 2000-08-14 16:36             ` Kai Großjohann
       [not found]               ` <wtnlmxzq8pb.fsf@licia.dtek.chalmers.se>
  0 siblings, 1 reply; 7+ messages in thread
From: Kai Großjohann @ 2000-08-14 16:36 UTC (permalink / raw)


On 14 Aug 2000, Jonas Steverud wrote:

> Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:
> 
>> On 11 Aug 2000, Jonas Steverud wrote:
>> 
>> > Didn't work:
>> > 
>> > Displaying start "c:/TEMP/emm.228xNB/127 02-.doc"...
>> 
>> And is `127 02-.doc' the right file name?
> 
> It is.
> 
>> Does it work to save the `127 02-.doc' file somewhere manually,
>> then open a DOS box and type `start "c:/path/to/dir/127 02-.doc"'?
> 
> Nope.
> 
> It worked if I saved it to 12702-.doc and then did:
> 
> prompt> start 12702-.doc

Well.  Hm.  Does this work, too?

prompt> start "12702-.doc"

If this fails, then the quotes are a problem.  Hm.  I thought DOS
would accept quotes like this, but I know really nothing about DOS.

kai
-- 
I like BOTH kinds of music.



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

* Re: Good things to put in mailcap-mime-data for NT?
       [not found]               ` <wtnlmxzq8pb.fsf@licia.dtek.chalmers.se>
@ 2000-08-15  8:02                 ` Kai Großjohann
  2000-08-15  8:56                   ` Florian Weimer
  0 siblings, 1 reply; 7+ messages in thread
From: Kai Großjohann @ 2000-08-15  8:02 UTC (permalink / raw)


On 15 Aug 2000, Jonas Steverud wrote:

> I think we both are thinking in *nix-terms. Dos does *nothing* with
> the command line before passing it to the program.

I thought that COMMAND.COM did _almost_ nothing, the single exception
being double quote processing, which is needed for file names
containing spaces.

But then, I haven't seen DOS in a long while now, not even from afar.

kai
-- 
I like BOTH kinds of music.



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

* Re: Good things to put in mailcap-mime-data for NT?
  2000-08-15  8:02                 ` Kai Großjohann
@ 2000-08-15  8:56                   ` Florian Weimer
  0 siblings, 0 replies; 7+ messages in thread
From: Florian Weimer @ 2000-08-15  8:56 UTC (permalink / raw)


Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> > I think we both are thinking in *nix-terms. Dos does *nothing* with
> > the command line before passing it to the program.
> 
> I thought that COMMAND.COM did _almost_ nothing, the single exception
> being double quote processing, which is needed for file names
> containing spaces.

COMMAND.COM does nothing.  The DOS (and Windows) command line
consists of exactly one argument (at least the last time I looked,
approximately five years ago :-/).  Parsing is done entirely by the
application, and wildcard processing as well.



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

end of thread, other threads:[~2000-08-15  8:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <wtnpuo2ednu.fsf@licia.dtek.chalmers.se>
2000-07-28  2:24 ` Good things to put in mailcap-mime-data for NT? Rod Whitby
     [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

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