/* Interface code for dealing with text properties.
- Copyright (C) 1993-1995, 1997, 1999-2014 Free Software Foundation,
+ Copyright (C) 1993-1995, 1997, 1999-2015 Free Software Foundation,
Inc.
This file is part of GNU Emacs.
If the optional fifth argument OBJECT is a buffer (or nil, which means
the current buffer), START and END are buffer positions (integers or
markers). If OBJECT is a string, START and END are 0-based indices into it. */)
- (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object)
+ (Lisp_Object start, Lisp_Object end, Lisp_Object property,
+ Lisp_Object value, Lisp_Object object)
{
- Fadd_text_properties (start, end, list2 (property, value), object);
+ AUTO_LIST2 (properties, property, value);
+ Fadd_text_properties (start, end, properties, object);
return Qnil;
}
(Lisp_Object start, Lisp_Object end, Lisp_Object face,
Lisp_Object append, Lisp_Object object)
{
- add_text_properties_1 (start, end, list2 (Qface, face), object,
+ AUTO_LIST2 (properties, Qface, face);
+ add_text_properties_1 (start, end, properties, object,
(NILP (append)
? TEXT_PROPERTY_PREPEND
: TEXT_PROPERTY_APPEND));
/* Note this can GC when DEST is a buffer. */
Lisp_Object
-copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_Object pos, Lisp_Object dest, Lisp_Object prop)
+copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src,
+ Lisp_Object pos, Lisp_Object dest, Lisp_Object prop)
{
INTERVAL i;
Lisp_Object res;
plist = Fcdr (Fcdr (plist));
}
if (! NILP (plist))
- {
- /* Must defer modifications to the interval tree in case src
- and dest refer to the same string or buffer. */
- stuff = Fcons (list3 (make_number (p), make_number (p + len), plist),
- stuff);
- }
+ /* Must defer modifications to the interval tree in case
+ src and dest refer to the same string or buffer. */
+ stuff = Fcons (list3 (make_number (p), make_number (p + len), plist),
+ stuff);
i = next_interval (i);
if (!i)
}
}
+ if (i->position + LENGTH (i) < end
+ && (!NILP (BVAR (current_buffer, read_only))
+ && NILP (Vinhibit_read_only)))
+ xsignal1 (Qbuffer_read_only, Fcurrent_buffer ());
+
i = next_interval (i);
}
/* Keep going thru the interval containing the char before END. */