lisp/server.el: Catch quit and close the connection (bug#8942).
authorJuanma Barranquero <lekktu@gmail.com>
Mon, 4 Jul 2011 22:40:03 +0000 (00:40 +0200)
committerJuanma Barranquero <lekktu@gmail.com>
Mon, 4 Jul 2011 22:40:03 +0000 (00:40 +0200)
lisp/ChangeLog
lisp/server.el

index 71fc929..6ec351d 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-04  Juanma Barranquero  <lekktu@gmail.com>
+
+       * server.el (server-execute): Catch quit and call
+       `server-return-error' to pass the error back to emacsclient and
+       close the connection (bug#8942).
+
 2011-07-04  Ken Manheimer  <ken.manheimer@gmail.com>
 
        * allout.el (allout-encrypt-unencrypted-on-saves): Do not provide
index 36b137b..c91f10b 100644 (file)
@@ -1153,7 +1153,10 @@ The following commands are accepted by the client:
                              "When done with a buffer, type \\[server-edit]")))))
           (when (and frame (null tty-name))
             (server-unselect-display frame)))
-      (error (server-return-error proc err)))))
+      ((quit error)
+       (when (eq (car err) 'quit)
+         (message "Quit emacsclient request"))
+       (server-return-error proc err)))))
 
 (defun server-return-error (proc err)
   (ignore-errors