[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: |
Richard M. Heiberger |
Subject: |
Re: [h-e-w] Converting cygwin path to windows path |
Date: |
Fri, 15 Feb 2002 04:08:14 -0500 (EST) |
The way I solve this problem is by localizing the relevant variable.
Here is an example to open windows explorer from within dired. I use this
to copy an entire directory tree with a single drag and drop in explorer.
The critical piece is in dos-canonical-name
(defun explorer-dired-find-file ()
"In dired, run the MS Windows Explorer on this file."
(interactive)
;; dired-get-filename is defined in dired.el
(w32-shell-execute nil "explorer" (concat "/e," (dos-canonical-name
(file-name-directory (w32-short-file-name (dired-get-filename)))))))
(define-key dired-mode-map "\C-c\C-e" 'explorer-dired-find-file)
(defun dos-canonical-name (filename)
"Canonicalize filename forcing `\\' as directory-sep-char."
(let ((directory-sep-char ?\ ))
(expand-file-name filename)))