From 919fa9cbf0b0aabb55af71e54a2050304f4347bf Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 15 Oct 1994 21:29:19 +0000 Subject: [PATCH] (Fset_text_properties): Special case for getting rid of all properties of a string. --- src/textprop.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/textprop.c b/src/textprop.c index 19f469875b8..2e76f0c17ab 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -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. */ -- 2.39.5