301 |
;;;; |
;;;; |
302 |
|
|
303 |
(defconst diff-hunk-header-re "^\\(@@ -[0-9,]+ \\+[0-9,]+ @@.*\\|\\*\\{15\\}.*\n\\*\\*\\* .+ \\*\\*\\*\\*\\|[0-9]+\\(,[0-9]+\\)?[acd][0-9]+\\(,[0-9]+\\)?\\)$") |
(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))) |
(defconst diff-file-header-re (concat "^\\(--- .+\n\\+\\+\\+ \\|\\*\\*\\* .+\n--- \\|[^-+!<>0-9@* ]\\).+\n" (substring diff-hunk-header-re 1))) |
305 |
(defvar diff-narrowed-to nil) |
(defvar diff-narrowed-to nil) |
306 |
|
|
307 |
(defun diff-end-of-hunk (&optional style) |
(defun diff-end-of-hunk (&optional style) |
798 |
(goto-char end) (diff-end-of-hunk) |
(goto-char end) (diff-end-of-hunk) |
799 |
(let ((plus 0) (minus 0) (space 0) (bang 0)) |
(let ((plus 0) (minus 0) (space 0) (bang 0)) |
800 |
(while (and (= (forward-line -1) 0) (<= start (point))) |
(while (and (= (forward-line -1) 0) (<= start (point))) |
801 |
(if (not (looking-at "\\(@@ -[0-9,]+ \\+[0-9,]+ @@.*\\|[-*][-*][-*] .+ [-*][-*][-*][-*]\\)$")) |
(if (not (looking-at |
802 |
|
(concat "@@ -[0-9,]+ \\+[0-9,]+ @@" |
803 |
|
"\\|[-*][-*][-*] [0-9,]+ [-*][-*][-*][-*]$" |
804 |
|
"\\|--- .+\n\\+\\+\\+ "))) |
805 |
(case (char-after) |
(case (char-after) |
806 |
(?\ (incf space)) |
(?\s (incf space)) |
807 |
(?+ (incf plus)) |
(?+ (incf plus)) |
808 |
(?- (incf minus)) |
(?- (incf minus)) |
809 |
(?! (incf bang)) |
(?! (incf bang)) |