remove sigio blocking
[bpt/emacs.git] / src / textprop.c
index 5597a78..d7b58c9 100644 (file)
@@ -1,5 +1,5 @@
 /* Interface code for dealing with text properties.
-   Copyright (C) 1993-1995, 1997, 1999-2013 Free Software Foundation,
+   Copyright (C) 1993-1995, 1997, 1999-2014 Free Software Foundation,
    Inc.
 
 This file is part of GNU Emacs.
@@ -812,7 +812,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT.  */)
   else
     {
       Lisp_Object initial_value, value;
-      ptrdiff_t count = SPECPDL_INDEX ();
+      dynwind_begin ();
 
       if (! NILP (object))
        CHECK_BUFFER (object);
@@ -853,7 +853,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT.  */)
              break;
          }
 
-      unbind_to (count, Qnil);
+      dynwind_end ();
     }
 
   return position;
@@ -895,7 +895,7 @@ position LIMIT; return LIMIT if nothing is found before reaching LIMIT.  */)
     }
   else
     {
-      ptrdiff_t count = SPECPDL_INDEX ();
+      dynwind_begin ();
 
       if (! NILP (object))
        CHECK_BUFFER (object);
@@ -946,7 +946,7 @@ position LIMIT; return LIMIT if nothing is found before reaching LIMIT.  */)
            }
        }
 
-      unbind_to (count, Qnil);
+      dynwind_end ();
     }
 
   return position;
@@ -1202,7 +1202,7 @@ add_text_properties_1 (Lisp_Object start, Lisp_Object end,
       do
        {
          if (got >= len)
-           RETURN_UNGCPRO (Qnil);
+           return Qnil;
          len -= got;
          i = next_interval (i);
          got = LENGTH (i);
@@ -1338,20 +1338,27 @@ the designated part of OBJECT.  */)
 DEFUN ("add-face-text-property", Fadd_face_text_property,
        Sadd_face_text_property, 3, 5, 0,
        doc: /* Add the face property to the text from START to END.
-The third argument FACE specifies the face to add.
-If any text in the region already has any face properties, this new
-face property will be added to the front of the face property list.
-If the optional fourth argument APPENDP is non-nil, append to the end
-of the face property list instead.
-If the optional fifth argument OBJECT is a buffer (or nil, which means
-the current buffer), START and END are buffer positions (integers or
+FACE specifies the face to add.  It should be a valid value of the
+`face' property (typically a face name or a plist of face attributes
+and values).
+
+If any text in the region already has a non-nil `face' property, those
+face(s) are retained.  This is done by setting the `face' property to
+a list of faces, with FACE as the first element (by default) and the
+pre-existing faces as the remaining elements.
+
+If optional fourth argument APPEND is non-nil, append FACE to the end
+of the face list instead.
+
+If optional fifth argument OBJECT is a buffer (or nil, which means the
+current buffer), START and END are buffer positions (integers or
 markers).  If OBJECT is a string, START and END are 0-based indices
 into it.  */)
   (Lisp_Object start, Lisp_Object end, Lisp_Object face,
-   Lisp_Object appendp, Lisp_Object object)
+   Lisp_Object append, Lisp_Object object)
 {
   add_text_properties_1 (start, end, list2 (Qface, face), object,
-                        (NILP (appendp)
+                        (NILP (append)
                          ? TEXT_PROPERTY_PREPEND
                          : TEXT_PROPERTY_APPEND));
   return Qnil;
@@ -1734,6 +1741,19 @@ Return t if any property was actually removed, nil otherwise.  */)
        }
       len -= LENGTH (i);
       i = next_interval (i);
+      if (!i)
+        {
+          if (modified)
+            {
+              if (BUFFERP (object))
+                signal_after_change (XINT (start),
+                                     XINT (end) - XINT (start),
+                                     XINT (end) - XINT (start));
+              return Qt;
+            }
+          else
+            return Qnil;
+        }
     }
 }
 \f
@@ -2312,6 +2332,8 @@ report_interval_modification (Lisp_Object start, Lisp_Object end)
 void
 syms_of_textprop (void)
 {
+#include "textprop.x"
+
   DEFVAR_LISP ("default-text-properties", Vdefault_text_properties,
               doc: /* Property-list used as default values.
 The value of a property in this list is seen as the value for every
@@ -2377,25 +2399,4 @@ inherits it if NONSTICKINESS is nil.  The `front-sticky' and
   DEFSYM (Qmouse_entered, "mouse-entered");
   DEFSYM (Qpoint_left, "point-left");
   DEFSYM (Qpoint_entered, "point-entered");
-
-  defsubr (&Stext_properties_at);
-  defsubr (&Sget_text_property);
-  defsubr (&Sget_char_property);
-  defsubr (&Sget_char_property_and_overlay);
-  defsubr (&Snext_char_property_change);
-  defsubr (&Sprevious_char_property_change);
-  defsubr (&Snext_single_char_property_change);
-  defsubr (&Sprevious_single_char_property_change);
-  defsubr (&Snext_property_change);
-  defsubr (&Snext_single_property_change);
-  defsubr (&Sprevious_property_change);
-  defsubr (&Sprevious_single_property_change);
-  defsubr (&Sadd_text_properties);
-  defsubr (&Sput_text_property);
-  defsubr (&Sset_text_properties);
-  defsubr (&Sadd_face_text_property);
-  defsubr (&Sremove_text_properties);
-  defsubr (&Sremove_list_of_text_properties);
-  defsubr (&Stext_property_any);
-  defsubr (&Stext_property_not_all);
 }