Merge from emacs--rel--22
[bpt/emacs.git] / lisp / ediff-merg.el
index 237ce51..79a9c48 100644 (file)
@@ -1,6 +1,7 @@
 ;;; ediff-merg.el --- merging utilities
 
-;; Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01, 02 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+;;   2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 
 
 ;; 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:
 
 ;;; Code:
 
-(provide 'ediff-merg)
 
 ;; compiler pacifier
 (defvar ediff-window-A)
@@ -62,7 +62,7 @@ Valid values are the symbols `default-A', `default-B', and `combined'."
   '("<<<<<<< variant A" A ">>>>>>> variant B" B  "####### Ancestor" Ancestor "======= end")
   "*Pattern to be used for combining difference regions in buffers A and B.
 The value must be a list of the form
-(STRING1 bufspec1  STRING2 bufspec2 STRING3 bufspec3 STRING4)
+\(STRING1 bufspec1  STRING2 bufspec2 STRING3 bufspec3 STRING4)
 where bufspec is the symbol A, B, or Ancestor. For instance, if the value is
 '(STRING1 A  STRING2 Ancestor STRING3 B STRING4) then the
 combined text will look like this:
@@ -82,7 +82,7 @@ STRING4
 (defcustom ediff-show-clashes-only nil
   "*If t, show only those diff regions where both buffers disagree with the ancestor.
 This means that regions that have status prefer-A or prefer-B will be
-skipped over.  nil means show all regions."
+skipped over.  A value of nil means show all regions."
   :type 'boolean
   :group 'ediff-merge
   )
@@ -102,11 +102,18 @@ Buffer B."
   )
 (make-variable-buffer-local 'ediff-skip-merge-regions-that-differ-from-default)
 
+;; check if there is no clash between the ancestor and one of the variants.
+;; if it is not a merge job then return true
+(defsubst ediff-merge-region-is-non-clash (n)
+  (if (ediff-merge-job)
+      (string-match "prefer" (or (ediff-get-state-of-merge n) ""))
+    t))
+
 ;; If ediff-show-clashes-only, check if there is no clash between the ancestor
 ;; and one of the variants.
-(defsubst ediff-merge-region-is-non-clash (n)
+(defsubst ediff-merge-region-is-non-clash-to-skip (n)
   (and ediff-show-clashes-only
-       (string-match "prefer" (or (ediff-get-state-of-merge n) ""))))
+       (ediff-merge-region-is-non-clash n)))
 
 ;; If ediff-skip-changed-regions, check if the merge region differs from
 ;; the current default. If a region is different from the default, it means
@@ -382,6 +389,9 @@ Combining is done according to the specifications in variable
        )))
 
 
+(provide 'ediff-merg)
+
+
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)