src/textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
[bpt/emacs.git] / src / textprop.c
index afeaa2b..132c2ff 100644 (file)
@@ -1,6 +1,6 @@
 /* Interface code for dealing with text properties.
    Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003,
-                 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+                 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -874,8 +874,8 @@ In a buffer, it runs to (point-min), and the value cannot be less than that.
 The property values are compared with `eq'.
 If the property is constant all the way to the start of OBJECT, return the
 first valid position in OBJECT.
-If the optional fourth argument LIMIT is non-nil, don't search
-back past position LIMIT; return LIMIT if nothing is found before LIMIT.  */)
+If the optional fourth argument LIMIT is non-nil, don't search back past
+position LIMIT; return LIMIT if nothing is found before reaching LIMIT.  */)
      (position, prop, object, limit)
      Lisp_Object prop, position, object, limit;
 {
@@ -1346,13 +1346,15 @@ the designated part of OBJECT.  */)
 /* Replace properties of text from START to END with new list of
    properties PROPERTIES.  OBJECT is the buffer or string containing
    the text.  OBJECT nil means use the current buffer.
-   SIGNAL_AFTER_CHANGE_P nil means don't signal after changes.  Value
-   is nil if the function _detected_ that it did not replace any
-   properties, non-nil otherwise.  */
+   COHERENT_CHANGE_P nil means this is being called as an internal
+   subroutine, rather than as a change primitive with checking of
+   read-only, invoking change hooks, etc..  Value is nil if the
+   function _detected_ that it did not replace any properties, non-nil
+   otherwise.  */
 
 Lisp_Object
-set_text_properties (start, end, properties, object, signal_after_change_p)
-     Lisp_Object start, end, properties, object, signal_after_change_p;
+set_text_properties (start, end, properties, object, coherent_change_p)
+     Lisp_Object start, end, properties, object, coherent_change_p;
 {
   register INTERVAL i;
   Lisp_Object ostart, oend;
@@ -1397,12 +1399,12 @@ set_text_properties (start, end, properties, object, signal_after_change_p)
        return Qnil;
     }
 
-  if (BUFFERP (object))
+  if (BUFFERP (object) && !NILP (coherent_change_p))
     modify_region (XBUFFER (object), XINT (start), XINT (end), 1);
 
   set_text_properties_1 (start, end, properties, object, i);
 
-  if (BUFFERP (object) && !NILP (signal_after_change_p))
+  if (BUFFERP (object) && !NILP (coherent_change_p))
     signal_after_change (XINT (start), XINT (end) - XINT (start),
                         XINT (end) - XINT (start));
   return Qt;