/* Interface code for dealing with text properties.
- Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1993-1995, 1997, 1999-2011 Free Software Foundation, Inc.
This file is part of GNU Emacs.
traversing plists. */
#define PLIST_ELT_P(o1, o2) (CONSP (o1) && ((o2)=XCDR (o1), CONSP (o2)))
-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
to be run later by report_interval_modification. */
Lisp_Object interval_insert_behind_hooks;
validate_interval_range (Lisp_Object object, Lisp_Object *begin, Lisp_Object *end, int force)
{
register INTERVAL i;
- int searchpos;
+ EMACS_INT searchpos;
CHECK_STRING_OR_BUFFER (object);
CHECK_NUMBER_COERCE_MARKER (*begin);
}
else
{
- int len = SCHARS (object);
+ EMACS_INT len = SCHARS (object);
if (! (0 <= XINT (*begin) && XINT (*begin) <= XINT (*end)
&& XINT (*end) <= len))
if this changes the interval. */
static INLINE int
-erase_properties (i)
- INTERVAL i;
+erase_properties (INTERVAL i)
{
if (NILP (i->plist))
return 0;
interval_of (int position, Lisp_Object object)
{
register INTERVAL i;
- int beg, end;
+ EMACS_INT beg, end;
if (NILP (object))
XSETBUFFER (object, current_buffer);
/* Return 1 if there's a change in some property between BEG and END. */
int
-property_change_between_p (int beg, int end)
+property_change_between_p (EMACS_INT beg, EMACS_INT end)
{
register INTERVAL i, next;
Lisp_Object object, pos;
(Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object)
{
register INTERVAL i, unchanged;
- register int s, len, modified = 0;
+ register EMACS_INT s, len;
+ register int modified = 0;
struct gcpro gcpro1;
properties = validate_plist (properties);
skip it. */
if (interval_has_all_properties (properties, i))
{
- int got = (LENGTH (i) - (s - i->position));
+ EMACS_INT got = (LENGTH (i) - (s - i->position));
if (got >= len)
RETURN_UNGCPRO (Qnil);
len -= got;
set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object buffer, INTERVAL i)
{
register INTERVAL prev_changed = NULL_INTERVAL;
- register int s, len;
+ register EMACS_INT s, len;
INTERVAL unchanged;
s = XINT (start);
(Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object)
{
register INTERVAL i, unchanged;
- register int s, len, modified = 0;
+ register EMACS_INT s, len;
+ register int modified = 0;
if (NILP (object))
XSETBUFFER (object, current_buffer);
it covers the entire region. */
if (! interval_has_some_properties (properties, i))
{
- int got = (LENGTH (i) - (s - i->position));
+ EMACS_INT got = (LENGTH (i) - (s - i->position));
if (got >= len)
return Qnil;
len -= got;
(Lisp_Object start, Lisp_Object end, Lisp_Object list_of_properties, Lisp_Object object)
{
register INTERVAL i, unchanged;
- register int s, len, modified = 0;
+ register EMACS_INT s, len;
+ register int modified = 0;
Lisp_Object properties;
properties = list_of_properties;
it covers the entire region. */
if (! interval_has_some_properties_list (properties, i))
{
- int got = (LENGTH (i) - (s - i->position));
+ EMACS_INT got = (LENGTH (i) - (s - i->position));
if (got >= len)
return Qnil;
len -= got;
if (LENGTH (i) >= len)
{
if (! interval_has_some_properties_list (properties, i))
- if (modified)
- {
- if (BUFFERP (object))
- signal_after_change (XINT (start), XINT (end) - XINT (start),
- XINT (end) - XINT (start));
- return Qt;
- }
- else
- return Qnil;
-
- if (LENGTH (i) == len)
+ {
+ if (modified)
+ {
+ if (BUFFERP (object))
+ signal_after_change (XINT (start),
+ XINT (end) - XINT (start),
+ XINT (end) - XINT (start));
+ return Qt;
+ }
+ else
+ return Qnil;
+ }
+ else if (LENGTH (i) == len)
{
if (!modified && BUFFERP (object))
modify_region (XBUFFER (object), XINT (start), XINT (end), 1);
XINT (end) - XINT (start));
return Qt;
}
-
- /* i has the properties, and goes past the change limit */
- unchanged = i;
- i = split_interval_left (i, len);
- copy_properties (unchanged, i);
- if (!modified && BUFFERP (object))
- modify_region (XBUFFER (object), XINT (start), XINT (end), 1);
- remove_properties (Qnil, properties, i, object);
- if (BUFFERP (object))
- signal_after_change (XINT (start), XINT (end) - XINT (start),
- XINT (end) - XINT (start));
- return Qt;
+ else
+ { /* i has the properties, and goes past the change limit. */
+ unchanged = i;
+ i = split_interval_left (i, len);
+ copy_properties (unchanged, i);
+ if (!modified && BUFFERP (object))
+ modify_region (XBUFFER (object), XINT (start), XINT (end), 1);
+ remove_properties (Qnil, properties, i, object);
+ if (BUFFERP (object))
+ signal_after_change (XINT (start), XINT (end) - XINT (start),
+ XINT (end) - XINT (start));
+ return Qt;
+ }
}
-
if (interval_has_some_properties_list (properties, i))
{
if (!modified && BUFFERP (object))
(Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object)
{
register INTERVAL i;
- register int e, pos;
+ register EMACS_INT e, pos;
if (NILP (object))
XSETBUFFER (object, current_buffer);
(Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object)
{
register INTERVAL i;
- register int s, e;
+ register EMACS_INT s, e;
if (NILP (object))
XSETBUFFER (object, current_buffer);
Lisp_Object res;
Lisp_Object stuff;
Lisp_Object plist;
- int s, e, e2, p, len, modified = 0;
+ EMACS_INT s, e, e2, p, len;
+ int modified = 0;
struct gcpro gcpro1, gcpro2;
i = validate_interval_range (src, &start, &end, soft);
i = validate_interval_range (object, &start, &end, soft);
if (!NULL_INTERVAL_P (i))
{
- int s = XINT (start);
- int e = XINT (end);
+ EMACS_INT s = XINT (start);
+ EMACS_INT e = XINT (end);
while (s < e)
{
- int interval_end, len;
+ EMACS_INT interval_end, len;
Lisp_Object plist;
interval_end = i->position + LENGTH (i);
extend_property_ranges (Lisp_Object list, Lisp_Object new_end)
{
Lisp_Object prev = Qnil, head = list;
- int max = XINT (new_end);
+ EMACS_INT max = XINT (new_end);
for (; CONSP (list); prev = list, list = XCDR (list))
{
if (start > end)
{
- int temp = start;
+ EMACS_INT temp = start;
start = end;
end = temp;
}
void
syms_of_textprop (void)
{
- DEFVAR_LISP ("default-text-properties", &Vdefault_text_properties,
+ DEFVAR_LISP ("default-text-properties", Vdefault_text_properties,
doc: /* Property-list used as default values.
The value of a property in this list is seen as the value for every
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,
+ 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
returned. */);
Vchar_property_alias_alist = Qnil;
- DEFVAR_LISP ("inhibit-point-motion-hooks", &Vinhibit_point_motion_hooks,
+ 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. */);
Vinhibit_point_motion_hooks = Qnil;
DEFVAR_LISP ("text-property-default-nonsticky",
- &Vtext_property_default_nonsticky,
+ Vtext_property_default_nonsticky,
doc: /* Alist of properties vs the corresponding non-stickinesses.
Each element has the form (PROPERTY . NONSTICKINESS).
/* defsubr (&Scopy_text_properties); */
}
-/* arch-tag: 454cdde8-5f86-4faa-a078-101e3625d479
- (do not change this comment) */