summaryrefslogtreecommitdiff
path: root/lisp/diff-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2004-09-29 17:42:50 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2004-09-29 17:42:50 +0000
commitbd9d7d76f01d7f4df84e8a441029f211364d8292 (patch)
tree107234b1848926916690f1e0de64b30260565629 /lisp/diff-mode.el
parent0e9e9a2cc4ff7d30f55124427aafa07a36162416 (diff)
downloademacs-bd9d7d76f01d7f4df84e8a441029f211364d8292.tar.gz
(diff-file-header-re): Tighten up regexp a tiny bit.
(diff-fixup-modifs): Catch unified-diff file-headers.
Diffstat (limited to 'lisp/diff-mode.el')
-rw-r--r--lisp/diff-mode.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index 21b1c6446e5..0a7f1a1950a 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -301,7 +301,7 @@ when editing big diffs)."
;;;;
(defconst diff-hunk-header-re "^\\(@@ -[0-9,]+ \\+[0-9,]+ @@.*\\|\\*\\{15\\}.*\n\\*\\*\\* .+ \\*\\*\\*\\*\\|[0-9]+\\(,[0-9]+\\)?[acd][0-9]+\\(,[0-9]+\\)?\\)$")
-(defconst diff-file-header-re (concat "^\\(--- .+\n\\+\\+\\+\\|\\*\\*\\* .+\n---\\|[^-+!<>0-9@* ]\\).+\n" (substring diff-hunk-header-re 1)))
+(defconst diff-file-header-re (concat "^\\(--- .+\n\\+\\+\\+ \\|\\*\\*\\* .+\n--- \\|[^-+!<>0-9@* ]\\).+\n" (substring diff-hunk-header-re 1)))
(defvar diff-narrowed-to nil)
(defun diff-end-of-hunk (&optional style)
@@ -798,9 +798,12 @@ else cover the whole bufer."
(goto-char end) (diff-end-of-hunk)
(let ((plus 0) (minus 0) (space 0) (bang 0))
(while (and (= (forward-line -1) 0) (<= start (point)))
- (if (not (looking-at "\\(@@ -[0-9,]+ \\+[0-9,]+ @@.*\\|[-*][-*][-*] .+ [-*][-*][-*][-*]\\)$"))
+ (if (not (looking-at
+ (concat "@@ -[0-9,]+ \\+[0-9,]+ @@"
+ "\\|[-*][-*][-*] [0-9,]+ [-*][-*][-*][-*]$"
+ "\\|--- .+\n\\+\\+\\+ ")))
(case (char-after)
- (?\ (incf space))
+ (?\s (incf space))
(?+ (incf plus))
(?- (incf minus))
(?! (incf bang))