     (setq sayid-trace-ns-dir input)
     input))
 
+(defun sayid-find-a-window ()
+  (or (get-buffer-window (car sayid-buf-spec) 'visible)
+      (get-buffer-window (car sayid-traced-buf-spec) 'visible)
+      (get-buffer-window (car sayid-pprint-buf-spec) 'visible)))
+
+(defun sayid-pop-to-buffer-reuse-visible-sayid (buf-name-)
+  (let ((w (sayid-find-a-window)))
+    (if w
+        (progn
+          (get-buffer-create buf-name-)
+          (set-window-buffer w buf-name-)
+          (select-window w))
+      (pop-to-buffer buf-name-))))
+
 (defun sayid-init-buf ()
   (let ((buf-name- (car sayid-selected-buf)))
-    (pop-to-buffer buf-name-)
+    (sayid-pop-to-buffer-reuse-visible-sayid buf-name-)
+    
     (update-buf-pos-to-ring)
     (read-only-mode 0)
     (erase-buffer)

      (if id-at-point
          (try-goto-prop 'id id-at-point)
        (goto-char 1)))
    (pop-to-buffer orig-buf)))

(defun colorize ()
  (interactive)


(defun sayid-pprint-buf-exit ()
  (interactive)
  (sayid-pop-to-buffer-reuse-visible-sayid (car sayid-buf-spec)))

(defun sayid-get-views ()
  (sayid-req-get-value '("op" "sayid-get-views")))
