I recently installed Emacs 23 (on OS X Leopard) and trying out the emacs server. I have tried both ways: (1) putting (server-start) in my .emacs file, and (2) running emacs –daemon at the terminal (in separate trials; not at the same time). In either case, when I have an emacs frame already open and try to open a separate file in the OS X terminal using emacsclient -t, -tty, or -nw, the file always opens in an existing frame rather than in the terminal as described:
http://www.gnu.org/software/emacs/manual/html_node/emacs/emacsclient-Options.html
http://emacs-fu.blogspot.com/2009/02/emacs-daemon.html
However, emacsclient -c works as expected. Do you have any ideas what may be happening?
Thanks much! -Stephen
Thanks all for your suggestions and responses – I think my solution is to add the following to my .bash_profile:
I tried using emacs –daemon and replacing the Emacs.app with Emacs Client.app icon as suggested by
http://www.cubiclemuses.com/cm/articles/2009/07/30/emacs-23-for-os-x/
but (1) the daemon did not seem to load many of my .emacs customizations and (2) when I would quit Emacs Client it would quit Emacs altogether and generate errors…
So my solution is to use the bash aliases as defined above; add the line, (server-start), to my .emacs file, and add the Emacs.app icon to my OS X dock so that I can use either the icon or one of the aliases to launch emacs, and to open new files in the running instance I can also use the aliases above or C-x C-f (or C-x b) in Emacs.