aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1994-05-17 03:28:55 +0000
committerKarl Heuer1994-05-17 03:28:55 +0000
commit8de1d5f084ebf5ca165fd6bfe9a9ec72144ce9ee (patch)
treeac6c7438f720e134e7116cf184801fe19a5f2bc2
parent469e5e326fb576a1c033257a166ed1cc44ac438e (diff)
downloademacs-8de1d5f084ebf5ca165fd6bfe9a9ec72144ce9ee.tar.gz
emacs-8de1d5f084ebf5ca165fd6bfe9a9ec72144ce9ee.zip
(Ftranspose_regions): Fix overlays after moving markers.
Update point as if it were a marker.
-rw-r--r--src/editfns.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/editfns.c b/src/editfns.c
index e0b4a489794..28036650c92 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1640,6 +1640,17 @@ transpose_markers (start1, end1, start2, end2)
1640 register Lisp_Object marker; 1640 register Lisp_Object marker;
1641 register struct Lisp_Marker *m; 1641 register struct Lisp_Marker *m;
1642 1642
1643 /* Update point as if it were a marker.
1644 Do this before adjusting the start/end values for the gap. */
1645 if (PT < start1)
1646 ;
1647 else if (PT < end1)
1648 TEMP_SET_PT (PT + (end2 - end1));
1649 else if (PT < start2)
1650 TEMP_SET_PT (PT + (end2 - start2) - (end1 - start1));
1651 else if (PT < end2)
1652 TEMP_SET_PT (PT - (start2 - start1));
1653
1643 /* Internally, marker positions take the gap into account, so if the 1654 /* Internally, marker positions take the gap into account, so if the
1644 * gap is before one or both of the regions, the region's limits 1655 * gap is before one or both of the regions, the region's limits
1645 * must be adjusted to compensate. The caller guaranteed that the 1656 * must be adjusted to compensate. The caller guaranteed that the
@@ -1939,7 +1950,10 @@ Transposing beyond buffer boundaries is an error.")
1939 be nicer, and more beneficial in the long run, but would be a 1950 be nicer, and more beneficial in the long run, but would be a
1940 bunch of work. Plus the way they're arranged now is nice. */ 1951 bunch of work. Plus the way they're arranged now is nice. */
1941 if (NILP (leave_markers)) 1952 if (NILP (leave_markers))
1942 transpose_markers (start1, end1, start2, end2); 1953 {
1954 transpose_markers (start1, end1, start2, end2);
1955 fix_overlays_in_range (start1, end2);
1956 }
1943 1957
1944 return Qnil; 1958 return Qnil;
1945} 1959}