emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C-x C-c does nothing on frames created with "nowait" flag


From: Bo Lin
Subject: C-x C-c does nothing on frames created with "nowait" flag
Date: Sun, 11 Jan 2009 17:15:29 +0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Hi emacs-devel,

When connecting to a Emacs daemon using "emacsclient -n -c", pressing
C-x C-c in the newly created frame does nothing. It does not exit Emacs,
close the frame, or even give any visible feed-back, just nothing.
That's quite surprising, and at first I thought Emacs has hanged.

I think it should at least give a message, like so:

--- a/lisp/server.el
+++ b/lisp/server.el
@@ -1349,18 +1349,22 @@ With ARG non-nil, 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."
-  ;; save-buffers-kill-terminal occasionally calls us with proc set
-  ;; to `nowait' (comes from the value of the `client' frame parameter).
-  (when (processp proc)
-    (let ((buffers (process-get proc 'buffers)))
-      ;; If client is bufferless, emulate a normal Emacs session
-      ;; exit and offer to save all buffers.  Otherwise, offer to
-      ;; save only the buffers belonging to the client.
-      (save-some-buffers arg
-                         (if buffers
-                             (lambda () (memq (current-buffer) buffers))
-                           t))
-      (server-delete-client proc))))
+  (cond ((eq proc 'nowait)
+         ;; save-buffers-kill-terminal occasionally calls us with proc set
+         ;; to `nowait' (comes from the value of the `client' frame parameter).
+         (message "%s"
+                  (substitute-command-keys
+                   "No clients waiting. Type \\[save-buffers-kill-emacs] to 
kill Emacs or type \\[delete-frame] to delete this frame.")))
+        ((processp proc)
+          (let ((buffers (process-get proc 'buffers)))
+            ;; If client is bufferless, emulate a normal Emacs session
+            ;; exit and offer to save all buffers.  Otherwise, offer to
+            ;; save only the buffers belonging to the client.
+            (save-some-buffers arg
+                               (if buffers
+                                   (lambda () (memq (current-buffer) buffers))
+                                 t))
+            (server-delete-client proc)))))
 
 (define-key ctl-x-map "#" 'server-edit)
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]