As a standalone instance (without daemon mode) I close my emacs via C-x C-c (save-buffers-kill-terminal).

This works also with emacsclient and I see no problem about that.

But the manpage of emacsclient tells me that I should close a session via C-x # (server-edit).

And when I start emacsclient the minibuffer informs me that When done with this frame, type C-x 5 0. Which would be delete-frame-functions.

So I see 3 kinds of "closing". What are the differences and which one should I use?

I have read the documentation of all three functions but I do not understand them. There are some relevant questions and answers to this topic. But I can not bring them together. I assume the reason is that I lack a lot of emacs basic knowledge that would be relevant to understand the answers.

Maybe relevant:

  • 2
    Does this answer your question? Why emacsclient say to quit with C-x 5 0?
    – phils
    Commented Feb 7, 2022 at 21:56
  • 1
    See also stackoverflow.com/questions/21317065/…
    – phils
    Commented Feb 7, 2022 at 22:05
  • 1
    Note that buffers can be explicitly associated with clients, usually by specifying their filenames on the command line with emacsclient FILE1 FILE2 ..., and therefore telling the server that you are "done" with a given buffer is information that Emacs can act upon.
    – phils
    Commented Feb 7, 2022 at 22:11
  • C-x 5 0 is delete-frame which "runs delete-frame-functions before actually deleting the frame" (from docstring).
    – JeanPierre
    Commented Feb 13, 2022 at 20:21


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.