XEmacs 21.4.17 "Jumbo Shrimp".
[chise/xemacs-chise.git.1] / src / objects.c
index e980944..c57270f 100644 (file)
@@ -43,7 +43,7 @@ void
 finalose (void *ptr)
 {
   Lisp_Object obj;
-  XSETOBJ (obj, Lisp_Type_Record, ptr);
+  XSETOBJ (obj, ptr);
 
   signal_simple_error
     ("Can't dump an emacs containing window system objects", obj);
@@ -137,8 +137,8 @@ Optional argument DEVICE specifies the device this object applies to
 and defaults to the selected device.
 
 An error is signaled if the color is unknown or cannot be allocated;
-however, if optional argument NO-ERROR is non-nil, nil is simply
-returned in this case. (And if NO-ERROR is other than t, a warning may
+however, if optional argument NOERROR is non-nil, nil is simply
+returned in this case. (And if NOERROR is other than t, a warning may
 be issued.)
 
 The returned object is a normal, first-class lisp object.  The way you
@@ -147,7 +147,7 @@ you drop all pointers to it and allow it to be garbage collected.  When
 these objects are GCed, the underlying window-system data (e.g. X object)
 is deallocated as well.
 */
-       (name, device, no_error))
+       (name, device, noerror))
 {
   Lisp_Color_Instance *c;
   Lisp_Object val;
@@ -163,7 +163,7 @@ is deallocated as well.
 
   retval = MAYBE_INT_DEVMETH (XDEVICE (device), initialize_color_instance,
                              (c, name, device,
-                              decode_error_behavior_flag (no_error)));
+                              decode_error_behavior_flag (noerror)));
   if (!retval)
     return Qnil;
 
@@ -315,12 +315,12 @@ The returned object is a normal, first-class lisp object.  The way you
 you drop all pointers to it and allow it to be garbage collected.  When
 these objects are GCed, the underlying X data is deallocated as well.
 */
-       (name, device, no_error))
+       (name, device, noerror))
 {
   Lisp_Font_Instance *f;
   Lisp_Object val;
   int retval = 0;
-  Error_behavior errb = decode_error_behavior_flag (no_error);
+  Error_behavior errb = decode_error_behavior_flag (noerror);
 
   if (ERRB_EQ (errb, ERROR_ME))
     CHECK_STRING (name);
@@ -507,7 +507,7 @@ color_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
 {
   /* When called, we're inside of call_with_suspended_errors(),
      so we can freely error. */
-  Lisp_Object device = DFW_DEVICE (domain);
+  Lisp_Object device = DOMAIN_DEVICE (domain);
   struct device *d = XDEVICE (device);
 
   if (COLOR_INSTANCEP (instantiator))
@@ -563,7 +563,7 @@ color_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
                   XVECTOR_DATA (instantiator)[1], domain, ERROR_ME, 0, depth));
 
        default:
-         abort ();
+         ABORT ();
        }
     }
   else if (NILP (instantiator))
@@ -575,7 +575,7 @@ color_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
                             device);
     }
   else
-    abort ();  /* The spec validation routines are screwed up. */
+    ABORT ();  /* The spec validation routines are screwed up. */
 
   return Qunbound;
 }
@@ -616,7 +616,11 @@ color_after_change (Lisp_Object specifier, Lisp_Object locale)
   Lisp_Object property =
     COLOR_SPECIFIER_FACE_PROPERTY (XCOLOR_SPECIFIER (specifier));
   if (!NILP (face))
-    face_property_was_changed (face, property, locale);
+    {
+      face_property_was_changed (face, property, locale);
+      if (BUFFERP (locale))
+       XBUFFER (locale)->buffer_local_face_property = 1;
+    }
 }
 
 void
@@ -631,19 +635,7 @@ set_color_attached_to (Lisp_Object obj, Lisp_Object face, Lisp_Object property)
 DEFUN ("color-specifier-p", Fcolor_specifier_p, 1, 1, 0, /*
 Return t if OBJECT is a color specifier.
 
-Valid instantiators for color specifiers are:
-
--- a string naming a color (e.g. under X this might be "lightseagreen2"
-   or "#F534B2")
--- a color instance (use that instance directly if the device matches,
-   or use the string that generated it)
--- a vector of no elements (only on TTY's; this means to set no color
-   at all, thus using the "natural" color of the terminal's text)
--- a vector of one or two elements: a face to inherit from, and
-   optionally a symbol naming which property of that face to inherit,
-   either `foreground' or `background' (if omitted, defaults to the same
-   property that this color specifier is used for; if this specifier is
-   not part of a face, the instantiator would not be valid)
+See `make-color-specifier' for a description of possible color instantiators.
 */
        (object))
 {
@@ -682,7 +674,7 @@ font_mark (Lisp_Object obj)
 
 int
 font_spec_matches_charset (struct device *d, Lisp_Object charset,
-                          CONST Bufbyte *nonreloc, Lisp_Object reloc,
+                          const Bufbyte *nonreloc, Lisp_Object reloc,
                           Bytecount offset, Bytecount length)
 {
   return DEVMETH_OR_GIVEN (d, font_spec_matches_charset,
@@ -706,7 +698,7 @@ font_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
 {
   /* When called, we're inside of call_with_suspended_errors(),
      so we can freely error. */
-  Lisp_Object device = DFW_DEVICE (domain);
+  Lisp_Object device = DOMAIN_DEVICE (domain);
   struct device *d = XDEVICE (device);
   Lisp_Object instance;
 
@@ -795,7 +787,7 @@ font_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
   else if (NILP (instantiator))
     return Qunbound;
   else
-    abort ();  /* Eh? */
+    ABORT ();  /* Eh? */
 
   return Qunbound;
 }
@@ -826,7 +818,11 @@ font_after_change (Lisp_Object specifier, Lisp_Object locale)
   Lisp_Object property =
     FONT_SPECIFIER_FACE_PROPERTY (XFONT_SPECIFIER (specifier));
   if (!NILP (face))
-    face_property_was_changed (face, property, locale);
+    {
+      face_property_was_changed (face, property, locale);
+      if (BUFFERP (locale))
+       XBUFFER (locale)->buffer_local_face_property = 1;
+    }
 }
 
 void
@@ -841,16 +837,7 @@ set_font_attached_to (Lisp_Object obj, Lisp_Object face, Lisp_Object property)
 DEFUN ("font-specifier-p", Ffont_specifier_p, 1, 1, 0, /*
 Return non-nil if OBJECT is a font specifier.
 
-Valid instantiators for font specifiers are:
-
--- a string naming a font (e.g. under X this might be
-   "-*-courier-medium-r-*-*-*-140-*-*-*-*-iso8859-*" for a 14-point
-   upright medium-weight Courier font)
--- a font instance (use that instance directly if the device matches,
-   or use the string that generated it)
--- a vector of no elements (only on TTY's; this means to set no font
-   at all, thus using the "natural" font of the terminal's text)
--- a vector of one element (a face to inherit from)
+See `make-font-specifier' for a description of possible font instantiators.
 */
        (object))
 {
@@ -923,7 +910,7 @@ face_boolean_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
       return retval;
     }
   else
-    abort ();  /* Eh? */
+    ABORT ();  /* Eh? */
 
   return Qunbound;
 }
@@ -970,7 +957,11 @@ face_boolean_after_change (Lisp_Object specifier, Lisp_Object locale)
   Lisp_Object property =
     FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY (XFACE_BOOLEAN_SPECIFIER (specifier));
   if (!NILP (face))
-    face_property_was_changed (face, property, locale);
+    {
+      face_property_was_changed (face, property, locale);
+      if (BUFFERP (locale))
+       XBUFFER (locale)->buffer_local_face_property = 1;
+    }
 }
 
 void
@@ -986,15 +977,8 @@ set_face_boolean_attached_to (Lisp_Object obj, Lisp_Object face,
 DEFUN ("face-boolean-specifier-p", Fface_boolean_specifier_p, 1, 1, 0, /*
 Return non-nil if OBJECT is a face-boolean specifier.
 
-Valid instantiators for face-boolean specifiers are
-
--- t or nil
--- a vector of two or three elements: a face to inherit from,
-   optionally a symbol naming the property of that face to inherit from
-   (if omitted, defaults to the same property that this face-boolean
-   specifier is used for; if this specifier is not part of a face,
-   the instantiator would not be valid), and optionally a value which,
-   if non-nil, means to invert the sense of the inherited property.
+See `make-face-boolean-specifier' for a description of possible
+face-boolean instantiators.
 */
        (object))
 {
@@ -1009,6 +993,9 @@ Valid instantiators for face-boolean specifiers are
 void
 syms_of_objects (void)
 {
+  INIT_LRECORD_IMPLEMENTATION (color_instance);
+  INIT_LRECORD_IMPLEMENTATION (font_instance);
+
   DEFSUBR (Fcolor_specifier_p);
   DEFSUBR (Ffont_specifier_p);
   DEFSUBR (Fface_boolean_specifier_p);