Add some new stuff, and fix dates of merge entries.
[bpt/emacs.git] / lisp / ediff.el
index 69717ca..6abcb24 100644 (file)
@@ -1,21 +1,26 @@
 ;;; ediff.el --- a comprehensive visual interface to diff & patch
 
 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-;;   2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Created: February 2, 1994
 ;; Keywords: comparing, merging, patching, tools, unix
 
+;; Yoni Rabkin <yoni@rabkins.net> contacted the maintainer of this
+;; file on 20/3/2008, and the maintainer agreed that when a bug is
+;; filed in the Emacs bug reporting system against this file, a copy
+;; of the bug report be sent to the maintainer's email address.
+
 (defconst ediff-version "2.81.2" "The current version of Ediff")
-(defconst ediff-date "June 13, 2007" "Date of last update")
+(defconst ediff-date "April 06, 2008" "Date of last update")
 
 
 ;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 
 ;;; Code:
 
+(provide 'ediff)
 
 ;; Compiler pacifier
 (defvar cvs-cookie-handle)
 (defvar ediff-last-dir-patch)
 (defvar ediff-patch-default-directory)
+(defvar ediff-control-window)
+
+(eval-and-compile
+  (unless (fboundp 'declare-function) (defmacro declare-function (&rest  r))))
+
 
-(and noninteractive
-     (eval-when-compile
-        (load-library "dired")
-        (load-library "info")
-        (load "pcl-cvs" 'noerror)))
 (eval-when-compile
-  (let ((load-path (cons (expand-file-name ".") load-path)))
-    (provide 'ediff) ; to break recursive load cycle
-    (or (featurep 'ediff-init)
-       (load "ediff-init.el" nil nil 'nosuffix))
-    (or (featurep 'ediff-mult)
-       (load "ediff-mult.el" nil nil 'nosuffix))
-    (or (featurep 'ediff-ptch)
-       (load "ediff-ptch.el" nil nil 'nosuffix))
-    (or (featurep 'ediff-vers)
-       (load "ediff-vers.el" nil nil 'nosuffix))
-    ))
+  (require 'dired)
+  (require 'ediff-init)
+  (if (not (featurep 'ediff-mult))
+      (require 'ediff-mult))
+  (if (not (featurep 'ediff-util))
+      (require 'ediff-util))
+  (require 'ediff-wind)
+  (if (not (featurep 'ediff-ptch))
+      (require 'ediff-ptch))
+  (require 'ediff-vers)
+  )
 ;; end pacifier
 
 (require 'ediff-init)
                 (list (cons 'ediff-job-name job-name))
                 merge-buffer-file)))
 
+(declare-function diff-latest-backup-file "diff" (fn))
 
 ;;;###autoload
 (defalias 'ediff 'ediff-files)
@@ -1303,20 +1310,6 @@ buffer."
      (intern (format "ediff-%S-merge-internal" ediff-version-control-package))
      rev1 rev2 ancestor-rev startup-hooks merge-buffer-file)))
 
-;; MK: Check. This function doesn't seem to be used any more by pcvs or pcl-cvs
-;;;###autoload
-(defun run-ediff-from-cvs-buffer (pos)
-  "Run Ediff-merge on appropriate revisions of the selected file.
-First run after `M-x cvs-update'.  Then place the cursor on a line describing a
-file and then run `run-ediff-from-cvs-buffer'."
-  (interactive "d")
-  (ediff-load-version-control)
-  (let ((tin (tin-locate cvs-cookie-handle pos)))
-    (if tin
-       (cvs-run-ediff-on-file-descriptor tin)
-      (error "There is no file to merge"))))
-
-
 ;;; Apply patch
 
 ;;;###autoload
@@ -1438,9 +1431,11 @@ Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
 When called interactively, displays the version."
   (interactive)
   (if (interactive-p)
-      (message (ediff-version))
+      (message "%s" (ediff-version))
     (format "Ediff %s of %s" ediff-version ediff-date)))
 
+;; info is run first, and will autoload info.el.
+(declare-function Info-goto-node "info" (nodename &optional fork))
 
 ;;;###autoload
 (defun ediff-documentation (&optional node)
@@ -1454,7 +1449,7 @@ With optional NODE, goes to that node."
     (condition-case nil
        (progn
          (pop-to-buffer (get-buffer-create "*info*"))
-         (info (if ediff-xemacs-p "ediff.info" "ediff"))
+         (info (if (featurep 'xemacs) "ediff.info" "ediff"))
          (if node
              (Info-goto-node node)
            (message "Type `i' to search for a specific topic"))
@@ -1523,8 +1518,6 @@ With optional NODE, goes to that node."
 
 (run-hooks 'ediff-load-hook)
 
-(provide 'ediff)
-
 
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
@@ -1532,5 +1525,5 @@ With optional NODE, goes to that node."
 ;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
 ;;; End:
 
-;;; arch-tag: 97c71396-db02-4f41-8b48-6a51c3348fcc
+;; arch-tag: 97c71396-db02-4f41-8b48-6a51c3348fcc
 ;;; ediff.el ends here