aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/diff-mode.el
diff options
context:
space:
mode:
authorStefan Monnier2004-09-29 17:42:50 +0000
committerStefan Monnier2004-09-29 17:42:50 +0000
commitbd9d7d76f01d7f4df84e8a441029f211364d8292 (patch)
tree107234b1848926916690f1e0de64b30260565629 /lisp/diff-mode.el
parent0e9e9a2cc4ff7d30f55124427aafa07a36162416 (diff)
downloademacs-bd9d7d76f01d7f4df84e8a441029f211364d8292.tar.gz
emacs-bd9d7d76f01d7f4df84e8a441029f211364d8292.zip
(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)."
301;;;; 301;;;;
302 302
303(defconst diff-hunk-header-re "^\\(@@ -[0-9,]+ \\+[0-9,]+ @@.*\\|\\*\\{15\\}.*\n\\*\\*\\* .+ \\*\\*\\*\\*\\|[0-9]+\\(,[0-9]+\\)?[acd][0-9]+\\(,[0-9]+\\)?\\)$") 303(defconst diff-hunk-header-re "^\\(@@ -[0-9,]+ \\+[0-9,]+ @@.*\\|\\*\\{15\\}.*\n\\*\\*\\* .+ \\*\\*\\*\\*\\|[0-9]+\\(,[0-9]+\\)?[acd][0-9]+\\(,[0-9]+\\)?\\)$")
304(defconst diff-file-header-re (concat "^\\(--- .+\n\\+\\+\\+\\|\\*\\*\\* .+\n---\\|[^-+!<>0-9@* ]\\).+\n" (substring diff-hunk-header-re 1))) 304(defconst diff-file-header-re (concat "^\\(--- .+\n\\+\\+\\+ \\|\\*\\*\\* .+\n--- \\|[^-+!<>0-9@* ]\\).+\n" (substring diff-hunk-header-re 1)))
305(defvar diff-narrowed-to nil) 305(defvar diff-narrowed-to nil)
306 306
307(defun diff-end-of-hunk (&optional style) 307(defun diff-end-of-hunk (&optional style)
@@ -798,9 +798,12 @@ else cover the whole bufer."
798 (goto-char end) (diff-end-of-hunk) 798 (goto-char end) (diff-end-of-hunk)
799 (let ((plus 0) (minus 0) (space 0) (bang 0)) 799 (let ((plus 0) (minus 0) (space 0) (bang 0))
800 (while (and (= (forward-line -1) 0) (<= start (point))) 800 (while (and (= (forward-line -1) 0) (<= start (point)))
801 (if (not (looking-at "\\(@@ -[0-9,]+ \\+[0-9,]+ @@.*\\|[-*][-*][-*] .+ [-*][-*][-*][-*]\\)$")) 801 (if (not (looking-at
802 (concat "@@ -[0-9,]+ \\+[0-9,]+ @@"
803 "\\|[-*][-*][-*] [0-9,]+ [-*][-*][-*][-*]$"
804 "\\|--- .+\n\\+\\+\\+ ")))
802 (case (char-after) 805 (case (char-after)
803 (?\ (incf space)) 806 (?\s (incf space))
804 (?+ (incf plus)) 807 (?+ (incf plus))
805 (?- (incf minus)) 808 (?- (incf minus))
806 (?! (incf bang)) 809 (?! (incf bang))