diff options
author | Miles Bader <miles@gnu.org> | 2008-04-05 23:01:26 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2008-04-05 23:01:26 +0000 |
commit | 5bc6ddff00c50acf546530ef0e08a27140614d27 (patch) | |
tree | 22f92034de583fe3df108e166385e30220b426fe /lisp/diff-mode.el | |
parent | d8c852509f6218db43e5f2ca8baace02d4fa1294 (diff) | |
parent | 37128b5497b54367b25ed149ead91821adc65876 (diff) | |
download | emacs-5bc6ddff00c50acf546530ef0e08a27140614d27.tar.gz |
Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1107
Diffstat (limited to 'lisp/diff-mode.el')
-rw-r--r-- | lisp/diff-mode.el | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index 151811c037c..970df74da61 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el @@ -438,12 +438,23 @@ See http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01990.html") (setq style (diff-hunk-style style)) (goto-char (match-end 0)) (when (and (not donttrustheader) (match-end 2)) + (let* ((nold (string-to-number (match-string 2))) + (nnew (string-to-number (match-string 4))) + (endold (save-excursion (re-search-forward (if diff-valid-unified-empty-line "^[- \n]" "^[- ]") - nil t - (string-to-number (match-string 2))) - (setq end (line-beginning-position 2))))) + nil t nold) + (line-beginning-position 2))) + (endnew + ;; The hunk may end with a bunch of "+" lines, so the `end' is + ;; then further than computed above. + (save-excursion + (re-search-forward (if diff-valid-unified-empty-line + "^[+ \n]" "^[+ ]") + nil t nnew) + (line-beginning-position 2)))) + (setq end (max endold endnew))))) ;; We may have a first evaluation of `end' thanks to the hunk header. (unless end (setq end (and (re-search-forward |