From: Tino Calancha Date: Wed, 7 Dec 2016 12:07:45 +0000 (+0900) Subject: ediff-context-diff-label-regexp: Detect the end of second file X-Git-Tag: emacs-26.0.90~1190 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2c4970560fbb0d1efe95f8a002c181bc706c1a13;p=emacs.git ediff-context-diff-label-regexp: Detect the end of second file * lisp/vc/ediff-ptch.el (ediff-context-diff-label-regexp): Skip '\n' in file names (Bug#25010). * test/lisp/vc/ediff-ptch-tests.el: New file. (ibuffer-test-bug25010): Add test for Bug#25010. --- diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el index 6a07f805334..6e8e9473fcc 100644 --- a/lisp/vc/ediff-ptch.el +++ b/lisp/vc/ediff-ptch.el @@ -120,11 +120,12 @@ patch. So, don't change these variables, unless the default doesn't work." ;; This context diff does not recognize spaces inside files, but removing ' ' ;; from [^ \t] breaks normal patches for some reason (defcustom ediff-context-diff-label-regexp - (concat "\\(" ; context diff 2-liner - "^\\*\\*\\* +\\([^ \t]+\\)[^*]+[\t ]*\n--- +\\([^ \t]+\\)" - "\\|" ; unified format diff 2-liner - "^--- +\\([^ \t]+\\).*\n\\+\\+\\+ +\\([^ \t]+\\)" - "\\)") + (let ((stuff "\\([^ \t\n]+\\)")) + (concat "\\(" ; context diff 2-liner + "^\\*\\*\\* +" stuff "[^*]+[\t ]*\n--- +" stuff + "\\|" ; unified format diff 2-liner + "^--- +" stuff ".*\n\\+\\+\\+ +" stuff + "\\)")) "Regexp matching filename 2-liners at the start of each context diff. You probably don't want to change that, unless you are using an obscure patch program."