From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.help Subject: Re: elisp shell command for opening the current dir in OS Date: Tue, 9 Jun 2009 00:51:01 +0200 Message-ID: References: <607143dd-cd00-46e5-b8aa-85d6cf37478d@37g2000yqp.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1244501500 21987 80.91.229.12 (8 Jun 2009 22:51:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Jun 2009 22:51:40 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Xah Lee Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 09 00:51:38 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MDngk-0000G0-Ll for geh-help-gnu-emacs@m.gmane.org; Tue, 09 Jun 2009 00:51:34 +0200 Original-Received: from localhost ([127.0.0.1]:53029 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MDngj-00041h-Ub for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Jun 2009 18:51:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MDngK-0003zt-9c for help-gnu-emacs@gnu.org; Mon, 08 Jun 2009 18:51:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MDngF-0003qo-Ug for help-gnu-emacs@gnu.org; Mon, 08 Jun 2009 18:51:08 -0400 Original-Received: from [199.232.76.173] (port=40593 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MDngF-0003qZ-JH for help-gnu-emacs@gnu.org; Mon, 08 Jun 2009 18:51:03 -0400 Original-Received: from mail-bw0-f212.google.com ([209.85.218.212]:53210) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MDngF-0000dY-1k for help-gnu-emacs@gnu.org; Mon, 08 Jun 2009 18:51:03 -0400 Original-Received: by bwz8 with SMTP id 8so1746232bwz.42 for ; Mon, 08 Jun 2009 15:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=bPkxPGr4fxyF8/aKVLjejBh6VS5/6mLEHaW6iqwrZkg=; b=bNTYz8xv/6McTM7of0Gi8KmMlUOuYvrNPDwiGgFQu8U2zB+NQp2lD1U28R7pPg/SPw /dEZdJAUmIK7qzKQbh1VqdW0m9+WoUHVUQyo8QJepNDDFsdrPLPfZ7mex10L+6s/MsKg 9hzJLg323JekKSn8IOi+BtBD2VcElX7CAJ6hI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=e5b39Du5mrkCEgKPkhsVKI3kvNX6aeOVIMI4NZRYNTWB2WvbA3ORDMQvYygRo1Vz4F 4cnl2mOJ2iAQ9L6zxzUzxifhX/UsWwjQkgg8qPXw4Qr12bQlTRE0RndUaccB4vyANr2c FxDS1v5XJD+G1fMXr2yK2A1RvsdxENnpcEXcI= Original-Received: by 10.239.136.194 with SMTP id i2mr550580hbi.76.1244501461776; Mon, 08 Jun 2009 15:51:01 -0700 (PDT) In-Reply-To: <607143dd-cd00-46e5-b8aa-85d6cf37478d@37g2000yqp.googlegroups.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:65067 Archived-At: On Mon, Jun 8, 2009 at 5:21 PM, Xah Lee wrote: > On Jun 8, 7:25 am, rustom wrote: >> On Jun 8, 7:10 pm, Xah Lee 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 explorerhtt= p://www.emacswiki.org/emacs/w32-browser.el > > Thanks rustom. That does it. > > (defun open-in-desktop () > =C2=A0"Open the current file's folder in desktop." > =C2=A0(interactive) > =C2=A0(cond > =C2=A0 =C2=A0 ((string-equal system-type "windows-nt") (w32-shell-execute > "explore" ".")) > =C2=A0 =C2=A0 ((string-equal system-type "darwin") (shell-command "open .= ")) > =C2=A0 =C2=A0 ) > =C2=A0) > > 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.