Emacs Client: difference between C-x k and C-x #

前端 未结 2 604
南方客
南方客 2021-01-25 16:29

When running emacs in daemon with a client and I hit C-x k, it says: Emacs buffer still has clients. Are you sure you want to quit?

But when using C-x #, it exits immedi

2条回答
  •  没有蜡笔的小新
    2021-01-25 17:19

    I can't write a better explanation of C-x# than Emacs already gives you. Just type C-hkC-x#

    I assume that C-xk warns you because you're not using the mechanism for telling the client explicitly that you're done, and as you might be trying to kill the buffer from any Emacs frame (and unless you're running Emacs as a daemon, there are going to be non-client frames), it makes sure you're aware that the buffer is associated with a client somewhere.

    The query itself comes from server-kill-buffer-query-function which is added to kill-buffer-query-functions, and probably has no way of telling where the kill was issued from. It has the following comments:

    ;; Ask before killing a server buffer.
    ;; It was suggested to release its client instead,
    ;; but I think that is dangerous--the client would proceed
    ;; using whatever is on disk in that file. -- rms.
    

提交回复
热议问题