aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/keyboard.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 8d7e67cf294..8dcd1abd5f8 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1,5 +1,5 @@
1/* Keyboard and mouse input; editor command loop. 1/* Keyboard and mouse input; editor command loop.
2 Copyright (C) 1985,86,87,88,89,93,94,95,96,97,99, 2000, 01, 02 2 Copyright (C) 1985,86,87,88,89,93,94,95,96,97,99,2000,01,02,03
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -1874,7 +1874,10 @@ adjust_point_for_property (last_pt, modified)
1874 int beg, end; 1874 int beg, end;
1875 Lisp_Object val, overlay, tmp; 1875 Lisp_Object val, overlay, tmp;
1876 int check_composition = 1, check_display = 1, check_invisible = 1; 1876 int check_composition = 1, check_display = 1, check_invisible = 1;
1877 int orig_pt = PT;
1877 1878
1879 /* FIXME: cycling is probably not necessary because these properties
1880 can't be usefully combined anyway. */
1878 while (check_composition || check_display || check_invisible) 1881 while (check_composition || check_display || check_invisible)
1879 { 1882 {
1880 if (check_composition 1883 if (check_composition
@@ -1941,7 +1944,19 @@ adjust_point_for_property (last_pt, modified)
1941 /* Move away from the inside area. */ 1944 /* Move away from the inside area. */
1942 if (beg < PT && end > PT) 1945 if (beg < PT && end > PT)
1943 { 1946 {
1944 SET_PT (PT < last_pt ? beg : end); 1947 SET_PT ((orig_pt == PT && (last_pt < beg || last_pt > end))
1948 /* We haven't moved yet (so we don't need to fear
1949 infinite-looping) and we were outside the range
1950 before (so either end of the range still corresponds
1951 to a move in the right direction): pretend we moved
1952 less than we actually did, so that we still have
1953 more freedom below in choosing which end of the range
1954 to go to. */
1955 ? (PT < last_pt ? end : beg)
1956 /* We either have moved already or the last point
1957 was already in the range: we don't get to choose
1958 which end of the range we have to go to. */
1959 : (PT < last_pt ? beg : end));
1945 check_composition = check_display = 1; 1960 check_composition = check_display = 1;
1946 } 1961 }
1947 xassert (PT == beg || PT == end); 1962 xassert (PT == beg || PT == end);