Mercurial > emacs
comparison src/keyboard.c @ 50941:5490960951c1
(adjust_point_for_property): Try harder to move point
to the non-sticky end of an invisible property.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sat, 10 May 2003 16:36:02 +0000 |
parents | 62632c0ed6ea |
children | 111b4f1da171 |
comparison
equal
deleted
inserted
replaced
50940:ee3ba06bba1a | 50941:5490960951c1 |
---|---|
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 |
5 This file is part of GNU Emacs. | 5 This file is part of GNU Emacs. |
6 | 6 |
7 GNU Emacs is free software; you can redistribute it and/or modify | 7 GNU Emacs is free software; you can redistribute it and/or modify |
1872 int modified; | 1872 int modified; |
1873 { | 1873 { |
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 | 1877 int orig_pt = PT; |
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 |
1881 && PT > BEGV && PT < ZV | 1884 && PT > BEGV && PT < ZV |
1882 && get_property_and_range (PT, Qcomposition, &val, &beg, &end, Qnil) | 1885 && get_property_and_range (PT, Qcomposition, &val, &beg, &end, Qnil) |
1939 } | 1942 } |
1940 | 1943 |
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); |
1948 /* Pretend the area doesn't exist if the buffer is not | 1963 /* Pretend the area doesn't exist if the buffer is not |
1949 modified. */ | 1964 modified. */ |