Fork me on GitHub

Mac users: how are you launching Spacemacs from command line? I found this gist on Emacs Mac Port Readme, but not sure if that's the smoothest way. emacs --version doesn't work for example. But it does a good job or reusing the launched instance. (I still need to learn more about emacsclient and server)


I should probably say that I renamed to ~/bin/emacs and it's on my path


@naartjie: spacemacs supports emacs daemon, you don’t have to do anything… one thing though… os x comes with its emacsclient pre-installed. run which emacsclient and see where it’s pointing


and if you want to open file with emacsclient in the same frame, this little script might come handy:


I’m kind of curious now: is it possible to get the non-CLI version to connect to an emacs daemon? I’d much rather have the daemon in the background and be able to connect to it from the shell and from the graphics app (which is what I use primarily).


@akiva as I said: Spacemacs supports daemon, you also have an option to keep it running when closing all frames. check dotspacemacs-persistent-server variable in .spacemacs


@ag, I knew it does; I just wasn’t sure how to get the graphical client to connect to it.


@akiva if you installed Emacs app through brew, make sure that emacsclient points to the right one, not the one that’s pre-included in OS X


if you installed it via other means it should be in /Applications/


@ag, right. But that’s for the command line only, isn’t it?


(I installed through brew.)


@akiva emacsclient can open files in GUI. check the gist I posted earlier. I think the -c switch does the trick


I’ll check that out.


Unfortunately, no. It still opens Emacs in the shell.


@ag: Thanks for all that info. The script in the gist works so long as I have (i.e. the GUI) launched already (via running open /Applications/, otherwise opens the file inside the terminal. Should I just set up an alias start-emacs="open /Applications/" and run that when I start using emacs, then subsequently I can use to open files after that?


honestly, usually when I run Emacs I keep in on all the time. that script could be modified to check if emacs already running. maybe using lsof -i | grep emacs or something else