diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-12-20 18:15:52 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-12-20 18:15:52 +0000 |
commit | 494f00da61e10554f6bb101da0d98c60b8ba044a (patch) | |
tree | 2163cd0378f12d4c9b34b8d0e317b3b908df9b53 /src/intervals.c | |
parent | ee120aa324c9a9f596e5a786cbe5e9030cc011a3 (diff) | |
download | emacs-494f00da61e10554f6bb101da0d98c60b8ba044a.tar.gz |
(set_point): Use virtual bounds, not real bounds,
in the abort test for POSITION.
Skip the intangibility test if POSITION is at either end of buffer.
Diffstat (limited to 'src/intervals.c')
-rw-r--r-- | src/intervals.c | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/src/intervals.c b/src/intervals.c index de5e3b30f5d..cff718d1f8e 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -769,11 +769,43 @@ adjust_intervals_for_insertion (tree, position, length) So split this interval at the insertion point. */ if (! (position == i->position || eobp) && END_NONSTICKY_P (i) - && ! FRONT_STICKY_P (i)) + && FRONT_NONSTICKY_P (i)) { - temp = split_interval_right (i, position - i->position); - copy_properties (i, temp); - i = temp; + Lisp_Object tail; + Lisp_Object front, rear; + + front = textget (i->plist, Qfront_sticky); + rear = textget (i->plist, Qrear_nonsticky); + + /* Does any actual property pose an actual problem? */ + for (tail = i->plist; ! NILP (tail); tail = Fcdr (Fcdr (tail))) + { + Lisp_Object prop; + prop = XCONS (tail)->car; + + /* Is this particular property rear-sticky? + Note, if REAR isn't a cons, it must be non-nil, + which means that all properties are rear-nonsticky. */ + if (CONSP (rear) && NILP (Fmemq (prop, rear))) + continue; + + /* Is this particular property front-sticky? + Note, if FRONT isn't a cons, it must be nil, + which means that all properties are front-nonsticky. */ + if (CONSP (front) && ! NILP (Fmemq (prop, front))) + continue; + + /* PROP isn't sticky on either side => it is a real problem. */ + break; + } + + /* If any property is a real problem, split the interval. */ + if (! NILP (tail)) + { + temp = split_interval_right (i, position - i->position); + copy_properties (i, temp); + i = temp; + } } /* If we are positioned between intervals, check the stickiness of |