]> code.delx.au - gnu-emacs/commitdiff
(Fset_text_properties): Special case for getting
authorRichard M. Stallman <rms@gnu.org>
Sat, 15 Oct 1994 21:29:19 +0000 (21:29 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 15 Oct 1994 21:29:19 +0000 (21:29 +0000)
rid of all properties of a string.

src/textprop.c

index 19f469875b8e642fd2ded6a8ba883b2525dac837..2e76f0c17ab986fe8fec92d15bdd30cbab45c372 100644 (file)
@@ -902,7 +902,18 @@ is the string or buffer containing the text.")
   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.  */