Lisp_Object Vinhibit_point_motion_hooks;
Lisp_Object Vdefault_text_properties;
+Lisp_Object Vchar_property_alias_alist;
Lisp_Object Vtext_property_default_nonsticky;
/* verify_interval_modification saves insertion hooks here
}
else
{
- register struct Lisp_String *s = XSTRING (object);
+ int len = SCHARS (object);
if (! (0 <= XINT (*begin) && XINT (*begin) <= XINT (*end)
- && XINT (*end) <= s->size))
+ && XINT (*end) <= len))
args_out_of_range (*begin, *end);
XSETFASTINT (*begin, XFASTINT (*begin));
if (begin != end)
XSETFASTINT (*end, XFASTINT (*end));
- i = s->intervals;
+ i = STRING_INTERVALS (object);
- if (s->size == 0)
+ if (len == 0)
return NULL_INTERVAL;
searchpos = XINT (*begin);
register Lisp_Object tail1, tail2, sym, current_plist;
register int changed = 0;
- /* Nonzero means tail1 is a list, otherwise it is a plist. */
- int use_list;
+ /* Nonzero means tail1 is a plist, otherwise it is a list. */
+ int use_plist;
current_plist = i->plist;
if (! NILP (plist))
- tail1 = plist, use_list = 0;
+ tail1 = plist, use_plist = 1;
else
- tail1 = list, use_list = 1;
+ tail1 = list, use_plist = 0;
/* Go through each element of LIST or PLIST. */
- while (! NILP (tail1))
+ while (CONSP (tail1))
{
sym = XCAR (tail1);
/* First, remove the symbol if it's at the head of the list */
- while (! NILP (current_plist) && EQ (sym, XCAR (current_plist)))
+ while (CONSP (current_plist) && EQ (sym, XCAR (current_plist)))
{
if (BUFFERP (object))
record_property_change (i->position, LENGTH (i),
{
register Lisp_Object this;
this = XCDR (XCDR (tail2));
- if (EQ (sym, XCAR (this)))
+ if (CONSP (this) && EQ (sym, XCAR (this)))
{
if (BUFFERP (object))
record_property_change (i->position, LENGTH (i),
}
/* Advance thru TAIL1 one way or the other. */
- if (use_list)
+ tail1 = XCDR (tail1);
+ if (use_plist && CONSP (tail1))
tail1 = XCDR (tail1);
- else
- tail1 = XCDR (XCDR (tail1));
}
if (changed)
}
else
{
- register struct Lisp_String *s = XSTRING (object);
-
beg = 0;
- end = s->size;
- i = s->intervals;
+ end = SCHARS (object);
+ i = STRING_INTERVALS (object);
}
if (!(beg <= position && position <= end))
if (NILP (position))
{
if (NILP (limit))
- position = make_number (XSTRING (object)->size);
+ position = make_number (SCHARS (object));
else
position = limit;
}
else
{
Lisp_Object initial_value, value;
- int count = specpdl_ptr - specpdl;
+ int count = SPECPDL_INDEX ();
if (! NILP (object))
CHECK_BUFFER (object);
if (NILP (position))
{
if (NILP (limit))
- position = make_number (XSTRING (object)->size);
+ position = make_number (SCHARS (object));
else
position = limit;
}
}
else
{
- int count = specpdl_ptr - specpdl;
+ int count = SPECPDL_INDEX ();
if (! NILP (object))
CHECK_BUFFER (object);
if (NULL_INTERVAL_P (next))
XSETFASTINT (position, (STRINGP (object)
- ? XSTRING (object)->size
+ ? SCHARS (object)
: BUF_ZV (XBUFFER (object))));
else
XSETFASTINT (position, next->position);
return limit;
if (NILP (limit))
XSETFASTINT (limit, (STRINGP (object)
- ? XSTRING (object)->size
+ ? SCHARS (object)
: BUF_ZV (XBUFFER (object))));
if (!(next->position < XFASTINT (limit)))
return limit;
return limit;
if (NILP (limit))
XSETFASTINT (limit, (STRINGP (object)
- ? XSTRING (object)->size
+ ? SCHARS (object)
: BUF_ZV (XBUFFER (object))));
if (!(next->position < XFASTINT (limit)))
return limit;
get rid of its intervals. */
if (NILP (properties) && STRINGP (object)
&& XFASTINT (start) == 0
- && XFASTINT (end) == XSTRING (object)->size)
+ && XFASTINT (end) == SCHARS (object))
{
- if (! XSTRING (object)->intervals)
+ if (! STRING_INTERVALS (object))
return Qt;
- XSTRING (object)->intervals = 0;
+ STRING_SET_INTERVALS (object, NULL_INTERVAL);
return Qt;
}
character that does not have its own value for that property. */);
Vdefault_text_properties = Qnil;
+ DEFVAR_LISP ("char-property-alias-alist", &Vchar_property_alias_alist,
+ doc: /* Alist of alternative properties for properties without a value.
+Each element should look like (PROPERTY ALTERNATIVE1 ALTERNATIVE2...).
+If a piece of text has no direct value for a particular property, then
+this alist is consulted. If that property appears in the alist, then
+the first non-nil value from the associated alternative properties is
+returned. */);
+ Vchar_property_alias_alist = Qnil;
+
DEFVAR_LISP ("inhibit-point-motion-hooks", &Vinhibit_point_motion_hooks,
doc: /* If non-nil, don't run `point-left' and `point-entered' text properties.
This also inhibits the use of the `intangible' text property. */);