aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1996-12-20 18:15:52 +0000
committerRichard M. Stallman1996-12-20 18:15:52 +0000
commitca41a64d0088a946458d2be3f826d736390a1739 (patch)
tree52125c0e1c214f276f83a1e112fd6820df984751 /src
parent97f7b3b252f6aee554e704218c3494d89797a04c (diff)
downloademacs-ca41a64d0088a946458d2be3f826d736390a1739.tar.gz
emacs-ca41a64d0088a946458d2be3f826d736390a1739.zip
(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')
-rw-r--r--src/intervals.c40
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)
769 So split this interval at the insertion point. */ 769 So split this interval at the insertion point. */
770 if (! (position == i->position || eobp) 770 if (! (position == i->position || eobp)
771 && END_NONSTICKY_P (i) 771 && END_NONSTICKY_P (i)
772 && ! FRONT_STICKY_P (i)) 772 && FRONT_NONSTICKY_P (i))
773 { 773 {
774 temp = split_interval_right (i, position - i->position); 774 Lisp_Object tail;
775 copy_properties (i, temp); 775 Lisp_Object front, rear;
776 i = temp; 776
777 front = textget (i->plist, Qfront_sticky);
778 rear = textget (i->plist, Qrear_nonsticky);
779
780 /* Does any actual property pose an actual problem? */
781 for (tail = i->plist; ! NILP (tail); tail = Fcdr (Fcdr (tail)))
782 {
783 Lisp_Object prop;
784 prop = XCONS (tail)->car;
785
786 /* Is this particular property rear-sticky?
787 Note, if REAR isn't a cons, it must be non-nil,
788 which means that all properties are rear-nonsticky. */
789 if (CONSP (rear) && NILP (Fmemq (prop, rear)))
790 continue;
791
792 /* Is this particular property front-sticky?
793 Note, if FRONT isn't a cons, it must be nil,
794 which means that all properties are front-nonsticky. */
795 if (CONSP (front) && ! NILP (Fmemq (prop, front)))
796 continue;
797
798 /* PROP isn't sticky on either side => it is a real problem. */
799 break;
800 }
801
802 /* If any property is a real problem, split the interval. */
803 if (! NILP (tail))
804 {
805 temp = split_interval_right (i, position - i->position);
806 copy_properties (i, temp);
807 i = temp;
808 }
777 } 809 }
778 810
779 /* If we are positioned between intervals, check the stickiness of 811 /* If we are positioned between intervals, check the stickiness of