comparison lisp/emerge.el @ 2496:9364da723c1e

(emerge-with-ancestor): Applied Donald Erway's fix patch, which included the following explanatory comment: "D.Erway - This used to just do emerge-get-diff3-group on 2, then on 3. This was incorrect, since the file 3 info for a diff can preceed the file 2 info for that same diff. So we save and restore point to overcome this.
author Eric S. Raymond <esr@snark.thyrsus.com>
date Fri, 09 Apr 1993 23:17:05 +0000
parents 10e417efb12a
children 6574a888b539
comparison
equal deleted inserted replaced
2495:1142464b2ef5 2496:9364da723c1e
1 ;;; emerge.el --- merge diffs under Emacs control 1 ;;; emerge.el --- merge diffs under Emacs control
2 2
3 ;;; The author has placed this file in the public domain. 3 ;;; The author has placed this file in the public domain.
4 4
5 ;; Author: Dale R. Worley <drw@math.mit.edu> 5 ;; Author: Dale R. Worley <drw@math.mit.edu>
6 ;; Version: 4 6 ;; Version: 4.1
7 ;; Keywords: unix, tools 7 ;; Keywords: unix, tools
8 8
9 ;;; Commentary: 9 ;;; Commentary:
10 10
11 ;; This package assists you in reconciling differences between pair of files. 11 ;; This package assists you in reconciling differences between pair of files.
1101 (let ((agreement (buffer-substring (match-beginning 1) (match-end 1)))) 1101 (let ((agreement (buffer-substring (match-beginning 1) (match-end 1))))
1102 ;; if the A and B files are the same, ignore the difference 1102 ;; if the A and B files are the same, ignore the difference
1103 (if (not (string-equal agreement "1")) 1103 (if (not (string-equal agreement "1"))
1104 (setq list 1104 (setq list
1105 (cons 1105 (cons
1106 (let ((group-2 (emerge-get-diff3-group "2")) 1106 (let (group-2 group-3 pos)
1107 (group-3 (emerge-get-diff3-group "3"))) 1107 (setq pos (point))
1108 (setq group-2 (emerge-get-diff3-group "2"))
1109 (goto-char pos)
1110 (setq group-3 (emerge-get-diff3-group "3"))
1108 (vector (car group-2) (car (cdr group-2)) 1111 (vector (car group-2) (car (cdr group-2))
1109 (car group-3) (car (cdr group-3)) 1112 (car group-3) (car (cdr group-3))
1110 (cond ((string-equal agreement "2") 'prefer-A) 1113 (cond ((string-equal agreement "2") 'prefer-A)
1111 ((string-equal agreement "3") 'prefer-B) 1114 ((string-equal agreement "3") 'prefer-B)
1112 (t 'default-A)))) 1115 (t 'default-A))))