(skkdic-convert): Insert a relative
[bpt/emacs.git] / lisp / ediff-vers.el
index 6438b4b..9bbcf99 100644 (file)
@@ -1,6 +1,7 @@
 ;;; ediff-vers.el --- version control interface to Ediff
 
-;;; Copyright (C) 1995, 96, 97, 2002 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 1997, 2001, 2002, 2003, 2004,
+;;   2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 
@@ -18,8 +19,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
         )))
 ;; end pacifier
 
+(defcustom ediff-keep-tmp-versions nil
+  "*If t, do not delete temporary previous versions for the files on which
+comparison or merge operations are being performed."
+  :type 'boolean
+  :group 'ediff-vers
+  )
+
 ;; VC.el support
 
 (defun ediff-vc-latest-version (file)
@@ -86,8 +94,8 @@
              file2 (buffer-file-name)))
       (setq startup-hooks
            (cons `(lambda ()
-                    (delete-file ,file1)
-                    (or ,(string= rev2 "") (delete-file ,file2)))
+                    (ediff-delete-version-file ,file1)
+                    (or ,(string= rev2 "") (ediff-delete-version-file ,file2)))
                  startup-hooks)))
     (ediff-buffers
      rev1buf rev2buf
       (setq startup-hooks
            (cons
             `(lambda ()
-               (delete-file ,(buffer-file-name buf1))
+               (ediff-delete-version-file ,(buffer-file-name buf1))
                (or ,(string= rev2 "")
-                   (delete-file ,(buffer-file-name buf2)))
+                   (ediff-delete-version-file ,(buffer-file-name buf2)))
                (or ,(string= ancestor-rev "")
                    ,(not ancestor-rev)
-                   (delete-file ,(buffer-file-name ancestor-buf)))
+                   (ediff-delete-version-file ,(buffer-file-name ancestor-buf)))
                )
             startup-hooks)))
     (if ancestor-rev
          ((eq type 'MODIFIED)
           (ediff-buffers
            (find-file-noselect tmp-file)
-           (find-file-noselect (cvs-fileinfo->full-path fileinfo))
+           (if (featurep 'xemacs)
+               ;; XEmacs doesn't seem to have cvs-fileinfo->full-name
+               (find-file-noselect (cvs-fileinfo->full-path fileinfo))
+             (find-file-noselect (cvs-fileinfo->full-name fileinfo)))
            nil ; startup-hooks
            'ediff-revisions)))
-    (if (stringp tmp-file) (delete-file tmp-file))
-    (if (stringp ancestor-file) (delete-file ancestor-file))))
+    (if (stringp tmp-file) (ediff-delete-version-file tmp-file))
+    (if (stringp ancestor-file) (ediff-delete-version-file ancestor-file))))
+
+
+;; delete version file on exit unless ediff-keep-tmp-versions is true
+(defun ediff-delete-version-file (file)
+  (or ediff-keep-tmp-versions (delete-file file)))
+
+
+(provide 'ediff-vers)
+
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
 ;;; End:
 
-(provide 'ediff-vers)
-
+;;; arch-tag: bbb34f0c-2a90-426a-a77a-c75f479ebbbf
 ;;; ediff-vers.el ends here