]> code.delx.au - gnu-emacs/blobdiff - src/xfaces.c
(mark_terminals): Typo.
[gnu-emacs] / src / xfaces.c
index 52252001137b24a12097181a92e74f157a24e07b..01ac364589fd6fac869019bec62ce5524b2744a0 100644 (file)
@@ -6,7 +6,7 @@ This file is part of GNU Emacs.
 
 GNU Emacs is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
 any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
@@ -267,8 +267,6 @@ Boston, MA 02110-1301, USA.  */
 
 #include <ctype.h>
 
-#define abs(X)         ((X) < 0 ? -(X) : (X))
-
 /* Number of pt per inch (from the TeXbook).  */
 
 #define PT_PER_INCH 72.27
@@ -746,10 +744,9 @@ x_free_gc (f, gc)
      struct frame *f;
      GC gc;
 {
-  BLOCK_INPUT;
+  eassert (interrupt_input_blocked);
   IF_DEBUG (xassert (--ngcs >= 0));
   XFreeGC (FRAME_X_DISPLAY (f), gc);
-  UNBLOCK_INPUT;
 }
 
 #endif /* HAVE_X_WINDOWS */
@@ -779,10 +776,8 @@ x_free_gc (f, gc)
      struct frame *f;
      GC gc;
 {
-  BLOCK_INPUT;
   IF_DEBUG (xassert (--ngcs >= 0));
   xfree (gc);
-  UNBLOCK_INPUT;
 }
 
 #endif  /* WINDOWSNT */
@@ -809,10 +804,9 @@ x_free_gc (f, gc)
      struct frame *f;
      GC gc;
 {
-  BLOCK_INPUT;
+  eassert (interrupt_input_blocked);
   IF_DEBUG (xassert (--ngcs >= 0));
   XFreeGC (FRAME_MAC_DISPLAY (f), gc);
-  UNBLOCK_INPUT;
 }
 
 #endif  /* MAC_OS */
@@ -1259,8 +1253,10 @@ load_face_font (f, face, c)
       face->overstrike = needs_overstrike;
       if (face->gc)
        {
+         BLOCK_INPUT;
          x_free_gc (f, face->gc);
          face->gc = 0;
+         UNBLOCK_INPUT;
        }
     }
   else
@@ -3224,12 +3220,13 @@ push_named_merge_point (struct named_merge_point *new_named_merge_point,
 
 \f
 
+#if 0                          /* Seems to be unused.  */
 static Lisp_Object
 internal_resolve_face_name (nargs, args)
      int nargs;
      Lisp_Object *args;
 {
-  Fget (args[0], args[1]);
+  return Fget (args[0], args[1]);
 }
 
 static Lisp_Object
@@ -3238,6 +3235,7 @@ resolve_face_name_error (ignore)
 {
   return Qnil;
 }
+#endif
 
 /* Resolve face name FACE_NAME.  If FACE_NAME is a string, intern it
    to make it a symbol.  If FACE_NAME is an alias for another face,
@@ -3952,6 +3950,8 @@ Otherwise check for the existence of a global face.  */)
 {
   Lisp_Object lface;
 
+  face = resolve_face_name (face, 1);
+
   if (!NILP (frame))
     {
       CHECK_LIVE_FRAME (frame);
@@ -5254,8 +5254,10 @@ free_realized_face (f, face)
            free_face_fontset (f, face);
          if (face->gc)
            {
+             BLOCK_INPUT;
              x_free_gc (f, face->gc);
              face->gc = 0;
+             UNBLOCK_INPUT;
            }
 
          free_face_colors (f, face);
@@ -5365,13 +5367,11 @@ If FRAME is unspecified or nil, the current frame is used.  */)
   CHECK_LIVE_FRAME (frame);
   f = XFRAME (frame);
 
-  if ((CONSP (color1) && !parse_rgb_list (color1, &cdef1))
-      || !STRINGP (color1)
-      || !defined_color (f, SDATA (color1), &cdef1, 0))
+  if (!(CONSP (color1) && parse_rgb_list (color1, &cdef1))
+      && !(STRINGP (color1) && defined_color (f, SDATA (color1), &cdef1, 0)))
     signal_error ("Invalid color", color1);
-  if ((CONSP (color2) && !parse_rgb_list (color2, &cdef2))
-      || !STRINGP (color2)
-      || !defined_color (f, SDATA (color2), &cdef2, 0))
+  if (!(CONSP (color2) && parse_rgb_list (color2, &cdef2))
+      && !(STRINGP (color2) && defined_color (f, SDATA (color2), &cdef2, 0)))
     signal_error ("Invalid color", color2);
 
   return make_number (color_distance (&cdef1, &cdef2));
@@ -5421,8 +5421,10 @@ clear_face_gcs (c)
          struct face *face = c->faces_by_id[i];
          if (face && face->gc)
            {
+             BLOCK_INPUT;
              x_free_gc (c->f, face->gc);
              face->gc = 0;
+             UNBLOCK_INPUT;
            }
        }
 #endif /* HAVE_WINDOW_SYSTEM */
@@ -8012,7 +8014,7 @@ syms_of_xfaces ()
   staticpro (&QCforeground);
   QCbackground = intern (":background");
   staticpro (&QCbackground);
-  QCstipple = intern (":stipple");;
+  QCstipple = intern (":stipple");
   staticpro (&QCstipple);
   QCwidth = intern (":width");
   staticpro (&QCwidth);