aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-05-15 22:35:30 -0700
committerPaul Eggert2011-05-15 22:35:30 -0700
commitd2d818bf00fa3a3204abd9b31103cfca21ff8125 (patch)
treedf846ff0c7db8606942243e10fb8792eaf7bba6b
parentef3ff03613106225ad047d1dd04219d460e897d9 (diff)
parent1aba75c248ae6f38007c5808186f2e454ef3036d (diff)
downloademacs-d2d818bf00fa3a3204abd9b31103cfca21ff8125.tar.gz
emacs-d2d818bf00fa3a3204abd9b31103cfca21ff8125.zip
Merge from mainline.
-rw-r--r--lisp/vc/diff-mode.el82
1 files changed, 41 insertions, 41 deletions
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 7db34dfd11b..a493f0dcfc0 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -1118,47 +1118,47 @@ else cover the whole buffer."
1118 (save-excursion 1118 (save-excursion
1119 (goto-char end) (diff-end-of-hunk nil 'donttrustheader) 1119 (goto-char end) (diff-end-of-hunk nil 'donttrustheader)
1120 (let ((plus 0) (minus 0) (space 0) (bang 0)) 1120 (let ((plus 0) (minus 0) (space 0) (bang 0))
1121 while (and (= (forward-line -1) 0) (<= start (point))) 1121 (while (and (= (forward-line -1) 0) (<= start (point)))
1122 (if (not (looking-at 1122 (if (not (looking-at
1123 (concat diff-hunk-header-re-unified 1123 (concat diff-hunk-header-re-unified
1124 "\\|[-*][-*][-*] [0-9,]+ [-*][-*][-*][-*]$" 1124 "\\|[-*][-*][-*] [0-9,]+ [-*][-*][-*][-*]$"
1125 "\\|--- .+\n\\+\\+\\+ "))) 1125 "\\|--- .+\n\\+\\+\\+ ")))
1126 (case (char-after) 1126 (case (char-after)
1127 (?\s (incf space)) 1127 (?\s (incf space))
1128 (?+ (incf plus)) 1128 (?+ (incf plus))
1129 (?- (incf minus)) 1129 (?- (incf minus))
1130 (?! (incf bang)) 1130 (?! (incf bang))
1131 ((?\\ ?#) nil) 1131 ((?\\ ?#) nil)
1132 (t (setq space 0 plus 0 minus 0 bang 0))) 1132 (t (setq space 0 plus 0 minus 0 bang 0)))
1133 (cond 1133 (cond
1134 ((looking-at diff-hunk-header-re-unified) 1134 ((looking-at diff-hunk-header-re-unified)
1135 (let* ((old1 (match-string 2)) 1135 (let* ((old1 (match-string 2))
1136 (old2 (match-string 4)) 1136 (old2 (match-string 4))
1137 (new1 (number-to-string (+ space minus))) 1137 (new1 (number-to-string (+ space minus)))
1138 (new2 (number-to-string (+ space plus)))) 1138 (new2 (number-to-string (+ space plus))))
1139 (if old2 1139 (if old2
1140 (unless (string= new2 old2) (replace-match new2 t t nil 4)) 1140 (unless (string= new2 old2) (replace-match new2 t t nil 4))
1141 (goto-char (match-end 3)) 1141 (goto-char (match-end 3))
1142 (insert "," new2)) 1142 (insert "," new2))
1143 (if old1 1143 (if old1
1144 (unless (string= new1 old1) (replace-match new1 t t nil 2)) 1144 (unless (string= new1 old1) (replace-match new1 t t nil 2))
1145 (goto-char (match-end 1)) 1145 (goto-char (match-end 1))
1146 (insert "," new1)))) 1146 (insert "," new1))))
1147 ((looking-at diff-context-mid-hunk-header-re) 1147 ((looking-at diff-context-mid-hunk-header-re)
1148 (when (> (+ space bang plus) 0) 1148 (when (> (+ space bang plus) 0)
1149 (let* ((old1 (match-string 1)) 1149 (let* ((old1 (match-string 1))
1150 (old2 (match-string 2)) 1150 (old2 (match-string 2))
1151 (new (number-to-string 1151 (new (number-to-string
1152 (+ space bang plus -1 (string-to-number old1))))) 1152 (+ space bang plus -1 (string-to-number old1)))))
1153 (unless (string= new old2) (replace-match new t t nil 2))))) 1153 (unless (string= new old2) (replace-match new t t nil 2)))))
1154 ((looking-at "\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]*\\) \\*\\*\\*\\*$") 1154 ((looking-at "\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]*\\) \\*\\*\\*\\*$")
1155 (when (> (+ space bang minus) 0) 1155 (when (> (+ space bang minus) 0)
1156 (let* ((old (match-string 1)) 1156 (let* ((old (match-string 1))
1157 (new (format 1157 (new (format
1158 (concat "%0" (number-to-string (length old)) "d") 1158 (concat "%0" (number-to-string (length old)) "d")
1159 (+ space bang minus -1 (string-to-number old))))) 1159 (+ space bang minus -1 (string-to-number old)))))
1160 (unless (string= new old) (replace-match new t t nil 2)))))) 1160 (unless (string= new old) (replace-match new t t nil 2))))))
1161 (setq space 0 plus 0 minus 0 bang 0)))))) 1161 (setq space 0 plus 0 minus 0 bang 0)))))))
1162 1162
1163;;;; 1163;;;;
1164;;;; Hooks 1164;;;; Hooks