The reason why I ask is for most thing they appear similar, except when using Thunderbird External Editor Extension (with editor designated as emacsclient -c). Closing the frame created with this emacsclient instance with C-x C-c (C-x # does not work sometimes?) will also kill the buffer associated with this frame (not the usual emacsclient behavior).

And, in general, C-x C-c will just close the frame unless another buffer is visited in that frame -- after this, C-x C-c will try to close all of emacs. How do I try to understand this behavior?

link|improve this question

69% accept rate
feedback

1 Answer

From Emacs, you can get help for any key by pressing C-h k and then entering the key combination that you want to know about. Pressing C-h k C-x # returns this:

C-x # runs the command server-edit, which is an interactive compiled Lisp function in `server.el'.

It is bound to C-x #.

(server-edit &optional ARG)

Switch to next server editing buffer; say "Done" for current buffer. If a server buffer is current, it is marked "done" and optionally saved. The buffer is also killed if it did not exist before the clients asked for it. When all of a client's buffers are marked as "done", the client is notified.

Temporary files such as MH files are always saved and backed up, no questions asked. (The variable 'make-backup-files', if nil, still inhibits a backup; you can set it locally in a particular buffer to prevent a backup for it.) The variable 'server-temp-file-regexp' controls which filenames are considered temporary.

If invoked with a prefix argument, or if there is no server process running, starts server process and that is all. Invoked by C-x #. C-x # runs the command server-edit, which is an interactive compiled Lisp function in 'server.el'.

Similarly for C-x C-c

C-x C-c runs the command save-buffers-kill-terminal, which is an interactive compiled Lisp function in `files.el'.

It is bound to C-x C-c, .

(save-buffers-kill-terminal &optional ARG)

Offer to save each buffer, then kill the current connection. If the current frame has no client, kill Emacs itself.

With prefix ARG, silently save all file-visiting buffers, then kill.

If emacsclient was started with a list of filenames to edit, then only these files will be asked to be saved.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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