-#if 0 /* You can use set-text-properties for this. */
-
-DEFUN ("erase-text-properties", Ferase_text_properties,
- Serase_text_properties, 2, 3, 0,
- "Remove all properties from the text from START to END.\n\
-The optional third argument, OBJECT,\n\
-is the string or buffer containing the text.")
- (start, end, object)
- Lisp_Object start, end, object;
-{
- register INTERVAL i;
- register INTERVAL prev_changed = NULL_INTERVAL;
- register int s, len, modified;
-
- if (NILP (object))
- XSETBUFFER (object, current_buffer);
-
- i = validate_interval_range (object, &start, &end, soft);
- if (NULL_INTERVAL_P (i))
- return Qnil;
-
- s = XINT (start);
- len = XINT (end) - s;
-
- if (i->position != s)
- {
- register int got;
- register INTERVAL unchanged = i;
-
- /* If there are properties here, then this text will be modified. */
- if (! NILP (i->plist))
- {
- i = split_interval_right (unchanged, s - unchanged->position);
- i->plist = Qnil;
- modified++;
-
- if (LENGTH (i) > len)
- {
- i = split_interval_right (i, len);
- copy_properties (unchanged, i);
- return Qt;
- }
-
- if (LENGTH (i) == len)
- return Qt;
-
- got = LENGTH (i);
- }
- /* If the text of I is without any properties, and contains
- LEN or more characters, then we may return without changing
- anything.*/
- else if (LENGTH (i) - (s - i->position) <= len)
- return Qnil;
- /* The amount of text to change extends past I, so just note
- how much we've gotten. */
- else
- got = LENGTH (i) - (s - i->position);
-
- len -= got;
- prev_changed = i;
- i = next_interval (i);
- }
-
- /* We are starting at the beginning of an interval, I. */
- while (len > 0)
- {
- if (LENGTH (i) >= len)
- {
- /* If I has no properties, simply merge it if possible. */
- if (NILP (i->plist))
- {
- if (! NULL_INTERVAL_P (prev_changed))
- merge_interval_left (i);
-
- return modified ? Qt : Qnil;
- }
-
- if (LENGTH (i) > len)
- i = split_interval_left (i, len);
- if (! NULL_INTERVAL_P (prev_changed))
- merge_interval_left (i);
- else
- i->plist = Qnil;
-
- return Qt;
- }
-
- /* Here if we still need to erase past the end of I */
- len -= LENGTH (i);
- if (NULL_INTERVAL_P (prev_changed))
- {
- modified += erase_properties (i);
- prev_changed = i;
- }
- else
- {
- modified += ! NILP (i->plist);
- /* Merging I will give it the properties of PREV_CHANGED. */
- prev_changed = i = merge_interval_left (i);
- }
-
- i = next_interval (i);
- }
-
- return modified ? Qt : Qnil;
-}
-#endif /* 0 */
-