[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [h-e-w] Converting cygwin path to windows path
From: |
Malcolm Cook |
Subject: |
RE: [h-e-w] Converting cygwin path to windows path |
Date: |
Tue, 12 Feb 2002 23:27:12 -0800 |
cygpath should do it
see http://cygwin.com/cygwin-ug-net/using-utils.html#CYGPATH
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden Behalf Of Joe Riel
> Sent: Tuesday, February 12, 2002 4:34 PM
> To: NTEmacs
> Subject: [h-e-w] Converting cygwin path to windows path
>
>
> How do I convert a cygwin path (with forward slashes)
> to the equivalent windows/dos path (with backslashes)?
>
> In my .emacs file I use the following so that, in dired, I can
> launch a windows application.
> Usually it works as is, however, for some path names it fails.
> Converting the forward slashes
> to backslashes will work, is there a predefined procedure that does so?
>
> Thanks,
>
> Joe Riel
>
> (defun w32-shell-execute-verb (&optional verb)
> "Call w32-shell-execute on 'current' file (mode dependent)."
> (interactive)
> (if (eq major-mode 'dired-mode)
> (let ((file (dired-get-filename)))
> (dired-map-over-marks (w32-shell-execute verb file) ()))
> (w32-shell-execute verb (buffer-file-name))))
>
> (define-key global-map [(apps)] 'w32-shell-execute-verb)
>
> (defun w32-shell-execute-buffer-choose (verb)
> "Choose verb to apply to shell-execute. Valid verbs may be \"open\",
> \"print\", \"explore\" etc. Right click on a file to get hints, but the
> verbs themselves are stored in the registry mostly under
> HKEY_CLASSES_ROOT."
> (interactive "sVerb: ")
> (w32-shell-execute-verb verb))
>
> (define-key global-map [(shift apps)] 'w32-shell-execute-buffer-choose)
>
>
>
>
>