diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2009-02-12 18:20:52 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2009-02-12 18:20:52 +0000 |
commit | 51d861def832ddd0a57cd6b761a432bc4d289333 (patch) | |
tree | cec9821ac52955428d22e68c90e21ecc582afd38 /src/keyboard.c | |
parent | 865ff911f332655d788f73f4f2ef534e0572cee0 (diff) | |
download | emacs-51d861def832ddd0a57cd6b761a432bc4d289333.tar.gz emacs-51d861def832ddd0a57cd6b761a432bc4d289333.tar.bz2 emacs-51d861def832ddd0a57cd6b761a432bc4d289333.zip |
(adjust_point_for_property): Allow stopping betwen two invisible areas.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r-- | src/keyboard.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 8b411fdac8b..9f7648563c0 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2046,6 +2046,20 @@ adjust_point_for_property (last_pt, modified) /* Find boundaries `beg' and `end' of the invisible area, if any. */ while (end < ZV + /* Stop if we find a spot between two runs of + `invisible' where inserted text would be visible. + This is important when we have two invisible + boundaries that enclose an area: if the area is + empty, we need this test in order to make it + possible to place point in the middle rather than + skip both boundaries. + Note that this will stop anywhere in a non-sticky + text-property, but I don't think there's much we + can do about that. */ + && (val = get_pos_property (make_number (end), + Qinvisible, Qnil), + TEXT_PROP_MEANS_INVISIBLE (val)) + /* FIXME: write and then use get_pos_property_and_overlay. */ && !NILP (val = get_char_property_and_overlay (make_number (end), Qinvisible, Qnil, &overlay)) && (inv = TEXT_PROP_MEANS_INVISIBLE (val))) @@ -2059,6 +2073,9 @@ adjust_point_for_property (last_pt, modified) end = NATNUMP (tmp) ? XFASTINT (tmp) : ZV; } while (beg > BEGV + && (val = get_pos_property (make_number (beg), + Qinvisible, Qnil), + TEXT_PROP_MEANS_INVISIBLE (val)) && !NILP (val = get_char_property_and_overlay (make_number (beg - 1), Qinvisible, Qnil, &overlay)) && (inv = TEXT_PROP_MEANS_INVISIBLE (val))) |