From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Alberto_Sim=C3=B5es?= Newsgroups: gmane.emacs.help Subject: Re: Emacs, Mac OS X and opening from Shell Date: Fri, 25 Sep 2015 19:44:45 +0100 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1443206717 20305 80.91.229.3 (25 Sep 2015 18:45:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Sep 2015 18:45:17 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Chunyang Xu Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 25 20:45:02 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZfXzQ-0002r9-NO for geh-help-gnu-emacs@m.gmane.org; Fri, 25 Sep 2015 20:45:00 +0200 Original-Received: from localhost ([::1]:49973 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfXzQ-0000MO-7x for geh-help-gnu-emacs@m.gmane.org; Fri, 25 Sep 2015 14:45:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfXzD-0000L5-QS for help-gnu-emacs@gnu.org; Fri, 25 Sep 2015 14:44:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfXzC-0004W5-PQ for help-gnu-emacs@gnu.org; Fri, 25 Sep 2015 14:44:47 -0400 Original-Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]:34039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfXzC-0004Vf-HB for help-gnu-emacs@gnu.org; Fri, 25 Sep 2015 14:44:46 -0400 Original-Received: by wicfx3 with SMTP id fx3so33424183wic.1 for ; Fri, 25 Sep 2015 11:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=UJLPeKX5/z0CwPaV0lIBcRv+XLTx2hG3qSHANUkI1Vg=; b=EG33eRrf1rDpY2aEfLn/fgx6T2T1+PTDzk0TU7JGMvhBd9xgn0hP+ZrVl3Q+Uc8sgG EoHGSr8F0Pn3FTMBoobkiTU0DgMj+VIX+OHfK53y0Ri6dB8G4Ut86mHuaVAeGMM93qNx QmPIn26pLQNS6CmRBZvh7oi+BOuJkGlp/trll1T5E2zNpX4JG4hUxk14c21UVJxzZyib dK2Mv5Fr2Ch/iIrT9kOj3gYC4r+IX4j3dIByqEbwa+JG1HMQ8+zaUJLvKReWDsxKDQN/ cRm6LvGDeiPBu94YtsfgkoHdiR3BA2xZ6B1woALO2rSqRVoFizINrsjMU1iQDX1HAoLJ cb/w== X-Received: by 10.180.103.199 with SMTP id fy7mr4927289wib.85.1443206686013; Fri, 25 Sep 2015 11:44:46 -0700 (PDT) Original-Received: by 10.194.78.47 with HTTP; Fri, 25 Sep 2015 11:44:45 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::231 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:107354 Archived-At: Hi all, Sorry for posting at the top, but I think this is the correct place for this: as far as i can tell, the sh script I think is being executed, is not. So, sorry, as I wasn't really testing emacsclient :-( Best, Alberto On Fri, Sep 25, 2015 at 7:42 PM, Chunyang Xu wrote= : > > Alberto Sim=C3=B5es writes: > > > Dear Emacs users, > > > > I've been an Emacs user for some decades, but never a really emacs > hacker. > > In the latest months I've been using Sublime for Mac, but I am missing > > emacs a lot. > > > > So, in the come back, I am trying to make the emacs command to open an > > emacs window, if one is open, or opening a new buffer in the current > window > > (and focus that buffer if possible). > > open(1) works for me, for example, > > $ open -a Emacs ~/.emacs.d/init.el > > if *.el has been set Emacs as its default opening App, you can also omit > '-a Emacs': > > $ open ~/.emacs.d/init.el > > It should work out-of-box, i.e., no configuration needed from the Emacs > side, the following should works for you: > > # Start a fresh Emacs > $ open -a /Applications/Emacs.app -n --args -Q > # Open a file > $ open -a /Applications/Emacs.app ~/.emacs.d/init.el > > > BTW, emacsclient(1) works as well. After 'M-x server-start' from a GUI > Emacs window: > > $ emacsclient --no-wait ~/.emacs.d/init.el > > > Currently, my emacs command line is a shell script that looks like this= : > > > > /Applications/Emacs.app/Contents/MacOS/Emacs "$@" & > > > > This, of course, open a new window (although I usually close it, as the > > buffers are shared among windows). > > > > Any idea how I can make it behave as I described earlier? > > > > Thank you, > > Alberto > > -- > Chunyang Xu > --=20 Alberto Sim=C3=B5es