[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: elisp shell command for opening the current dir in OS
From: |
Lennart Borgman |
Subject: |
Re: elisp shell command for opening the current dir in OS |
Date: |
Tue, 9 Jun 2009 00:51:01 +0200 |
On Mon, Jun 8, 2009 at 5:21 PM, Xah Lee<xahlee@gmail.com> wrote:
> On Jun 8, 7:25 am, rustom <rustompm...@gmail.com> wrote:
>> On Jun 8, 7:10 pm, Xah Lee <xah...@gmail.com> wrote:
>> > how to get emacs on windows to open the current dir the OS's file
>> > manager?
>>
>> > on os x, i just do
>> > (shell-command "open .")
>>
>> > On Windows Vista, i tried
>> > (shell-command "explorer .")
>> > which does the job but freezes emacs in the background until the
>> > folder is closed.
>
>> If you use w32-browser C-Ret does open and Alt-Ret does open
>> explorerhttp://www.emacswiki.org/emacs/w32-browser.el
>
> Thanks rustom. That does it.
>
> (defun open-in-desktop ()
> "Open the current file's folder in desktop."
> (interactive)
> (cond
> ((string-equal system-type "windows-nt") (w32-shell-execute
> "explore" "."))
> ((string-equal system-type "darwin") (shell-command "open ."))
> )
> )
>
> btw, just curious, if anyone would mod the code so it works on linuxes
> too.
I am not sure where I left this, but did you try sex-mode (included in
nXhtml)? I think that I in the end for consistency used functions from
org-mode for opening files.
If sex-mode is on certain files will be opened in external
applications by Emacs when you do for example find-file. This should
work under both windows and GNU/Linux.