aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-03-18 20:49:52 +0000
committerStefan Monnier2008-03-18 20:49:52 +0000
commitaec1ef0729fecde2dc7c322d6bbd52858104d2b7 (patch)
treef11cf6f933b332b8f4af7bcb41a774029f51844c
parent117402b86d9199a8ff226075f804d2f8908dac9e (diff)
downloademacs-aec1ef0729fecde2dc7c322d6bbd52858104d2b7.tar.gz
emacs-aec1ef0729fecde2dc7c322d6bbd52858104d2b7.zip
(diff-end-of-hunk): Be careful not to overlook trailing
"+" lines not accounted for by counting "-" and context lines.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/diff-mode.el17
2 files changed, 21 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 40be75a03b5..a6fa4241630 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,11 +1,16 @@
12008-03-18 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * diff-mode.el (diff-end-of-hunk): Be careful not to overlook trailing
4 "+" lines not accounted for by counting "-" and context lines.
5
12008-03-16 Juri Linkov <juri@jurta.org> 62008-03-16 Juri Linkov <juri@jurta.org>
2 7
3 * dired.el (dired-warn-writable): Rename to `dired-perm-write'. 8 * dired.el (dired-warn-writable): Rename to `dired-perm-write'.
4 (dired-perm-write): Renamed from `dired-warn-writable'. 9 (dired-perm-write): Rename from `dired-warn-writable'.
5 Change parent face from `font-lock-warning-face' to 10 Change parent face from `font-lock-warning-face' to
6 `font-lock-comment-delimiter-face'. 11 `font-lock-comment-delimiter-face'.
7 (dired-warn-writable-face): Rename to `dired-perm-write-face'. 12 (dired-warn-writable-face): Rename to `dired-perm-write-face'.
8 (dired-perm-write-face): Renamed from `dired-warn-writable-face'. 13 (dired-perm-write-face): Rename from `dired-warn-writable-face'.
9 (dired-font-lock-keywords): Replace `dired-warn-writable-face' 14 (dired-font-lock-keywords): Replace `dired-warn-writable-face'
10 with `dired-perm-write-face'. 15 with `dired-perm-write-face'.
11 16
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index c57613dff51..798f5f2e4ec 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -402,12 +402,23 @@ See http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01990.html")
402 (setq style (cdr (assq (char-after) '((?@ . unified) (?* . context)))))) 402 (setq style (cdr (assq (char-after) '((?@ . unified) (?* . context))))))
403 (goto-char (match-end 0)) 403 (goto-char (match-end 0))
404 (when (and (not donttrustheader) (match-end 2)) 404 (when (and (not donttrustheader) (match-end 2))
405 (let* ((nold (string-to-number (match-string 2)))
406 (nnew (string-to-number (match-string 4)))
407 (endold
405 (save-excursion 408 (save-excursion
406 (re-search-forward (if diff-valid-unified-empty-line 409 (re-search-forward (if diff-valid-unified-empty-line
407 "^[- \n]" "^[- ]") 410 "^[- \n]" "^[- ]")
408 nil t 411 nil t nold)
409 (string-to-number (match-string 2))) 412 (line-beginning-position 2)))
410 (setq end (line-beginning-position 2))))) 413 (endnew
414 ;; The hunk may end with a bunch of "+" lines, so the `end' is
415 ;; then further than computed above.
416 (save-excursion
417 (re-search-forward (if diff-valid-unified-empty-line
418 "^[+ \n]" "^[+ ]")
419 nil t nnew)
420 (line-beginning-position 2))))
421 (setq end (max endold endnew)))))
411 ;; We may have a first evaluation of `end' thanks to the hunk header. 422 ;; We may have a first evaluation of `end' thanks to the hunk header.
412 (unless end 423 (unless end
413 (setq end (and (re-search-forward 424 (setq end (and (re-search-forward