[Top][All Lists]

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

Re: [h-e-w] Converting an emacs pathname to a windows pathname

From: David Vanderschel
Subject: Re: [h-e-w] Converting an emacs pathname to a windows pathname
Date: 26 Sep 2003 13:22:44 -0500

On Friday, September 26, "Dalton, Barnaby" <address@hidden> wrote:
>... I have come across 'convert-standard-filename'
>but as I have bash set as my shell this function
>won't do anything. ...

It sounds like you want to defeat the purpose of the
function w32-shell-dos-semantics, so you could just
redefine it to always return t when you are in any
context where you don't want it to be smart about

(require 'cl)
(flet ( (w32-shell-dos-semantics () t) ) 

See the appended code from Howard Melman which uses
convert-standard-filename in a very effective manner.
It would also need some sort of variation like the
above because it invokes the DOS shell directly.

  David V.


;; dired stuff to open files a la Windows from Howard Melman
(defun dired-execute-file (&optional arg)
  (interactive "P")
  (mapcar #'(lambda (file)
      (w32-shell-execute "open" (convert-standard-filename file)))
          (dired-get-marked-files nil arg)))

(defun dired-mouse-execute-file (event)
  "In dired, execute the file or goto directory name you click on."
  (interactive "e")
  (set-buffer (window-buffer (posn-window (event-end event))))
  (goto-char (posn-point (event-end event)))
  (if (file-directory-p (dired-get-filename))

(defun hrm-dired-mode-hook ()
  "Hook run when entering dired-mode."
    (define-key dired-mode-map "X"              'dired-execute-file)
    (define-key dired-mode-map [?\C-x mouse-2]  'dired-mouse-execute-file))

(add-hook 'dired-mode-hook 'hrm-dired-mode-hook)

reply via email to

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