From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: Executing External Programs from Emacs Date: Sat, 14 Feb 2009 06:47:36 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <1a12217a-86cb-4088-8fd1-731ce415e68a@z28g2000prd.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 1234633756 9618 80.91.229.12 (14 Feb 2009 17:49:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Feb 2009 17:49:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 14 18:50:29 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 1LYOeo-0005T3-Hb for geh-help-gnu-emacs@m.gmane.org; Sat, 14 Feb 2009 18:50:26 +0100 Original-Received: from localhost ([127.0.0.1]:56492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LYOdR-0002hO-Rc for geh-help-gnu-emacs@m.gmane.org; Sat, 14 Feb 2009 12:49:01 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!v39g2000pro.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 55 Original-NNTP-Posting-Host: 24.6.175.142 Original-X-Trace: posting.google.com 1234622856 331 127.0.0.1 (14 Feb 2009 14:47:36 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 14 Feb 2009 14:47:36 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v39g2000pro.googlegroups.com; posting-host=24.6.175.142; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:166818 comp.emacs:97793 X-Mailman-Approved-At: Sat, 14 Feb 2009 12:48:40 -0500 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:62129 Archived-At: On Feb 13, 10:48 pm, dstein64 wrote: > Are there any functions that can launch external programs (not just > command line programs, but also GUI programs) from Emacs? I know that > I can access a shell, and call a program from there, but then emacs is > not operable until I close the program. Prepending the command with > `nohup' is useful, but for some reason it does not work as expected > with all programs, including emacs. I would prefer another way of > doing this - using a specific built-in of emacs lisp if one exists. > Any help would be greatly appreciated. Thanks. if you OS support command line to open the gui app, then you can just use emacs's shell-command. e.g. in mac os x, to open TextEdit, do (shell-command "open -a TextEdit") Q: How to open the current directory in Desktop? You can define a function and assign it a keyboard shortcut, so that by pressing a button, emacs will switch you to your operating systems's file manager (aka Desktop) with the current directory open. On the Mac OS X, this is done with the =E2=80=9C/usr/bin/open=E2=80=9D comm= and. So, press =E2=80=9CAlt+! open .=E2=80=9D to have Finder open the current direct= ory. You can define the function this way: (defun open-with-finder () "Open the current file in Mac's Finder." (interactive) (shell-command "open .")) (global-set-key (kbd "") 'open-with-finder) For a documentation of OS X's =E2=80=9Copen=E2=80=9D command, see =E2=80=9C= man open=E2=80=9D. On Microsoft Windows, you can use =E2=80=9Cexplorer.exe=E2=80=9D instead of= the =E2=80=9Copen=E2=80=9D command. the above is from =E2=80=A2 Emacs and HTML Tips http://xahlee.org/emacs/emacs_html.html see also: =E2=80=A2 Elisp Lesson: Execute/Compile Current File http://xahlee.org/emacs/elisp_run_current_file.html Xah =E2=88=91 http://xahlee.org/ =E2=98=84