changeset 111516:80d61d4081a0

* lisp/vc/smerge-mode.el (smerge-refine): Choose better default part to highlight when one of them is empty.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 12 Nov 2010 08:35:36 -0500
parents dd011cba2fbf
children 275f265c56c5
files lisp/ChangeLog lisp/vc/smerge-mode.el
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Nov 12 08:33:44 2010 -0500
+++ b/lisp/ChangeLog	Fri Nov 12 08:35:36 2010 -0500
@@ -1,5 +1,8 @@
 2010-11-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* vc/smerge-mode.el (smerge-refine): Choose better default part to
+	highlight when one of them is empty.
+
 	* skeleton.el (skeleton-read): Don't use `newline' since it may strip
 	trailing space.
 	(skeleton-newline): New function.
--- a/lisp/vc/smerge-mode.el	Fri Nov 12 08:33:44 2010 -0500
+++ b/lisp/vc/smerge-mode.el	Fri Nov 12 08:35:36 2010 -0500
@@ -1009,6 +1009,10 @@
   (setq part (cond ((null (match-end 2)) 2)
                    ((eq (match-end 1) (match-end 3)) 1)
                    ((integerp part) part)
+                   ;; If one of the parts is empty, any refinement using
+                   ;; it will be trivial and uninteresting.
+                   ((eq (match-end 1) (match-beginning 1)) 1)
+                   ((eq (match-end 3) (match-beginning 3)) 3)
                    (t 2)))
   (let ((n1 (if (eq part 1) 2 1))
         (n2 (if (eq part 3) 2 3)))