]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/vc/smerge-mode.el (smerge-refine): Choose better default part to
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 12 Nov 2010 13:35:36 +0000 (08:35 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 12 Nov 2010 13:35:36 +0000 (08:35 -0500)
highlight when one of them is empty.

lisp/ChangeLog
lisp/vc/smerge-mode.el

index 64c52eebc7b3095456f753786136cd529ac0cabd..4b1e880e5477f24eb4b95b36641cc0016e1f5199 100644 (file)
@@ -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.
index 6e72071b6a0b37d3e9128b00276245841bb35703..32f829f814e5862027b49c9f9cb3acb9a4884908 100644 (file)
@@ -1009,6 +1009,10 @@ repeating the command will highlight other two parts."
   (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)))