summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-07-31 21:54:10 +0000
committerRichard M. Stallman <rms@gnu.org>1993-07-31 21:54:10 +0000
commit19e1c4260a37d64f4533d30524a767fb4c4d9807 (patch)
tree3d30ffebac2ad8d31c32e5bdd31ebee4b3a21207 /src
parent964141f28950bc7571eebb2c92d1d3c70c5f2cb0 (diff)
downloademacs-19e1c4260a37d64f4533d30524a767fb4c4d9807.tar.gz
(Qfront_sticky, Qrear_nonsticky): New variables.
(syms_of_textprop): Set them up. (Qhidden): New variable. (syms_of_textprop): Set up Qhidden. (property_change_between_p): New function.
Diffstat (limited to 'src')
-rw-r--r--src/textprop.c42
1 files changed, 40 insertions, 2 deletions
diff --git a/src/textprop.c b/src/textprop.c
index a007e4eb3b2..b324217907e 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -48,7 +48,10 @@ Lisp_Object Qlocal_map;
/* Visual properties text (including strings) may have. */
Lisp_Object Qforeground, Qbackground, Qfont, Qunderline, Qstipple;
-Lisp_Object Qinvisible, Qread_only;
+Lisp_Object Qinvisible, Qread_only, Qhidden;
+
+/* Sticky properties */
+Lisp_Object Qfront_sticky, Qrear_nonsticky;
/* If o1 is a cons whose cdr is a cons, return non-zero and set o2 to
the o1's cdr. Otherwise, return zero. This is handy for
@@ -543,7 +546,36 @@ If the value is non-nil, it is a position greater than POS, never equal.")
return Qnil;
return next->position - (XTYPE (object) == Lisp_String);
-;
+}
+
+/* Return 1 if there's a change in some property between BEG and END. */
+
+int
+property_change_between_p (beg, end)
+ int beg, end;
+{
+ register INTERVAL i, next;
+ Lisp_Object object, pos;
+
+ XSET (object, Lisp_Buffer, current_buffer);
+ XFASTINT (pos) = beg;
+
+ i = validate_interval_range (object, &pos, &pos, soft);
+ if (NULL_INTERVAL_P (i))
+ return 0;
+
+ next = next_interval (i);
+ while (! NULL_INTERVAL_P (next) && intervals_equal (i, next))
+ {
+ next = next_interval (next);
+ if (next->position >= end)
+ return 0;
+ }
+
+ if (NULL_INTERVAL_P (next))
+ return 0;
+
+ return 1;
}
DEFUN ("next-single-property-change", Fnext_single_property_change,
@@ -1201,10 +1233,16 @@ percentage by which the left interval tree should not differ from the right.");
Qread_only = intern ("read-only");
staticpro (&Qinvisible);
Qinvisible = intern ("invisible");
+ staticpro (&Qhidden);
+ Qhidden = intern ("hidden");
staticpro (&Qcategory);
Qcategory = intern ("category");
staticpro (&Qlocal_map);
Qlocal_map = intern ("local-map");
+ staticpro (&Qfront_sticky);
+ Qfront_sticky = intern ("front-sticky");
+ staticpro (&Qrear_nonsticky);
+ Qrear_nonsticky = intern ("rear-nonsticky");
/* Properties that text might use to specify certain actions */