comparison lisp/ediff-ptch.el @ 16168:587b9c438823

(ediff-context-diff-label-regexp): Recognize -u format better. (ediff-map-patch-buffer): Recognize -u format better.
author Richard M. Stallman <rms@gnu.org>
date Wed, 11 Sep 1996 23:29:09 +0000 (1996-09-11)
parents 22da4beb0631
children b2fae8abc5b0
comparison
equal deleted inserted replaced
16167:651ee074f8b0 16168:587b9c438823
39 39
40 (defvar ediff-context-diff-label-regexp 40 (defvar ediff-context-diff-label-regexp
41 (concat "\\(" ; context diff 2-liner 41 (concat "\\(" ; context diff 2-liner
42 "^\\*\\*\\* \\([^ \t]+\\)[^*]+[\t ]*\n--- \\([^ \t]+\\)" 42 "^\\*\\*\\* \\([^ \t]+\\)[^*]+[\t ]*\n--- \\([^ \t]+\\)"
43 "\\|" ; GNU unified format diff 2-liner 43 "\\|" ; GNU unified format diff 2-liner
44 "^--- \\([^ \t]+\\)[^-]+[\t ]*\n\\+\\+\\+ \\([^ \t]+\\)" 44 "^--- \\([^ \t]+\\)[\t ]+.*\n\\+\\+\\+ \\([^ \t]+\\)"
45 "\\)") 45 "\\)")
46 "*Regexp matching filename 2-liners at the start of each context diff.") 46 "*Regexp matching filename 2-liners at the start of each context diff.")
47 47
48 (defvar ediff-patch-program "patch" 48 (defvar ediff-patch-program "patch"
49 "*Name of the program that applies patches.") 49 "*Name of the program that applies patches.")
110 (re-search-forward ediff-context-diff-label-regexp nil t)) 110 (re-search-forward ediff-context-diff-label-regexp nil t))
111 (if (= opoint (point)) 111 (if (= opoint (point))
112 (forward-char 1) ; ensure progress towards the end 112 (forward-char 1) ; ensure progress towards the end
113 (setq mark2 (move-marker (make-marker) (match-beginning 0)) 113 (setq mark2 (move-marker (make-marker) (match-beginning 0))
114 mark2-end (match-end 0) 114 mark2-end (match-end 0)
115 beg1 (match-beginning 2) 115 beg1 (or (match-beginning 2) (match-beginning 4))
116 end1 (match-end 2) 116 end1 (or (match-end 2) (match-end 4))
117 beg2 (match-beginning 3) 117 beg2 (or (match-beginning 3) (match-beginning 5))
118 end2 (match-end 3)) 118 end2 (or (match-end 3) (match-end 5)))
119 ;; possible-file-names is holding the new file names until we 119 ;; possible-file-names is holding the new file names until we
120 ;; insert the old file name in the patch map 120 ;; insert the old file name in the patch map
121 ;; It is a pair (filename from 1st header line . fn from 2nd line) 121 ;; It is a pair (filename from 1st header line . fn from 2nd line)
122 (setq possible-file-names 122 (setq possible-file-names
123 (cons (if (and beg1 end1) 123 (cons (if (and beg1 end1)