[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [h-e-w] problem with dired and "start" command
From: |
David Vanderschel |
Subject: |
Re: [h-e-w] problem with dired and "start" command |
Date: |
26 Feb 2003 18:42:15 -0600 |
On Wednesday, February 26, "Michael W Daniels" <address@hidden> wrote:
>Under windows 98, I could use the "X" command in dired (run shell command
>on file) and type "start" to simulate the effect of double-clicking on the
>file's icon in explorer -- the same effect of actually typing "start
>filename" at a command prompt. Once I upgraded to win XP, this stopped
>working. Instead, I just get a command prompt with the filename as the
>window's title.
>...
>What do I need to change so that it generates
>start file.txt
>instead?
>(Alternatively, is there a way to create a keystroke command in dired that
>would use the win32 API ShellExecute to do the same thing?)
I use a different implementation of "X" in dired which
(though I have not tried it under XP) may well solve
the problem:
______________________________________________________________________
;; 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))
(dired-find-file)
(dired-execute-file)))
(global-set-key [?\C-x mouse-2] 'dired-mouse-execute-file)
(defun hrm-dired-mode-hook ()
"Hook run when entering dired-mode."
(define-key dired-mode-map "X" 'dired-execute-file))
(add-hook 'dired-mode-hook 'hrm-dired-mode-hook)
______________________________________________________________________
Regards,
David V.