0

In my .emacs I have (server-start).

In my .bashrc I have:

export ALTERNATE_EDITOR="emacs-snapshot"
export VISUAL="emacsclient-snapshot -c"

When I run emacsclient -c EXISTING-FILE on the command line, I start a new Emacs, rather than connecting to the existing one. What am I doing wrong, and how can I change it so that emacsclient finds the existing Emacs?


To confirm that there really are two processes: in a shell within the original Emacs:

$ ps -A | grep emacs
24646 tty2     00:00:03 emacs-snapshot
24658 ?        00:00:00 emacsql-sqlite

In the new one launched by emacsclient:

$ ps -A | grep emacs
24646 tty2     00:00:03 emacs-snapshot
24658 ?        00:00:00 emacsql-sqlite
24839 pts/0    00:00:03 emacs-snapshot
24897 ?        00:00:00 emacsql-sqlite

Is this pts/0 a clue?

  • emacsclient -c creates a new frame but uses the existing emacs: there should be no new emacs process running. How do you check that it's a new emacs? – NickD Jun 26 at 20:35
  • It runs my .emacs init script. – Joe Corneli Jun 26 at 20:39
  • Weird. You are sure it's not the same process rerunning your init file (although I certainly cannot imagine how that would happen)? There are two emacs processess running with different pids? – NickD Jun 27 at 2:01
0

It looks like I get it to behave as expected with this config:

export ALTERNATE_EDITOR=""
export VISUAL="/usr/bin/emacsclient-snapshot -c"
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.