emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/diff-mode.el,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/diff-mode.el,v
Date: Sat, 05 Apr 2008 23:01:32 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     08/04/05 23:01:26

Index: lisp/diff-mode.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/diff-mode.el,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -b -r1.138 -r1.139
--- lisp/diff-mode.el   5 Apr 2008 00:56:31 -0000       1.138
+++ lisp/diff-mode.el   5 Apr 2008 23:01:25 -0000       1.139
@@ -438,12 +438,23 @@
       (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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]