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: Wed, 12 Sep 2007 05:11:12 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Branch:         EMACS_22_BASE
Changes by:     Stefan Monnier <monnier>        07/09/12 05:11:11

Index: diff-mode.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/diff-mode.el,v
retrieving revision 1.99.2.4
retrieving revision 1.99.2.5
diff -u -b -r1.99.2.4 -r1.99.2.5
--- diff-mode.el        27 Aug 2007 07:10:50 -0000      1.99.2.4
+++ diff-mode.el        12 Sep 2007 05:11:07 -0000      1.99.2.5
@@ -1181,7 +1181,16 @@
             (while
                 (case (char-after)
                   (?\s (decf before) (decf after) t)
-                  (?- (decf before) t)
+                  (?-
+                   (if (and (looking-at diff-file-header-re)
+                            (zerop before) (zerop after))
+                       ;; No need to query: this is a case where two patches
+                       ;; are concatenated and only counting the lines will
+                       ;; give the right result.  Let's just add an empty
+                       ;; line so that our code which doesn't count lines
+                       ;; will not get confused.
+                       (progn (save-excursion (insert "\n")) nil)
+                     (decf before) t))
                   (?+ (decf after) t)
                   (t
                    (cond




reply via email to

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