4

I've started using the emacsclient more along with the daemon, and I'm a huge fan, but it's started giving me trouble when I reboot my computer. After reboot when I open up a new emacsclient, I don't get the usual daemon startup stuff in my terminal. Then once the window opens, I am unable to input anything to the minibuffer. Any time I try typing, for example M-x or C-x C-f, I get an error message reading Error reading from stdin.

Killing emacs with pkill emacs and restarting fixes the issue, but I'd rather not have it in the first place. How can I tell the daemon to die, or clean up after itself, when I'm rebooting my computer? If it makes any difference, I'm on OpenSUSE 13.2 with KDE.

  • The daemon definitely dies when you reboot your computer, and there should be no need to clean up. How are you starting the daemon? – T. Verron May 28 '15 at 21:29
  • I start the daemon with emacsclient &. I have export ALTERNATE_EDITOR="" and export EDITOR=emacsclient in my .bashrc file. – Ryan May 28 '15 at 23:06
  • 1
    Wow, I had no idea that starting the daemon was that simple nowadays... Anyway, your problem looks like you have a script running at system/session start-up and spawning a (non-functional for some reason) daemon. – T. Verron May 29 '15 at 5:17
  • I would use "emacs --daemon" to start the daemon, instead. – YoungFrog May 29 '15 at 13:54
  • I recently got the same error message; my issue was a line in my .emacs that was trying to (setcdr var 'foo) where var was nil, but I didn't see the error message until I tried starting emacs as emacs --debug-init instead of using emacsclient – the server/client is a bit finicky like that. – unhammer Jun 29 '16 at 12:03
1

Following the comment of T. Verron, I determined that it was the following lines from my .emacs that caused the issue:

(require 'server)
(or (server-running-p)
    (server-start))

I've used this on Windows to allow me to open a file in an existing frame, but it's only needed there, as far as I can tell, because there is currently no Windows --daemon.

  • This alone shouldn't be a problem. – T. Verron May 29 '15 at 16:38
  • Well, I'm not sure, but removing it fixed my problem. Maybe it was a combination of this and the way I was starting my daemon. – Ryan May 29 '15 at 18:04

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.