]> git.eshelyaron.com Git - emacs.git/commitdiff
(server-process-filter): Cancel any pending isearch.
authorJuanma Barranquero <lekktu@gmail.com>
Wed, 21 Mar 2007 12:02:32 +0000 (12:02 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Wed, 21 Mar 2007 12:02:32 +0000 (12:02 +0000)
lisp/server.el

index f03c802bb7716bda36e7efa1552928ea7ed2a443..690f51034f2c814a3eebaac445390b8a83f87546 100644 (file)
@@ -414,6 +414,16 @@ PROC is the server process.  Format of STRING is \"PATH PATH PATH... \\n\"."
     (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)