[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: elisp shell command for opening the current dir in OS
From: |
rustom |
Subject: |
Re: elisp shell command for opening the current dir in OS |
Date: |
Mon, 8 Jun 2009 07:25:07 -0700 (PDT) |
User-agent: |
G2/1.0 |
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.
>
> I tried
> (shell-command "explorer . &")
> but that still leaves a running process.
> This is annoying when you call shell command again, cause it'll ask
> you if you want to kill previous instance.
>
> (shell-command "start explorer . ")
> seems to invoke cmd-shell.
>
> Thanks.
>
> Here's the function i'm trying to write:
>
> (defun open-in-desktop ()
> "Open the current file in desktop."
> (interactive)
> (let (cmdStr)
> (cond
> ((string-equal system-type "windows-nt") (setq cmdStr "explorer .
> &"))
> ((string-equal system-type "darwin") (setq cmdStr "open ."))
> )
> (shell-command cmdStr)
> )
> )
>
> Xah
> ∑http://xahlee.org/
>
> ☄
If you use w32-browser C-Ret does open and Alt-Ret does open explorer
http://www.emacswiki.org/emacs/w32-browser.el