]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/server.el (server-eval-and-print): Allow C-g.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 22 Nov 2011 15:18:56 +0000 (10:18 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 22 Nov 2011 15:18:56 +0000 (10:18 -0500)
Fixes: debbugs:6585
lisp/ChangeLog
lisp/server.el

index 37ecd3e685216ee1cb134aa5838d21ca46340843..b30f9dcfab5d87c9d0fce1e8861a6eb96a6eebf1 100644 (file)
@@ -1,3 +1,7 @@
+2011-11-22  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * server.el (server-eval-and-print): Allow C-g (bug#6585).
+
 2011-11-22  Glenn Morris  <rgm@gnu.org>
 
        * mail/rmailmm.el (test-rmail-mime-handler)
index bc989c55ed1c9779bab47936791d7729d7dbfdd8..e02f63a8268ef15391ee1a5ad682ece2e713d216 100644 (file)
@@ -685,7 +685,14 @@ Server mode runs a process that accepts commands from the
 \f
 (defun server-eval-and-print (expr proc)
   "Eval EXPR and send the result back to client PROC."
-  (let ((v (eval (car (read-from-string expr)))))
+  ;; While we're running asynchronously (from a process filter), it is likely
+  ;; that the emacsclient command was run in response to a user
+  ;; action, so the user probably knows that Emacs is processing this
+  ;; emacsclient request, so if we get a C-g it's likely that the user
+  ;; intended it to interrupt us rather than interrupt whatever Emacs
+  ;; was doing before it started handling the process filter.
+  ;; Hence `with-local-quit' (bug#6585).
+  (let ((v (with-local-quit (eval (car (read-from-string expr))))))
     (when proc
       (with-temp-buffer
         (let ((standard-output (current-buffer)))