diff lisp/server.el @ 76648:ab479de41b29

(server-process-filter): Cancel any pending isearch.
author Juanma Barranquero <lekktu@gmail.com>
date Wed, 21 Mar 2007 12:02:32 +0000
parents 09eed2796001
children 9355f9b7bbff 79cdba83d213 738ce3540ffb c0409ee15cee
line wrap: on
line diff
--- a/lisp/server.el	Wed Mar 21 07:15:44 2007 +0000
+++ b/lisp/server.el	Wed Mar 21 12:02:32 2007 +0000
@@ -414,6 +414,16 @@
     (run-with-timer 0 nil (lexical-let ((proc proc))
                             (lambda () (server-process-filter proc ""))))
     (top-level))
+  (condition-case nil
+      ;; If we're running isearch, we must abort it to allow Emacs to
+      ;; display the buffer and switch to it.
+      (mapc #'(lambda (buffer)
+		(with-current-buffer buffer
+		  (when (bound-and-true-p isearch-mode)
+		    (isearch-cancel))))
+	    (buffer-list))
+    ;; Signaled by isearch-cancel
+    (quit (message nil)))
   ;; If the input is multiple lines,
   ;; process each line individually.
   (while (string-match "\n" string)