changeset 9541:449e024f13be

(Fset_text_properties): Special case for getting rid of all properties of a string.
author Richard M. Stallman <rms@gnu.org>
date Sat, 15 Oct 1994 21:29:19 +0000
parents cde03222210e
children f8b7a65a94bc
files src/textprop.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/textprop.c	Sat Oct 15 10:18:02 1994 +0000
+++ b/src/textprop.c	Sat Oct 15 21:29:19 1994 +0000
@@ -902,7 +902,18 @@
   if (NILP (object))
     XSETBUFFER (object, current_buffer);
 
+  /* If we want no properties for a whole string,
+     get rid of its intervals.  */
+  if (NILP (props) && STRINGP (object)
+      && XFASTINT (start) == 0
+      && XFASTINT (end) == XSTRING (object)->size)
+    {
+      XSTRING (object)->intervals = 0;
+      return Qt;
+    }
+
   i = validate_interval_range (object, &start, &end, soft);
+
   if (NULL_INTERVAL_P (i))
     {
       /* If buffer has no props, and we want none, return now.  */