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

[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: Dalton, Barnaby
Subject: RE: [h-e-w] Converting an emacs pathname to a windows pathname
Date: Mon, 29 Sep 2003 10:01:02 +0100

Thanks, this looks like the path of least code duplication. Of course it
would be nice if convert-standard-filename made use of a helper function to
do the conversion, I could then call that helper function directly instead
of having to lie to convert-standard-filename about my shell.

Barney

> -----Original Message-----
> From: David Vanderschel [mailto:address@hidden
> Sent: 26 September 2003 7:23 PM
> To: address@hidden
> Subject: Re: [h-e-w] Converting an emacs pathname to a 
> windows pathname
> 
> 
> 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
> bash.
> 
> (require 'cl)
> (flet ( (w32-shell-dos-semantics () t) ) 
>   BODY
>   )
> 
> 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.
> 
> Regards,
>   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))
>       (dired-find-file)
>     (dired-execute-file)))
> 
> (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)
> 
> 
> 


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
address@hidden

This footnote also confirms that this email message has been scanned
for the presence of computer viruses known at the time of sending.

www.radioscape.com
**********************************************************************





reply via email to

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