Commit 3af0304a authored by Michael Kifer's avatar Michael Kifer
Browse files

*** empty log message ***

parent 93b7ac65
1999-11-01 Michael Kifer <kifer@cs.sunysb.edu>
* ediff.el: version change.
* ediff-util.el (ediff-cleanup-mess): fixed the case of dead windows.
make sure you are in a good frame before deleting other
windows.
(ediff-file-checked-in-p): don't consider CVS
files checked in.
(ediff-make-temp-file,ediff-make-empty-tmp-file): Make sure you
are writing to a newly created empty file.
* ediff-mult.el (ediff-show-session-group-hook): new default.
* ediff-vers.el (ediff-pcl-cvs-view-revision):
first cd to the file directory. reportedly works
better with remote files.
* ediff-vers.el (ediff-pcl-cvs-internal, ediff-pcl-cvs-merge-internal):
use file-name-nondirectory when passing files to CVS.
* ediff-diff.el (ediff-cmp-options): new var.
(ediff-same-file-contents): use ediff-cmp-options.
* ediff-ptch.el (ediff-prompt-for-patch-buffer,
ediff-get-patch-buffer): use current buffer if it appears to be a
patch.
* viper-keym.el: Fixed calls to viper-ex,
change key C-cg to C-cC-g
* viper-util.el (viper-nontrivial-find-file-function): deleted.
(viper-glob-unix-files, viper-glob-mswindows-files): new functions.
(viper-save-cursor-color,viper-restore-cursor-color):
improved cursor color handling.
(viper-get-saved-cursor-color-in-replace-mode,
viper-get-saved-cursor-color-in-insert-mode): new functions for
better cursor color handling.
* viper-ex.el (ex-read,ex-edit):
fixes for correct interpretation of #,%.
(viper-ex): now works correctly when called from other functions.
(viper-glob-function): new variable.
(viper-ex): save excursion before doing :global.
* viper-mous.el (viper-counting-clicks-p): bug fixes.
* viper-cmd.el (viper-post-command-sentinel,
viper-insert-state-post-command-sentinel,
viper-insert-state-pre-command-sentinel): takes better care of
cursor colors.
* viper.el: version change.
1999-10-31 Rajesh Vaidheeswarran <rv@dsmit.com> 1999-10-31 Rajesh Vaidheeswarran <rv@dsmit.com>
* whitespace.el (whitespace-update-modeline): Bugfix to ensure * whitespace.el (whitespace-update-modeline): Bugfix to ensure
......
...@@ -65,6 +65,13 @@ It must return code 0, if its arguments are identical files." ...@@ -65,6 +65,13 @@ It must return code 0, if its arguments are identical files."
:type 'string :type 'string
:group 'ediff-diff) :group 'ediff-diff)
(defcustom ediff-cmp-options nil
"*Options to pass to `ediff-cmp-program'. If GNUS diff is used as
`ediff-cmp-program', then the most useful options are `-I' RE, to
ignore changes whose lines all match RE."
:type '(repeat string)
:group 'ediff-diff)
(defcustom ediff-diff-program "diff" (defcustom ediff-diff-program "diff"
"*Program to use for generating the differential of the two files." "*Program to use for generating the differential of the two files."
:type 'string :type 'string
...@@ -270,19 +277,19 @@ one optional arguments, diff-number to refine.") ...@@ -270,19 +277,19 @@ one optional arguments, diff-number to refine.")
;; fixup diff-list ;; fixup diff-list
(if diff3-job (if diff3-job
(cond ((not file-A) (cond ((not file-A)
(mapcar (function (lambda (elt) (mapcar (lambda (elt)
(aset elt 0 nil) (aset elt 0 nil)
(aset elt 1 nil))) (aset elt 1 nil))
(cdr diff-list))) (cdr diff-list)))
((not file-B) ((not file-B)
(mapcar (function (lambda (elt) (mapcar (lambda (elt)
(aset elt 2 nil) (aset elt 2 nil)
(aset elt 3 nil))) (aset elt 3 nil))
(cdr diff-list))) (cdr diff-list)))
((not file-C) ((not file-C)
(mapcar (function (lambda (elt) (mapcar (lambda (elt)
(aset elt 4 nil) (aset elt 4 nil)
(aset elt 5 nil))) (aset elt 5 nil))
(cdr diff-list))) (cdr diff-list)))
)) ))
...@@ -475,13 +482,14 @@ one optional arguments, diff-number to refine.") ...@@ -475,13 +482,14 @@ one optional arguments, diff-number to refine.")
(if ediff-merge-job (if ediff-merge-job
(setq ediff-state-of-merge (setq ediff-state-of-merge
(vconcat (vconcat
(mapcar (function (mapcar (lambda (elt)
(lambda (elt) (let ((state-of-merge (aref elt 9))
(let ((state-of-merge (aref elt 9)) (state-of-ancestor (aref elt 10)))
(state-of-ancestor (aref elt 10))) (vector
(vector ;; state of merge: prefers/default-A/B or combined
(if state-of-merge (format "%S" state-of-merge)) (if state-of-merge (format "%S" state-of-merge))
state-of-ancestor)))) ;; whether the ancestor region is empty
state-of-ancestor)))
;; the first elt designates type of list ;; the first elt designates type of list
(cdr diff-list)) (cdr diff-list))
))) )))
...@@ -554,9 +562,11 @@ one optional arguments, diff-number to refine.") ...@@ -554,9 +562,11 @@ one optional arguments, diff-number to refine.")
(if (= 0 (mod current-diff 10)) (if (= 0 (mod current-diff 10))
(message "Buffer %S: Processing difference region %d of %d" (message "Buffer %S: Processing difference region %d of %d"
buf-type current-diff total-diffs)) buf-type current-diff total-diffs))
;; record all overlays for this difference ;; Record all overlays for this difference.
;; the second elt, nil, is a place holder for the fine diff vector. ;; The 2-d elt, nil, is a place holder for the fine diff vector.
;; the third elt, nil, is a place holder for no-fine-diffs flag. ;; The 3-d elt, nil, is a place holder for no-fine-diffs flag.
;; The 4-th elt says which diff region is different from the other two
;; (3-way jobs only).
(setq diff-overlay-list (setq diff-overlay-list
(nconc (nconc
diff-overlay-list diff-overlay-list
...@@ -646,7 +656,7 @@ one optional arguments, diff-number to refine.") ...@@ -646,7 +656,7 @@ one optional arguments, diff-number to refine.")
(or (ediff-get-fine-diff-vector n 'A) (or (ediff-get-fine-diff-vector n 'A)
(memq ediff-auto-refine '(off nix)) (memq ediff-auto-refine '(off nix))
(ediff-message-if-verbose (ediff-message-if-verbose
"Region %d exceeds auto-refine limit. Type `%s' to refine" "Region %d exceeds the auto-refinement limit. Type `%s' to refine"
(1+ n) (1+ n)
(substitute-command-keys (substitute-command-keys
"\\[ediff-make-or-kill-fine-diffs]") "\\[ediff-make-or-kill-fine-diffs]")
...@@ -784,11 +794,10 @@ one optional arguments, diff-number to refine.") ...@@ -784,11 +794,10 @@ one optional arguments, diff-number to refine.")
ediff-current-diff-overlay-alist)) ediff-current-diff-overlay-alist))
'priority) 'priority)
0))))) 0)))))
(mapcar (mapcar (lambda (overl)
(function (lambda (overl) (ediff-set-overlay-face overl face)
(ediff-set-overlay-face overl face) (ediff-overlay-put overl 'priority priority))
(ediff-overlay-put overl 'priority priority))) fine-diff-vector)))
fine-diff-vector)))
;; This assumes buffer C and that the region looks like a combination of ;; This assumes buffer C and that the region looks like a combination of
;; regions in buffer A and C. ;; regions in buffer A and C.
...@@ -1079,6 +1088,7 @@ one optional arguments, diff-number to refine.") ...@@ -1079,6 +1088,7 @@ one optional arguments, diff-number to refine.")
;; args. ;; args.
(defun ediff-exec-process (program buffer synch options &rest files) (defun ediff-exec-process (program buffer synch options &rest files)
(let ((data (match-data)) (let ((data (match-data))
(coding-system-for-read 'no-conversion)
args) args)
(setq args (append (split-string options) files)) (setq args (append (split-string options) files))
(setq args (delete "" (delq nil args))) ; delete nil and "" from arguments (setq args (delete "" (delq nil args))) ; delete nil and "" from arguments
...@@ -1252,7 +1262,9 @@ argument to `skip-chars-forward'." ...@@ -1252,7 +1262,9 @@ argument to `skip-chars-forward'."
(defun ediff-same-file-contents (f1 f2) (defun ediff-same-file-contents (f1 f2)
"T if F1 and F2 have identical contents." "T if F1 and F2 have identical contents."
(let ((res (call-process ediff-cmp-program nil nil nil f1 f2))) (let ((res
(apply 'call-process ediff-cmp-program nil nil nil
(append ediff-cmp-options (list f1 f2)))))
(and (numberp res) (eq res 0)))) (and (numberp res) (eq res 0))))
......
...@@ -65,7 +65,7 @@ n,SPC -next diff | h -hilighting | rx -restore buf X's old diff ...@@ -65,7 +65,7 @@ n,SPC -next diff | h -hilighting | rx -restore buf X's old diff
~ -rotate buffers| m -wide display | ~ -rotate buffers| m -wide display |
" "
"Help message usually used for 3-way comparison. "Help message usually used for 3-way comparison.
Normally, not a user option. See `ediff-help-message' for details.") Normally, not a user option. See `ediff-help-message' for details.")
(defconst ediff-long-help-message-compare2 (defconst ediff-long-help-message-compare2
" "
...@@ -79,7 +79,7 @@ n,SPC -next diff | h -hilighting | rx -restore buf X's old diff ...@@ -79,7 +79,7 @@ n,SPC -next diff | h -hilighting | rx -restore buf X's old diff
~ -swap variants | m -wide display | ~ -swap variants | m -wide display |
" "
"Help message usually used for 2-way comparison. "Help message usually used for 2-way comparison.
Normally, not a user option. See `ediff-help-message' for details.") Normally, not a user option. See `ediff-help-message' for details.")
(defconst ediff-long-help-message-narrow2 (defconst ediff-long-help-message-narrow2
" "
...@@ -93,7 +93,7 @@ n,SPC -next diff | h -hilighting | rx -restore buf X's old diff ...@@ -93,7 +93,7 @@ n,SPC -next diff | h -hilighting | rx -restore buf X's old diff
~ -swap variants | m -wide display | ~ -swap variants | m -wide display |
" "
"Help message when comparing windows or regions line-by-line. "Help message when comparing windows or regions line-by-line.
Normally, not a user option. See `ediff-help-message' for details.") Normally, not a user option. See `ediff-help-message' for details.")
(defconst ediff-long-help-message-word-mode (defconst ediff-long-help-message-word-mode
" "
...@@ -107,7 +107,7 @@ n,SPC -next diff | h -hilighting | rx -restore buf X's old diff ...@@ -107,7 +107,7 @@ n,SPC -next diff | h -hilighting | rx -restore buf X's old diff
~ -swap variants | m -wide display | ~ -swap variants | m -wide display |
" "
"Help message when comparing windows or regions word-by-word. "Help message when comparing windows or regions word-by-word.
Normally, not a user option. See `ediff-help-message' for details.") Normally, not a user option. See `ediff-help-message' for details.")
(defconst ediff-long-help-message-merge (defconst ediff-long-help-message-merge
" "
...@@ -119,37 +119,38 @@ n,SPC -next diff | h -hilighting | r -restore buf C's old diff ...@@ -119,37 +119,38 @@ n,SPC -next diff | h -hilighting | r -restore buf C's old diff
v/V -scroll up/dn | X -read-only in buf X | wx -save buf X v/V -scroll up/dn | X -read-only in buf X | wx -save buf X
</> -scroll lt/rt | m -wide display | wd -save diff output </> -scroll lt/rt | m -wide display | wd -save diff output
~ -swap variants | s -shrink window C | / -show ancestor buff ~ -swap variants | s -shrink window C | / -show ancestor buff
| $ -show clashes only | & -merge w/new default | $$ -show clashes only | & -merge w/new default
| $* -skip changed regions |
" "
"Help message during merging. "Help message for merge sessions.
Normally, not a user option. See `ediff-help-message' for details.") Normally, not a user option. See `ediff-help-message' for details.")
;; The actual long help message. ;; The actual long help message.
(ediff-defvar-local ediff-long-help-message "" (ediff-defvar-local ediff-long-help-message ""
"Normally, not a user option. See `ediff-help-message' for details.") "Normally, not a user option. See `ediff-help-message' for details.")
(defconst ediff-brief-message-string (defconst ediff-brief-message-string
"? -quick help " " ? -quick help "
"Contents of the brief help message.") "Contents of the brief help message.")
;; The actual brief help message ;; The actual brief help message
(ediff-defvar-local ediff-brief-help-message "" (ediff-defvar-local ediff-brief-help-message ""
"Normally, not a user option. See `ediff-help-message' for details.") "Normally, not a user option. See `ediff-help-message' for details.")
(ediff-defvar-local ediff-brief-help-message-function nil (ediff-defvar-local ediff-brief-help-message-function nil
"The brief help message that the user can customize. "The brief help message that the user can customize.
If the user sets this to a parameter-less function, Ediff will use it to If the user sets this to a parameter-less function, Ediff will use it to
produce the brief help message. This function must return a string.") produce the brief help message. This function must return a string.")
(ediff-defvar-local ediff-long-help-message-function nil (ediff-defvar-local ediff-long-help-message-function nil
"The long help message that the user can customize. "The long help message that the user can customize.
See `ediff-brief-help-message-function' for more.") See `ediff-brief-help-message-function' for more.")
(defvar ediff-use-long-help-message nil (defvar ediff-use-long-help-message nil
"*If t, Ediff displays a long help message. Short help message otherwise.") "*If t, Ediff displays a long help message. Short help message otherwise.")
;; The actual help message. ;; The actual help message.
(ediff-defvar-local ediff-help-message "" (ediff-defvar-local ediff-help-message ""
"The actual help message. "The actual help message.
Normally, the user shouldn't touch this. However, if you want Ediff to Normally, the user shouldn't touch this. However, if you want Ediff to
start up with different help messages for different jobs, you can change start up with different help messages for different jobs, you can change
the value of this variable and the variables `ediff-help-message-*' in the value of this variable and the variables `ediff-help-message-*' in
`ediff-startup-hook'.") `ediff-startup-hook'.")
...@@ -188,12 +189,12 @@ the value of this variable and the variables `ediff-help-message-*' in ...@@ -188,12 +189,12 @@ the value of this variable and the variables `ediff-help-message-*' in
(if ediff-xemacs-p (if ediff-xemacs-p
(setq overl (extent-at pos (current-buffer) 'ediff-help-info) (setq overl (extent-at pos (current-buffer) 'ediff-help-info)
cmd (ediff-overlay-get overl 'ediff-help-info)) cmd (ediff-overlay-get overl 'ediff-help-info))
(setq cmd (car (mapcar (function (lambda (elt) (setq cmd (car (mapcar (lambda (elt)
(overlay-get elt 'ediff-help-info))) (overlay-get elt 'ediff-help-info))
(overlays-at pos))))) (overlays-at pos)))))
(if (not (stringp cmd)) (if (not (stringp cmd))
(error "Hmm... I don't see an Ediff command around here...")) (error "Hmm... I don't see an Ediff command around here..."))
(ediff-documentation "Quick Help Commands") (ediff-documentation "Quick Help Commands")
...@@ -231,7 +232,8 @@ the value of this variable and the variables `ediff-help-message-*' in ...@@ -231,7 +232,8 @@ the value of this variable and the variables `ediff-help-message-*' in
((string= cmd "z/q") (re-search-forward "^`z'")) ((string= cmd "z/q") (re-search-forward "^`z'"))
((string= cmd "%") (re-search-forward "^`%'")) ((string= cmd "%") (re-search-forward "^`%'"))
((string= cmd "C-l") (re-search-forward "^`C-l'")) ((string= cmd "C-l") (re-search-forward "^`C-l'"))
((string= cmd "$") (re-search-forward "^`\\$'")) ((string= cmd "$$") (re-search-forward "^`\\$\\$'"))
((string= cmd "$*") (re-search-forward "^`\\$\\*'"))
((string= cmd "/") (re-search-forward "^`/'")) ((string= cmd "/") (re-search-forward "^`/'"))
((string= cmd "&") (re-search-forward "^`&'")) ((string= cmd "&") (re-search-forward "^`&'"))
((string= cmd "s") (re-search-forward "^`s'")) ((string= cmd "s") (re-search-forward "^`s'"))
...@@ -309,5 +311,9 @@ the value of this variable and the variables `ediff-help-message-*' in ...@@ -309,5 +311,9 @@ the value of this variable and the variables `ediff-help-message-*' in
ediff-brief-help-message)) ediff-brief-help-message))
(run-hooks 'ediff-display-help-hook)) (run-hooks 'ediff-display-help-hook))
(defun ediff-customize ()
(interactive)
(customize-group "ediff"))
;;; ediff-help.el ends here ;;; ediff-help.el ends here
...@@ -42,27 +42,33 @@ ...@@ -42,27 +42,33 @@
;; end pacifier ;; end pacifier
;; allow menus to be set up without ediff-wind.el being loaded ;; allow menus to be set up without ediff-wind.el being loaded
;;;###autoload
(defvar ediff-window-setup-function) (defvar ediff-window-setup-function)
;; Note we wrap this in a progn so that we pick up the whole def
(defun ediff-xemacs-init-menus () ;; for auto-autoload. That way we do not load ediff-hook.el when defining
(if (featurep 'menubar) ;; the menus.
(progn ;;;###autoload
(add-submenu (progn
'("Tools") ediff-menu "OO-Browser...") (defun ediff-xemacs-init-menus ()
(add-submenu (if (featurep 'menubar)
'("Tools") ediff-merge-menu "OO-Browser...") (progn
(add-submenu (add-submenu
'("Tools") epatch-menu "OO-Browser...") '("Tools") ediff-menu "OO-Browser...")
(add-submenu (add-submenu
'("Tools") ediff-misc-menu "OO-Browser...") '("Tools") ediff-merge-menu "OO-Browser...")
(add-menu-button (add-submenu
'("Tools") '("Tools") epatch-menu "OO-Browser...")
["-------" nil nil] "OO-Browser...") (add-submenu
))) '("Tools") ediff-misc-menu "OO-Browser...")
(add-menu-button
'("Tools")
["-------" nil nil] "OO-Browser...")
))))
;; explicit string-match is needed: ediff-xemacs-p is not defined at build time ;; explicit string-match is needed: ediff-xemacs-p is not defined at build time
;;;###autoload
(cond ((string-match "XEmacs" emacs-version) (cond ((string-match "XEmacs" emacs-version)
(defvar ediff-menu (defvar ediff-menu
'("Compare" '("Compare"
...@@ -110,6 +116,7 @@ ...@@ -110,6 +116,7 @@
(defvar ediff-misc-menu (defvar ediff-misc-menu
'("Ediff Miscellanea" '("Ediff Miscellanea"
["Ediff Manual..." ediff-documentation t] ["Ediff Manual..." ediff-documentation t]
["Customize Ediff..." ediff-customize t]
["List Ediff Sessions..." ediff-show-registry t] ["List Ediff Sessions..." ediff-show-registry t]
["Use separate frame for Ediff control buffer..." ["Use separate frame for Ediff control buffer..."
ediff-toggle-multiframe ediff-toggle-multiframe
...@@ -124,13 +131,15 @@ ...@@ -124,13 +131,15 @@
:selected (if (featurep 'ediff-tbar) :selected (if (featurep 'ediff-tbar)
(ediff-use-toolbar-p))] (ediff-use-toolbar-p))]
)) ))
;; put these menus before Object-Oriented-Browser in Tools menu ;; put these menus before Object-Oriented-Browser in Tools menu
;; (add-hook 'before-init-hook 'ediff-xemacs-init-menus) ;;; (add-hook 'before-init-hook 'ediff-xemacs-init-menus)
;; (if (not purify-flag) ;;; (if (not purify-flag)
;; (ediff-xemacs-init-menus)) ;;; (ediff-xemacs-init-menus))
;; ) ;;; )
(ediff-xemacs-init-menus)) (if (and (featurep 'menubar) (not (featurep 'infodock))
(not (featurep 'ediff-hook)))
(ediff-xemacs-init-menus)))
;; Emacs--only if menu-bar is loaded ;; Emacs--only if menu-bar is loaded
((featurep 'menu-bar) ((featurep 'menu-bar)
...@@ -224,6 +233,8 @@ ...@@ -224,6 +233,8 @@
. ediff-toggle-multiframe)) . ediff-toggle-multiframe))
(define-key menu-bar-ediff-misc-menu [eregistry] (define-key menu-bar-ediff-misc-menu [eregistry]
'("List Ediff Sessions..." . ediff-show-registry)) '("List Ediff Sessions..." . ediff-show-registry))
(define-key menu-bar-ediff-misc-menu [ediff-cust]
'("Customize Ediff..." . ediff-customize))
(define-key menu-bar-ediff-misc-menu [ediff-doc] (define-key menu-bar-ediff-misc-menu [ediff-doc]
'("Ediff Manual..." . ediff-documentation)) '("Ediff Manual..." . ediff-documentation))
) )
......
This diff is collapsed.
...@@ -59,7 +59,7 @@ Valid values are the symbols `default-A', `default-B', and `combined'." ...@@ -59,7 +59,7 @@ Valid values are the symbols `default-A', `default-B', and `combined'."
(defcustom ediff-combination-pattern (defcustom ediff-combination-pattern
'("<<<<<<<<<<<<<< variant A" ">>>>>>>>>>>>>> variant B" "======= end of combination") '("<<<<<<<<<<<<<< variant A" ">>>>>>>>>>>>>> variant B" "======= end of combination")
"*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 is (STRING1 STRING2 STRING3). The combined text will look like this: The value is (STRING1 STRING2 STRING3). The combined text will look like this:
STRING1 STRING1
diff region from variant A diff region from variant A
...@@ -70,10 +70,28 @@ STRING3 ...@@ -70,10 +70,28 @@ STRING3
:type '(list string string string) :type '(list string string string)
:group 'ediff-merge) :group 'ediff-merge)
(ediff-defvar-local ediff-show-clashes-only nil (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 This means that regions that have status prefer-A or prefer-B will be
skiped over. Nil means show all regions.") skiped over. Nil means show all regions."
:type 'boolean
:group 'ediff-merge
)
(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.
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'.
A region is considered to have been changed also when it is marked as
as `prefer-A', but is different from the corresponding difference region in
Buffer A or if it is marked as `prefer-B' and is different from the region in
Buffer B."
:type 'boolean
:group 'ediff-merge
)
(make-variable-buffer-local 'ediff-skip-merge-regions-that-differ-from-default)
;; If ediff-show-clashes-only, check if there is no clash between the ancestor ;; If ediff-show-clashes-only, check if there is no clash between the ancestor
;; and one of the variants. ;; and one of the variants.
...@@ -81,6 +99,15 @@ skiped over. Nil means show all regions.") ...@@ -81,6 +99,15 @@ skiped over. Nil means show all regions.")
(and ediff-show-clashes-only (and ediff-show-clashes-only
(string-match "prefer" (or (ediff-get-state-of-merge n) "")))) (string-match "prefer" (or (ediff-get-state-of-merge 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
(ediff-merge-changed-from-default-p n 'prefers-too)))
(defsubst ediff-get-combined-region (n) (defsubst ediff-get-combined-region (n)
(concat (nth 0 ediff-combination-pattern) "\n" (concat (nth 0 ediff-combination-pattern) "\n"
...@@ -166,17 +193,10 @@ skiped over. Nil means show all regions.") ...@@ -166,17 +193,10 @@ skiped over. Nil means show all regions.")
(reg-C (ediff-get-region-contents n 'C ediff-control-buffer))) (reg-C (ediff-get-region-contents n 'C ediff-control-buffer)))
;; if region was edited since it was first set by default ;; if region was edited since it was first set by default
(if (or (and (string= state-of-merge "default-A") (if (or (ediff-merge-changed-from-default-p n)
(not (string= reg-A reg-C))) ;; was preferred
;; was edited since first set by default
(and (string= state-of-merge "default-B")
(not (string= reg-B reg-C)))
;; was edited since first set by default
(and (string= state-of-merge "combined")
(not (string=
(ediff-make-combined-diff reg-A reg-B) reg-C)))
;; was preferred--ignore
(string-match "prefer" state-of-merge)) (string-match "prefer" state-of-merge))
;; then ignore
(setq do-not-copy t)) (setq do-not-copy t))
;; change state of merge for this diff, if necessary ;; change state of merge for this diff, if necessary
...@@ -203,7 +223,7 @@ skiped over. Nil means show all regions.") ...@@ -203,7 +223,7 @@ skiped over. Nil means show all regions.")
(defun ediff-re-merge () (defun ediff-re-merge ()
"Remerge unmodified diff regions using a new default. Start with the current region." "Remerge unmodified diff regions using a new default. Start with the current region."
(interactive) (interactive)
(let* ((default-variant-alist (let* ((default-variant-alist
(list '("default-A") '("default-B") '("combined"))) (list '("default-A") '("default-B") '("combined")))
...@@ -213,7 +233,7 @@ skiped over. Nil means show all regions.") ...@@ -213,7 +233,7 @@ skiped over. Nil means show all regions.")
(setq ediff-default-variant (setq ediff-default-variant
(intern (intern
(completing-read (completing-read
(format "Current merge default is `%S'. New default: " (format "Current merge default is `%S'. New default: "
ediff-default-variant) ediff-default-variant)
actual-alist nil 'must-match))) actual-alist nil 'must-match)))
(ediff-do-merge ediff-current-difference 'remerge) (ediff-do-merge ediff-current-difference 'remerge)
...@@ -245,10 +265,10 @@ Used only for merging jobs." ...@@ -245,10 +265,10 @@ Used only for merging jobs."
(ediff-recenter 'no-rehighlight)))) (ediff-recenter 'no-rehighlight))))