all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Xah Lee <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: elisp shell command for opening the current dir in OS
Date: Mon, 8 Jun 2009 07:10:03 -0700 (PDT)	[thread overview]
Message-ID: <b7372c59-20ec-4538-a350-a76426ca4e52@l12g2000yqo.googlegroups.com> (raw)

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/

             reply	other threads:[~2009-06-08 14:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-08 14:10 Xah Lee [this message]
2009-06-08 14:25 ` elisp shell command for opening the current dir in OS rustom
2009-06-08 15:21   ` Xah Lee
2009-06-08 22:51     ` Lennart Borgman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7372c59-20ec-4538-a350-a76426ca4e52@l12g2000yqo.googlegroups.com \
    --to=xahlee@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.