help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs, Mac OS X and opening from Shell


From: Chunyang Xu
Subject: Re: Emacs, Mac OS X and opening from Shell
Date: Sat, 26 Sep 2015 02:42:31 +0800
User-agent: mu4e 0.9.12-1c98835; emacs 25.0.50.9

Alberto Simões 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]