Mercurial > emacs
comparison lisp/diff-mode.el @ 93759:4e76a03232e5
Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1107
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sat, 05 Apr 2008 23:01:26 +0000 |
parents | 3636fd479ab3 448b3f1d280a |
children | 28e6262d77ad |
comparison
equal
deleted
inserted
replaced
93758:abcbb8375c30 | 93759:4e76a03232e5 |
---|---|
436 (when (looking-at diff-hunk-header-re) | 436 (when (looking-at diff-hunk-header-re) |
437 ;; Especially important for unified (because headers are ambiguous). | 437 ;; Especially important for unified (because headers are ambiguous). |
438 (setq style (diff-hunk-style style)) | 438 (setq style (diff-hunk-style style)) |
439 (goto-char (match-end 0)) | 439 (goto-char (match-end 0)) |
440 (when (and (not donttrustheader) (match-end 2)) | 440 (when (and (not donttrustheader) (match-end 2)) |
441 (let* ((nold (string-to-number (match-string 2))) | |
442 (nnew (string-to-number (match-string 4))) | |
443 (endold | |
441 (save-excursion | 444 (save-excursion |
442 (re-search-forward (if diff-valid-unified-empty-line | 445 (re-search-forward (if diff-valid-unified-empty-line |
443 "^[- \n]" "^[- ]") | 446 "^[- \n]" "^[- ]") |
444 nil t | 447 nil t nold) |
445 (string-to-number (match-string 2))) | 448 (line-beginning-position 2))) |
446 (setq end (line-beginning-position 2))))) | 449 (endnew |
450 ;; The hunk may end with a bunch of "+" lines, so the `end' is | |
451 ;; then further than computed above. | |
452 (save-excursion | |
453 (re-search-forward (if diff-valid-unified-empty-line | |
454 "^[+ \n]" "^[+ ]") | |
455 nil t nnew) | |
456 (line-beginning-position 2)))) | |
457 (setq end (max endold endnew))))) | |
447 ;; We may have a first evaluation of `end' thanks to the hunk header. | 458 ;; We may have a first evaluation of `end' thanks to the hunk header. |
448 (unless end | 459 (unless end |
449 (setq end (and (re-search-forward | 460 (setq end (and (re-search-forward |
450 (case style | 461 (case style |
451 (unified (concat (if diff-valid-unified-empty-line | 462 (unified (concat (if diff-valid-unified-empty-line |