help-emacs-windows
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[h-e-w] Converting cygwin path to windows path


From: Joe Riel
Subject: [h-e-w] Converting cygwin path to windows path
Date: Tue, 12 Feb 2002 16:33:38 -0800

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)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]