 
 This can be toggled with \\[svn-status-toggle-sort-status-buffer]."
   :type 'boolean
+  :group 'psvn)
+
+(defcustom svn-status-ediff-delete-temporary-files nil
+  "*Whether to delete temporary ediff files. If set to ask, ask the user"
+  :type '(choice (const t)
+                 (const nil)
+                 (const ask))
   :group 'psvn)
 
 (defcustom svn-status-changelog-style 'changelog

         (default-directory (svn-status-base-dir))
         (my-buffer (find-file-noselect (caar svn-status-get-specific-revision-file-info)))
         (base-buff (find-file-noselect (cdar svn-status-get-specific-revision-file-info)))
         (svn-transient-buffers (list base-buff))
         (startup-hook '(svn-ediff-startup-hook)))
    (ediff-buffers base-buff my-buffer startup-hook)))

(defun svn-ediff-startup-hook ()
  (add-hook 'ediff-after-quit-hook-internal
        `(lambda ()
           (svn-ediff-exit-hook
        ',ediff-after-quit-destination-buffer ',svn-transient-buffers))
        nil 'local))

(defun svn-ediff-exit-hook (svn-buf tmp-bufs)
  ;; kill the temp buffers (and their associated windows)
  (dolist (tb tmp-bufs)
    (when (and tb (buffer-live-p tb) (not (buffer-modified-p tb)))
      (let ((win (get-buffer-window tb t)))
    (when win (delete-window win))
    (kill-buffer tb))))
  ;; switch back to the *svn* buffer
  (when (and svn-buf (buffer-live-p svn-buf)
         (not (get-buffer-window svn-buf t)))
    (ignore-errors (switch-to-buffer svn-buf))))



        (let* ((ediff-after-quit-destination-buffer cur-buf)
               (newer-buffer (find-file-noselect upper-rev-file-name))
               (base-buff (find-file-noselect lower-rev-file-name))
               (svn-transient-buffers (list base-buff newer-buffer))
               (startup-hook '(svn-ediff-startup-hook)))
          (ediff-buffers base-buff newer-buffer startup-hook))
      (message "No file at point"))))
