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 [EMACS_22_BASE]


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/diff-mode.el,v [EMACS_22_BASE]
Date: Tue, 18 Mar 2008 20:49:54 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Branch:         EMACS_22_BASE
Changes by:     Stefan Monnier <monnier>        08/03/18 20:49:52

Index: diff-mode.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/diff-mode.el,v
retrieving revision 1.99.2.13
retrieving revision 1.99.2.14
diff -u -b -r1.99.2.13 -r1.99.2.14
--- diff-mode.el        29 Feb 2008 02:40:10 -0000      1.99.2.13
+++ diff-mode.el        18 Mar 2008 20:49:52 -0000      1.99.2.14
@@ -402,12 +402,23 @@
         (setq style (cdr (assq (char-after) '((?@ . unified) (?* . 
context))))))
       (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]