I use Emacs for many things (the list seems to be growing every day). I like to have several frames open (so I can keep them in separate workspaces), so I first start it with emacs --daemon
and then connect various clients to it with emacsclient -t
.
One thing I have recently added to that list is writing papers. I write in Markdown, which allows easy version tracking with Git. In order to make it more readable, I usually split the frame into 3 or 4 windows vertically, and use follow-mode
to split the paper between them.
I recently ran into a problem with this setup. Emacs would randomly stop accepting connections, and any time I ran emacsclient -t
it would hang, never opening the frame. It took me a while to figure out why it happened, but I finally did. To reproduce:
- Start emacs with
emacs --daemon
- Connect the first client with
emacsclient -t <file>
where <file>
is some plaintext file.
- Activate follow-mode with
M-x follow-mode
- Attempt to connect another client with
emacsclient -t
. This client will hang and never connect.
Deactivating follow-mode after that point had no effect, clients were still unable to connect. If I never activate follow-mode, I never have a problem.
I also tried it without loading any init files (emacs --daemon --no-init-file --no-site-file
), with the same result.
I'm running GNU Emacs 23.4.1
, from the Ubuntu software repositories.
Why does this happen?