From: Richard M. Stallman Date: Fri, 2 Sep 1994 23:27:04 +0000 (+0000) Subject: (Fset_text_properties): X-Git-Tag: emacs-19.34~7168 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=facc570e2b1f74c98ccd7808cc7601c01bfa9f63;p=emacs.git (Fset_text_properties): Return early if buffer has no intervals and PROPS is nil. --- diff --git a/src/textprop.c b/src/textprop.c index fc09dc41d81..b6e8039adf8 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -887,9 +887,18 @@ is the string or buffer containing the text.") if (NILP (object)) XSET (object, Lisp_Buffer, current_buffer); - i = validate_interval_range (object, &start, &end, hard); + i = validate_interval_range (object, &start, &end, soft); if (NULL_INTERVAL_P (i)) - return Qnil; + { + /* If buffer has no props, and we want none, return now. */ + if (NILP (props)) + return Qnil; + + i = validate_interval_range (object, &start, &end, hard); + /* This can return if start == end. */ + if (NULL_INTERVAL_P (i)) + return Qnil; + } s = XINT (start); len = XINT (end) - s;