Function: put-text-property
put-text-property is a function defined in textprop.c.
Signature
(put-text-property START END PROPERTY VALUE &optional OBJECT)
Documentation
Set one property of the text from START to END.
The third and fourth arguments PROPERTY and VALUE specify the property to add. 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.
Other relevant functions are documented in the text-properties group.
Probably introduced at or before Emacs version 21.1.
Shortdoc
;; text-properties
(let ((s (copy-sequence "abc"))) (put-text-property 0 1 'foo t s) s)
=> #("abc" 0 1 (foo t))
(put-text-property (point) (1+ (point)) 'face 'error)
Source Code
// Defined in /usr/src/emacs/src/textprop.c
{
AUTO_LIST2 (properties, property, value);
Fadd_text_properties (start, end, properties, object);
return Qnil;
}