aboutsummaryrefslogtreecommitdiffstats
path: root/src/editfns.c
diff options
context:
space:
mode:
authorLeo Liu2011-05-26 13:36:55 +0800
committerLeo Liu2011-05-26 13:36:55 +0800
commit0f4aebc0ebc91099461f5af63f3034709336f233 (patch)
tree1d4f479bdedcd33ac1d90855b95cedf5eba88a86 /src/editfns.c
parente4245494bac8d6305d408772c1fa99b28b36612d (diff)
downloademacs-0f4aebc0ebc91099461f5af63f3034709336f233.tar.gz
emacs-0f4aebc0ebc91099461f5af63f3034709336f233.zip
Allow empty regions in transpose-regions
See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8699.
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 5e1dcce0275..881e0c7f3e2 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -4353,8 +4353,9 @@ Transposing beyond buffer boundaries is an error. */)
4353 4353
4354 if (start2 < end1) 4354 if (start2 < end1)
4355 error ("Transposed regions overlap"); 4355 error ("Transposed regions overlap");
4356 else if (start1 == end1 || start2 == end2) 4356 /* Nothing to change for adjacent regions with one being empty */
4357 error ("Transposed region has length 0"); 4357 else if ((start1 == end1 || start2 == end2) && end1 == start2)
4358 return Qnil;
4358 4359
4359 /* The possibilities are: 4360 /* The possibilities are:
4360 1. Adjacent (contiguous) regions, or separate but equal regions 4361 1. Adjacent (contiguous) regions, or separate but equal regions