From 56cee3783dd30eaaf0b36f2fd8fa85525b6c4f2c Mon Sep 17 00:00:00 2001 Date: Sat, 14 May 2011 19:27:33 +0800 Subject: [PATCH] Allow empty regions in transpose-region --- src/editfns.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/editfns.c b/src/editfns.c index feae8316..1022b944 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -4411,8 +4411,9 @@ Transposing beyond buffer boundaries is an error. */) if (start2 < end1) error ("Transposed regions overlap"); - else if (start1 == end1 || start2 == end2) - error ("Transposed region has length 0"); + /* Nothing to change for adjacent regions with one being empty */ + else if ((start1 == end1 || start2 == end2) && end1 == start2) + return Qnil; /* The possibilities are: 1. Adjacent (contiguous) regions, or separate but equal regions -- 1.7.5-rc2