Merge from trunk.
[bpt/emacs.git] / src / textprop.c
index e85b041..f9339c6 100644 (file)
@@ -1,5 +1,5 @@
 /* Interface code for dealing with text properties.
-   Copyright (C) 1993-1995, 1997, 1999-2011 Free Software Foundation, Inc.
+   Copyright (C) 1993-1995, 1997, 1999-2012 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -76,7 +76,8 @@ static Lisp_Object interval_insert_behind_hooks;
 static Lisp_Object interval_insert_in_front_hooks;
 
 static void text_read_only (Lisp_Object) NO_RETURN;
-INFUN (Fprevious_property_change, 3);
+static Lisp_Object Fprevious_property_change (Lisp_Object, Lisp_Object,
+                                             Lisp_Object);
 
 
 /* Signal a `text-read-only' error.  This function makes it easier
@@ -123,7 +124,7 @@ INTERVAL
 validate_interval_range (Lisp_Object object, Lisp_Object *begin, Lisp_Object *end, int force)
 {
   register INTERVAL i;
-  EMACS_INT searchpos;
+  ptrdiff_t searchpos;
 
   CHECK_STRING_OR_BUFFER (object);
   CHECK_NUMBER_COERCE_MARKER (*begin);
@@ -159,7 +160,7 @@ validate_interval_range (Lisp_Object object, Lisp_Object *begin, Lisp_Object *en
     }
   else
     {
-      EMACS_INT len = SCHARS (object);
+      ptrdiff_t len = SCHARS (object);
 
       if (! (0 <= XINT (*begin) && XINT (*begin) <= XINT (*end)
             && XINT (*end) <= len))
@@ -232,7 +233,7 @@ interval_has_all_properties (Lisp_Object plist, INTERVAL i)
            if (! EQ (Fcar (XCDR (tail1)), Fcar (XCDR (tail2))))
              return 0;
 
-           /* Property has same value on both lists;  go to next one.  */
+           /* Property has same value on both lists; go to next one.  */
            found = 1;
            break;
          }
@@ -247,7 +248,7 @@ interval_has_all_properties (Lisp_Object plist, INTERVAL i)
 /* Return nonzero if the plist of interval I has any of the
    properties of PLIST, regardless of their values.  */
 
-static INLINE int
+static inline int
 interval_has_some_properties (Lisp_Object plist, INTERVAL i)
 {
   register Lisp_Object tail1, tail2, sym;
@@ -269,7 +270,7 @@ interval_has_some_properties (Lisp_Object plist, INTERVAL i)
 /* Return nonzero if the plist of interval I has any of the
    property names in LIST, regardless of their values.  */
 
-static INLINE int
+static inline int
 interval_has_some_properties_list (Lisp_Object list, INTERVAL i)
 {
   register Lisp_Object tail1, tail2, sym;
@@ -498,7 +499,7 @@ remove_properties (Lisp_Object plist, Lisp_Object list, INTERVAL i, Lisp_Object
 /* Remove all properties from interval I.  Return non-zero
    if this changes the interval.  */
 
-static INLINE int
+static inline int
 erase_properties (INTERVAL i)
 {
   if (NILP (i->plist))
@@ -513,10 +514,10 @@ erase_properties (INTERVAL i)
    POSITION is BEG-based.  */
 
 INTERVAL
-interval_of (int position, Lisp_Object object)
+interval_of (ptrdiff_t position, Lisp_Object object)
 {
   register INTERVAL i;
-  EMACS_INT beg, end;
+  ptrdiff_t beg, end;
 
   if (NILP (object))
     XSETBUFFER (object, current_buffer);
@@ -548,7 +549,7 @@ interval_of (int position, Lisp_Object object)
   return find_interval (i, position);
 }
 \f
-DEFUE ("text-properties-at", Ftext_properties_at,
+DEFUN ("text-properties-at", Ftext_properties_at,
        Stext_properties_at, 1, 2, 0,
        doc: /* Return the list of properties of the character at POSITION in OBJECT.
 If the optional second argument OBJECT is a buffer (or nil, which means
@@ -575,7 +576,7 @@ If POSITION is at the end of OBJECT, the value is nil.  */)
   return i->plist;
 }
 
-DEFUE ("get-text-property", Fget_text_property, Sget_text_property, 2, 3, 0,
+DEFUN ("get-text-property", Fget_text_property, Sget_text_property, 2, 3, 0,
        doc: /* Return the value of POSITION's property PROP, in OBJECT.
 OBJECT is optional and defaults to the current buffer.
 If POSITION is at the end of OBJECT, the value is nil.  */)
@@ -612,7 +613,7 @@ get_char_property_and_overlay (Lisp_Object position, register Lisp_Object prop,
     }
   if (BUFFERP (object))
     {
-      int noverlays;
+      ptrdiff_t noverlays;
       Lisp_Object *overlay_vec;
       struct buffer *obuf = current_buffer;
 
@@ -650,7 +651,7 @@ get_char_property_and_overlay (Lisp_Object position, register Lisp_Object prop,
   return Fget_text_property (position, prop, object);
 }
 
-DEFUE ("get-char-property", Fget_char_property, Sget_char_property, 2, 3, 0,
+DEFUN ("get-char-property", Fget_char_property, Sget_char_property, 2, 3, 0,
        doc: /* Return the value of POSITION's property PROP, in OBJECT.
 Both overlay properties and text properties are checked.
 OBJECT is optional and defaults to the current buffer.
@@ -687,7 +688,7 @@ POSITION is at the end of OBJECT, both car and cdr are nil.  */)
 }
 
 \f
-DEFUE ("next-char-property-change", Fnext_char_property_change,
+DEFUN ("next-char-property-change", Fnext_char_property_change,
        Snext_char_property_change, 1, 2, 0,
        doc: /* Return the position of next text property or overlay change.
 This scans characters forward in the current buffer from POSITION till
@@ -712,7 +713,7 @@ LIMIT is a no-op if it is greater than (point-max).  */)
   return Fnext_property_change (position, Qnil, temp);
 }
 
-DEFUE ("previous-char-property-change", Fprevious_char_property_change,
+DEFUN ("previous-char-property-change", Fprevious_char_property_change,
        Sprevious_char_property_change, 1, 2, 0,
        doc: /* Return the position of previous text property or overlay change.
 Scans characters backward in the current buffer from POSITION till it
@@ -738,7 +739,7 @@ LIMIT is a no-op if it is less than (point-min).  */)
 }
 
 
-DEFUE ("next-single-char-property-change", Fnext_single_char_property_change,
+DEFUN ("next-single-char-property-change", Fnext_single_char_property_change,
        Snext_single_char_property_change, 2, 4, 0,
        doc: /* Return the position of next text property or overlay change for a specific property.
 Scans characters forward from POSITION till it finds
@@ -774,7 +775,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT.  */)
   else
     {
       Lisp_Object initial_value, value;
-      int count = SPECPDL_INDEX ();
+      ptrdiff_t count = SPECPDL_INDEX ();
 
       if (! NILP (object))
        CHECK_BUFFER (object);
@@ -821,7 +822,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT.  */)
   return position;
 }
 
-DEFUE ("previous-single-char-property-change",
+DEFUN ("previous-single-char-property-change",
        Fprevious_single_char_property_change,
        Sprevious_single_char_property_change, 2, 4, 0,
        doc: /* Return the position of previous text property or overlay change for a specific property.
@@ -837,8 +838,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.  */)
   (Lisp_Object position, Lisp_Object prop, Lisp_Object object, Lisp_Object limit)
 {
   if (STRINGP (object))
@@ -857,7 +858,7 @@ back past position LIMIT; return LIMIT if nothing is found before LIMIT.  */)
     }
   else
     {
-      int count = SPECPDL_INDEX ();
+      ptrdiff_t count = SPECPDL_INDEX ();
 
       if (! NILP (object))
        CHECK_BUFFER (object);
@@ -914,7 +915,7 @@ back past position LIMIT; return LIMIT if nothing is found before LIMIT.  */)
   return position;
 }
 \f
-DEFUE ("next-property-change", Fnext_property_change,
+DEFUN ("next-property-change", Fnext_property_change,
        Snext_property_change, 1, 3, 0,
        doc: /* Return the position of next property change.
 Scans characters forward from POSITION in OBJECT till it finds
@@ -978,7 +979,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT.  */)
     return make_number (next->position);
 }
 
-DEFUE ("next-single-property-change", Fnext_single_property_change,
+DEFUN ("next-single-property-change", Fnext_single_property_change,
        Snext_single_property_change, 2, 4, 0,
        doc: /* Return the position of next property change for a specific property.
 Scans characters forward from POSITION till it finds
@@ -1026,7 +1027,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT.  */)
     return make_number (next->position);
 }
 
-DEFUE ("previous-property-change", Fprevious_property_change,
+DEFUN ("previous-property-change", Fprevious_property_change,
        Sprevious_property_change, 1, 3, 0,
        doc: /* Return the position of previous property change.
 Scans characters backwards from POSITION in OBJECT till it finds
@@ -1073,7 +1074,7 @@ back past position LIMIT; return LIMIT if nothing is found until LIMIT.  */)
     return make_number (previous->position + LENGTH (previous));
 }
 
-DEFUE ("previous-single-property-change", Fprevious_single_property_change,
+DEFUN ("previous-single-property-change", Fprevious_single_property_change,
        Sprevious_single_property_change, 2, 4, 0,
        doc: /* Return the position of previous property change for a specific property.
 Scans characters backward from POSITION till it finds
@@ -1127,7 +1128,7 @@ back past position LIMIT; return LIMIT if nothing is found until LIMIT.  */)
 \f
 /* Callers note, this can GC when OBJECT is a buffer (or nil).  */
 
-DEFUE ("add-text-properties", Fadd_text_properties,
+DEFUN ("add-text-properties", Fadd_text_properties,
        Sadd_text_properties, 3, 4, 0,
        doc: /* Add properties to the text from START to END.
 The third argument PROPERTIES is a property list
@@ -1139,7 +1140,7 @@ Return t if any property value actually changed, nil otherwise.  */)
   (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object)
 {
   register INTERVAL i, unchanged;
-  register EMACS_INT s, len;
+  register ptrdiff_t s, len;
   register int modified = 0;
   struct gcpro gcpro1;
 
@@ -1169,7 +1170,7 @@ Return t if any property value actually changed, nil otherwise.  */)
          skip it.  */
       if (interval_has_all_properties (properties, i))
        {
-         EMACS_INT got = (LENGTH (i) - (s - i->position));
+         ptrdiff_t got = (LENGTH (i) - (s - i->position));
          if (got >= len)
            RETURN_UNGCPRO (Qnil);
          len -= got;
@@ -1236,7 +1237,7 @@ Return t if any property value actually changed, nil otherwise.  */)
 
 /* Callers note, this can GC when OBJECT is a buffer (or nil).  */
 
-DEFUE ("put-text-property", Fput_text_property,
+DEFUN ("put-text-property", Fput_text_property,
        Sput_text_property, 4, 5, 0,
        doc: /* Set one property of the text from START to END.
 The third and fourth arguments PROPERTY and VALUE
@@ -1252,7 +1253,7 @@ markers).  If OBJECT is a string, START and END are 0-based indices into it.  */
   return Qnil;
 }
 
-DEFUE ("set-text-properties", Fset_text_properties,
+DEFUN ("set-text-properties", Fset_text_properties,
        Sset_text_properties, 3, 4, 0,
        doc: /* Completely replace properties of text from START to END.
 The third argument PROPERTIES is the new property list.
@@ -1344,18 +1345,21 @@ void
 set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object buffer, INTERVAL i)
 {
   register INTERVAL prev_changed = NULL_INTERVAL;
-  register EMACS_INT s, len;
+  register ptrdiff_t s, len;
   INTERVAL unchanged;
 
-  s = XINT (start);
-  len = XINT (end) - s;
-  if (len == 0)
-    return;
-  if (len < 0)
+  if (XINT (start) < XINT (end))
+    {
+      s = XINT (start);
+      len = XINT (end) - s;
+    }
+  else if (XINT (end) < XINT (start))
     {
-      s = s + len;
-      len = - len;
+      s = XINT (end);
+      len = XINT (start) - s;
     }
+  else
+    return;
 
   if (i == 0)
     i = find_interval (BUF_INTERVALS (XBUFFER (buffer)), s);
@@ -1419,7 +1423,7 @@ set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object propertie
   while (len > 0);
 }
 
-DEFUE ("remove-text-properties", Fremove_text_properties,
+DEFUN ("remove-text-properties", Fremove_text_properties,
        Sremove_text_properties, 3, 4, 0,
        doc: /* Remove some properties from text from START to END.
 The third argument PROPERTIES is a property list
@@ -1434,7 +1438,7 @@ Use `set-text-properties' if you want to remove all text properties.  */)
   (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object)
 {
   register INTERVAL i, unchanged;
-  register EMACS_INT s, len;
+  register ptrdiff_t s, len;
   register int modified = 0;
 
   if (NILP (object))
@@ -1453,7 +1457,7 @@ Use `set-text-properties' if you want to remove all text properties.  */)
          it covers the entire region.  */
       if (! interval_has_some_properties (properties, i))
        {
-         EMACS_INT got = (LENGTH (i) - (s - i->position));
+         ptrdiff_t got = (LENGTH (i) - (s - i->position));
          if (got >= len)
            return Qnil;
          len -= got;
@@ -1509,7 +1513,7 @@ Use `set-text-properties' if you want to remove all text properties.  */)
     }
 }
 
-DEFUE ("remove-list-of-text-properties", Fremove_list_of_text_properties,
+DEFUN ("remove-list-of-text-properties", Fremove_list_of_text_properties,
        Sremove_list_of_text_properties, 3, 4, 0,
        doc: /* Remove some properties from text from START to END.
 The third argument LIST-OF-PROPERTIES is a list of property names to remove.
@@ -1520,7 +1524,7 @@ Return t if any property was actually removed, nil otherwise.  */)
   (Lisp_Object start, Lisp_Object end, Lisp_Object list_of_properties, Lisp_Object object)
 {
   register INTERVAL i, unchanged;
-  register EMACS_INT s, len;
+  register ptrdiff_t s, len;
   register int modified = 0;
   Lisp_Object properties;
   properties = list_of_properties;
@@ -1541,7 +1545,7 @@ Return t if any property was actually removed, nil otherwise.  */)
          it covers the entire region.  */
       if (! interval_has_some_properties_list (properties, i))
        {
-         EMACS_INT got = (LENGTH (i) - (s - i->position));
+         ptrdiff_t got = (LENGTH (i) - (s - i->position));
          if (got >= len)
            return Qnil;
          len -= got;
@@ -1619,9 +1623,9 @@ Return t if any property was actually removed, nil otherwise.  */)
     }
 }
 \f
-DEFUE ("text-property-any", Ftext_property_any,
+DEFUN ("text-property-any", Ftext_property_any,
        Stext_property_any, 4, 5, 0,
-       doc: /* Check text from START to END for property PROPERTY equalling VALUE.
+       doc: /* Check text from START to END for property PROPERTY equaling VALUE.
 If so, return the position of the first character whose property PROPERTY
 is `eq' to VALUE.  Otherwise return nil.
 If the optional fifth argument OBJECT is a buffer (or nil, which means
@@ -1630,7 +1634,7 @@ markers).  If OBJECT is a string, START and END are 0-based indices into it.  */
   (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object)
 {
   register INTERVAL i;
-  register EMACS_INT e, pos;
+  register ptrdiff_t e, pos;
 
   if (NILP (object))
     XSETBUFFER (object, current_buffer);
@@ -1657,7 +1661,7 @@ markers).  If OBJECT is a string, START and END are 0-based indices into it.  */
 
 DEFUN ("text-property-not-all", Ftext_property_not_all,
        Stext_property_not_all, 4, 5, 0,
-       doc: /* Check text from START to END for property PROPERTY not equalling VALUE.
+       doc: /* Check text from START to END for property PROPERTY not equaling VALUE.
 If so, return the position of the first character whose property PROPERTY
 is not `eq' to VALUE.  Otherwise, return nil.
 If the optional fifth argument OBJECT is a buffer (or nil, which means
@@ -1666,7 +1670,7 @@ markers).  If OBJECT is a string, START and END are 0-based indices into it.  */
   (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object)
 {
   register INTERVAL i;
-  register EMACS_INT s, e;
+  register ptrdiff_t s, e;
 
   if (NILP (object))
     XSETBUFFER (object, current_buffer);
@@ -1703,10 +1707,14 @@ text_property_stickiness (Lisp_Object prop, Lisp_Object pos, Lisp_Object buffer)
 {
   Lisp_Object prev_pos, front_sticky;
   int is_rear_sticky = 1, is_front_sticky = 0; /* defaults */
+  Lisp_Object defalt = Fassq (prop, Vtext_property_default_nonsticky);
 
   if (NILP (buffer))
     XSETBUFFER (buffer, current_buffer);
 
+  if (CONSP (defalt) && !NILP (XCDR (defalt)))
+    is_rear_sticky = 0;
+
   if (XINT (pos) > BUF_BEGV (XBUFFER (buffer)))
     /* Consider previous character.  */
     {
@@ -1755,15 +1763,9 @@ text_property_stickiness (Lisp_Object prop, Lisp_Object pos, Lisp_Object buffer)
 }
 
 \f
-/* I don't think this is the right interface to export; how often do you
-   want to do something like this, other than when you're copying objects
-   around?
-
-   I think it would be better to have a pair of functions, one which
-   returns the text properties of a region as a list of ranges and
-   plists, and another which applies such a list to another object.  */
+/* Copying properties between objects. */
 
-/* Add properties from SRC to SRC of SRC, starting at POS in DEST.
+/* Add properties from START to END of SRC, starting at POS in DEST.
    SRC and DEST may each refer to strings or buffers.
    Optional sixth argument PROP causes only that property to be copied.
    Properties are copied to DEST as if by `add-text-properties'.
@@ -1778,7 +1780,7 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_
   Lisp_Object res;
   Lisp_Object stuff;
   Lisp_Object plist;
-  EMACS_INT s, e, e2, p, len;
+  ptrdiff_t s, e, e2, p, len;
   int modified = 0;
   struct gcpro gcpro1, gcpro2;
 
@@ -1790,8 +1792,11 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_
   {
     Lisp_Object dest_start, dest_end;
 
+    e = XINT (pos) + (XINT (end) - XINT (start));
+    if (MOST_POSITIVE_FIXNUM < e)
+      args_out_of_range (pos, end);
     dest_start = pos;
-    XSETFASTINT (dest_end, XINT (dest_start) + (XINT (end) - XINT (start)));
+    XSETFASTINT (dest_end, e);
     /* Apply this to a copy of pos; it will try to increment its arguments,
        which we don't want.  */
     validate_interval_range (dest, &dest_start, &dest_end, soft);
@@ -1875,12 +1880,12 @@ text_property_list (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp
   i = validate_interval_range (object, &start, &end, soft);
   if (!NULL_INTERVAL_P (i))
     {
-      EMACS_INT s = XINT (start);
-      EMACS_INT e = XINT (end);
+      ptrdiff_t s = XINT (start);
+      ptrdiff_t e = XINT (end);
 
       while (s < e)
        {
-         EMACS_INT interval_end, len;
+         ptrdiff_t interval_end, len;
          Lisp_Object plist;
 
          interval_end = i->position + LENGTH (i);
@@ -1958,7 +1963,7 @@ Lisp_Object
 extend_property_ranges (Lisp_Object list, Lisp_Object new_end)
 {
   Lisp_Object prev = Qnil, head = list;
-  EMACS_INT max = XINT (new_end);
+  ptrdiff_t max = XINT (new_end);
 
   for (; CONSP (list); prev = list, list = XCDR (list))
     {
@@ -2011,7 +2016,8 @@ call_mod_hooks (Lisp_Object list, Lisp_Object start, Lisp_Object end)
    those hooks in order, with START and END - 1 as arguments.  */
 
 void
-verify_interval_modification (struct buffer *buf, int start, int end)
+verify_interval_modification (struct buffer *buf,
+                             ptrdiff_t start, ptrdiff_t end)
 {
   register INTERVAL intervals = BUF_INTERVALS (buf);
   register INTERVAL i;
@@ -2032,7 +2038,7 @@ verify_interval_modification (struct buffer *buf, int start, int end)
 
   if (start > end)
     {
-      EMACS_INT temp = start;
+      ptrdiff_t temp = start;
       start = end;
       end = temp;
     }
@@ -2224,16 +2230,18 @@ This also inhibits the use of the `intangible' text property.  */);
 
   DEFVAR_LISP ("text-property-default-nonsticky",
               Vtext_property_default_nonsticky,
-              doc: /* Alist of properties vs the corresponding non-stickinesses.
+              doc: /* Alist of properties vs the corresponding non-stickiness.
 Each element has the form (PROPERTY . NONSTICKINESS).
 
 If a character in a buffer has PROPERTY, new text inserted adjacent to
 the character doesn't inherit PROPERTY if NONSTICKINESS is non-nil,
 inherits it if NONSTICKINESS is nil.  The `front-sticky' and
 `rear-nonsticky' properties of the character override NONSTICKINESS.  */);
-  /* Text property `syntax-table' should be nonsticky by default.  */
+  /* Text properties `syntax-table'and `display' should be nonsticky
+     by default.  */
   Vtext_property_default_nonsticky
-    = Fcons (Fcons (intern_c_string ("syntax-table"), Qt), Qnil);
+    = Fcons (Fcons (intern_c_string ("syntax-table"), Qt),
+            Fcons (Fcons (intern_c_string ("display"), Qt), Qnil));
 
   staticpro (&interval_insert_behind_hooks);
   staticpro (&interval_insert_in_front_hooks);
@@ -2243,45 +2251,27 @@ inherits it if NONSTICKINESS is nil.  The `front-sticky' and
 
   /* Common attributes one might give text */
 
-  staticpro (&Qforeground);
-  Qforeground = intern_c_string ("foreground");
-  staticpro (&Qbackground);
-  Qbackground = intern_c_string ("background");
-  staticpro (&Qfont);
-  Qfont = intern_c_string ("font");
-  staticpro (&Qstipple);
-  Qstipple = intern_c_string ("stipple");
-  staticpro (&Qunderline);
-  Qunderline = intern_c_string ("underline");
-  staticpro (&Qread_only);
-  Qread_only = intern_c_string ("read-only");
-  staticpro (&Qinvisible);
-  Qinvisible = intern_c_string ("invisible");
-  staticpro (&Qintangible);
-  Qintangible = intern_c_string ("intangible");
-  staticpro (&Qcategory);
-  Qcategory = intern_c_string ("category");
-  staticpro (&Qlocal_map);
-  Qlocal_map = intern_c_string ("local-map");
-  staticpro (&Qfront_sticky);
-  Qfront_sticky = intern_c_string ("front-sticky");
-  staticpro (&Qrear_nonsticky);
-  Qrear_nonsticky = intern_c_string ("rear-nonsticky");
-  staticpro (&Qmouse_face);
-  Qmouse_face = intern_c_string ("mouse-face");
-  staticpro (&Qminibuffer_prompt);
-  Qminibuffer_prompt = intern_c_string ("minibuffer-prompt");
+  DEFSYM (Qforeground, "foreground");
+  DEFSYM (Qbackground, "background");
+  DEFSYM (Qfont, "font");
+  DEFSYM (Qstipple, "stipple");
+  DEFSYM (Qunderline, "underline");
+  DEFSYM (Qread_only, "read-only");
+  DEFSYM (Qinvisible, "invisible");
+  DEFSYM (Qintangible, "intangible");
+  DEFSYM (Qcategory, "category");
+  DEFSYM (Qlocal_map, "local-map");
+  DEFSYM (Qfront_sticky, "front-sticky");
+  DEFSYM (Qrear_nonsticky, "rear-nonsticky");
+  DEFSYM (Qmouse_face, "mouse-face");
+  DEFSYM (Qminibuffer_prompt, "minibuffer-prompt");
 
   /* Properties that text might use to specify certain actions */
 
-  staticpro (&Qmouse_left);
-  Qmouse_left = intern_c_string ("mouse-left");
-  staticpro (&Qmouse_entered);
-  Qmouse_entered = intern_c_string ("mouse-entered");
-  staticpro (&Qpoint_left);
-  Qpoint_left = intern_c_string ("point-left");
-  staticpro (&Qpoint_entered);
-  Qpoint_entered = intern_c_string ("point-entered");
+  DEFSYM (Qmouse_left, "mouse-left");
+  DEFSYM (Qmouse_entered, "mouse-entered");
+  DEFSYM (Qpoint_left, "point-left");
+  DEFSYM (Qpoint_entered, "point-entered");
 
   defsubr (&Stext_properties_at);
   defsubr (&Sget_text_property);
@@ -2302,6 +2292,4 @@ inherits it if NONSTICKINESS is nil.  The `front-sticky' and
   defsubr (&Sremove_list_of_text_properties);
   defsubr (&Stext_property_any);
   defsubr (&Stext_property_not_all);
-/*  defsubr (&Serase_text_properties); */
-/*  defsubr (&Scopy_text_properties); */
 }