From 5fd229735384a5fa479466124a181bf7d4ea8dab Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Sat, 6 Jan 2018 20:15:04 +0000 Subject: [PATCH] Make transpose-regions invoke before-change-functions only once. In the case of two non-contiguous regions the same size, transpose-regions has been calling before-change-functions twice, once for each region. It now calls it just once, for the minimal region spanning both single regions. * src/editfns.c (Ftranspose_regions): Combine two calls of modify_text into one. --- src/editfns.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/editfns.c b/src/editfns.c index 4a66aeeeb67..80871a778b9 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -5293,8 +5293,7 @@ Transposing beyond buffer boundaries is an error. */) { USE_SAFE_ALLOCA; - modify_text (start1, end1); - modify_text (start2, end2); + modify_text (start1, end2); record_change (start1, len1); record_change (start2, len2); tmp_interval1 = copy_intervals (cur_intv, start1, len1); -- 2.39.5