 (defvar mural-server-path "mural_server"
   "Path to the mural_server executable")
 
+(defvar mural-server-echo nil
+  "echo server responses to *muralserver* buffer")
 (defvar mural-server-process nil)
 (defvar mural-server-output "")
 (defvar ido-dynamic-match-fn nil)

      (process-send-string (process-name (mural-get-server))
                           (concat query "\n"))

      ;; Wait up to 2/10 of a second
      (loop for i from 1 to 20
            until (mural-response-complete mural-server-output)
            do (accept-process-output mural-server-process .01))
      (if (not (mural-response-complete mural-server-output))
          (progn
            (kill-process (mural-get-server))
            (setq mural-server-process nil
                  mural-server-output "")
            (error "failed to get response from server")))
      (mural-parse-response mural-server-output))))

(defun mural-parse-response (results)
  (mapcar (lambda (x) (substring x (length "MATCH ")))

    (set-process-filter
     proc
     (lambda (process output)
       (with-current-buffer (process-buffer process)
         (save-excursion
           (if mural-server-echo
               (progn
                 (goto-char (process-mark process))
                 (insert output)
                 (set-marker (process-mark process) (point))))
           (setq mural-server-output (concat mural-server-output output))))))
     proc))

(defun mural-query (query)
  (if (equal "" query)
