 (defun svn-status-use-history ()
   "Interactively select a different directory from `svn-status-directory-history'."
   (interactive)
-  (let* ((hist (cdr svn-status-directory-history))
-         (dir (funcall (svn-status-completion-function) "svn-status on directory: " hist)))
+  (let* ((in-status-buffer (eq major-mode 'svn-status-mode))
+         (hist (if in-status-buffer (cdr svn-status-directory-history) svn-status-directory-history))
+         (dir (funcall svn-status-completing-read-function "svn-status on directory: " hist))
+         (svn-buffer-available (with-current-buffer (get-buffer svn-status-buffer-name) (string= default-directory dir))))
     (if (file-directory-p dir)
-        (progn
+        (if svn-buffer-available
+            (svn-status-switch-to-status-buffer)
           (unless svn-status-refresh-info
             (setq svn-status-refresh-info 'once))
           (svn-status dir))

  "Interactively set `svn-status-changelog-style'."
  (interactive)
  (setq svn-status-changelog-style
        (intern (funcall (svn-status-completion-function) "svn-status on directory: " '("changelog" "svn-dev" "other"))))
  (when (string= svn-status-changelog-style 'other)
      (setq svn-status-changelog-style (car (find-function-read))))
  (when (yes-or-no-p "Save the new setting for svn-status-changelog-style to disk? ")

  :type 'boolean
  :group 'psvn)

(defvar svn-status-completing-read-function
  (if svn-status-use-ido-completion 'ido-completing-read 'completing-read))

;;; experimental features
(defvar svn-status-track-user-input nil "Track user/password queries.
This feature is implemented via a process filter.
