Subject: bug#8942: 23.3; emacsclient doesn't exit when called Emacs function is quited.

From: Juanma Barranquero <[email-masked]>
Date: Mon, 4 Jul 2011 16:41:58 +0200

On Mon, Jul 4, 2011 at 16:32, Stefan Monnier <[email-masked]> wrote:

> Returning a -error would be fine, yes.

But if server-execute catches quit, the whole with-local-quit is not
necessary anymore, is it?

I mean, this patch (shown with -b) fixes the bug report. But when the
user types Ctrl-G in Emacs, he has less feedback because he doesn't
see the "Quit" message anymore.

    Juanma

=== modified file 'lisp/server.el'
--- lisp/server.el	2011-07-04 01:04:29 +0000
+++ lisp/server.el	2011-07-04 14:37:13 +0000
@@ -1121,7 +1121,6 @@
   ;; inhibit-quit flag, which is good since `commands' (as well as
   ;; find-file-noselect via the major-mode) can run arbitrary code,
   ;; including code that needs to wait.
-  (with-local-quit
     (condition-case err
         (let* ((buffers
                 (when files
@@ -1153,7 +1152,7 @@
                              "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) (server-return-error proc err))))

 (defun server-return-error (proc err)
   (ignore-errors