X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/08b3caa982199bd7939d9d6877203ada5d0083b5..6bdad9ae02d440a259713ea4a8942d1168e7f452:/lisp/ediff-merg.el diff --git a/lisp/ediff-merg.el b/lisp/ediff-merg.el index 0a847772d3..971c763693 100644 --- a/lisp/ediff-merg.el +++ b/lisp/ediff-merg.el @@ -1,7 +1,7 @@ ;;; ediff-merg.el --- merging utilities ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -;; 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +;; 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ;; Author: Michael Kifer @@ -39,21 +39,21 @@ (require 'ediff-init) (defcustom ediff-quit-merge-hook 'ediff-maybe-save-and-delete-merge - "*Hooks to run before quitting a merge job. + "Hooks to run before quitting a merge job. The most common use is to save and delete the merge buffer." :type 'hook :group 'ediff-merge) (defcustom ediff-default-variant 'combined - "*The variant to be used as a default for buffer C in merging. + "The variant to be used as a default for buffer C in merging. Valid values are the symbols `default-A', `default-B', and `combined'." :type '(radio (const default-A) (const default-B) (const combined)) :group 'ediff-merge) (defcustom ediff-combination-pattern '("<<<<<<< variant A" A ">>>>>>> variant B" B "####### Ancestor" Ancestor "======= end") - "*Pattern to be used for combining difference regions in buffers A and B. + "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) where bufspec is the symbol A, B, or Ancestor. For instance, if the value is @@ -73,7 +73,7 @@ STRING4 :group 'ediff-merge) (defcustom ediff-show-clashes-only nil - "*If t, show only those diff regions where both buffers disagree with the ancestor. + "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. A value of nil means show all regions." :type 'boolean @@ -82,7 +82,7 @@ skipped over. A value of nil means show all regions." (make-variable-buffer-local 'ediff-show-clashes-only) (defcustom ediff-skip-merge-regions-that-differ-from-default nil - "*If t, show only the regions that have not been changed by the user. + "If t, show only the regions that have not been changed by the user. A region is considered to have been changed if it is different from the current default (`default-A', `default-B', `combined') and it hasn't been marked as `prefer-A' or `prefer-B'. @@ -97,23 +97,25 @@ Buffer B." ;; 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) +(defun 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-to-skip (n) - (and ediff-show-clashes-only +(defun ediff-merge-region-is-non-clash-to-skip (n) + (and (ediff-merge-job) + ediff-show-clashes-only (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 ;; that the user has made determination as to how to merge for this particular ;; region. -(defsubst ediff-skip-merge-region-if-changed-from-default-p (n) - (and ediff-skip-merge-regions-that-differ-from-default +(defun ediff-skip-merge-region-if-changed-from-default-p (n) + (and (ediff-merge-job) + ediff-skip-merge-regions-that-differ-from-default (ediff-merge-changed-from-default-p n 'prefers-too))) @@ -224,7 +226,7 @@ Buffer B." ;;(let ((reg-A (ediff-get-region-contents n 'A ediff-control-buffer)) ;; (reg-B (ediff-get-region-contents n 'B ediff-control-buffer)) ;; (reg-C (ediff-get-region-contents n 'C ediff-control-buffer))) - (let () + (progn ;; if region was edited since it was first set by default (if (or (ediff-merge-changed-from-default-p n) @@ -385,11 +387,11 @@ 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) -;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body)) -;;; End: +;; Local Variables: +;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) +;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) +;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body)) +;; End: ;; arch-tag: 9b798cf9-02ba-487f-a62e-b63aa823dbfb ;;; ediff-merg.el ends here