emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/xfaces.c


From: Kim F . Storm
Subject: [Emacs-diffs] Changes to emacs/src/xfaces.c
Date: Thu, 28 Apr 2005 09:14:06 -0400

Index: emacs/src/xfaces.c
diff -c emacs/src/xfaces.c:1.320 emacs/src/xfaces.c:1.321
*** emacs/src/xfaces.c:1.320    Thu Apr 21 23:45:40 2005
--- emacs/src/xfaces.c  Thu Apr 28 13:14:06 2005
***************
*** 333,338 ****
--- 333,340 ----
  
  Lisp_Object Qface_alias;
  
+ extern Lisp_Object Qcircular_list;
+ 
  /* Default stipple pattern used on monochrome displays.  This stipple
     pattern is used on monochrome displays instead of shades of gray
     for a face background color.  See `set-face-stipple' for possible
***************
*** 468,474 ****
  
  static void map_tty_color P_ ((struct frame *, struct face *,
                               enum lface_attribute_index, int *));
! static Lisp_Object resolve_face_name P_ ((Lisp_Object));
  static int may_use_scalable_font_p P_ ((const char *));
  static void set_font_frame_param P_ ((Lisp_Object, Lisp_Object));
  static int better_font_p P_ ((int *, struct font_name *, struct font_name *,
--- 470,476 ----
  
  static void map_tty_color P_ ((struct frame *, struct face *,
                               enum lface_attribute_index, int *));
! static Lisp_Object resolve_face_name P_ ((Lisp_Object, int));
  static int may_use_scalable_font_p P_ ((const char *));
  static void set_font_frame_param P_ ((Lisp_Object, Lisp_Object));
  static int better_font_p P_ ((int *, struct font_name *, struct font_name *,
***************
*** 3203,3229 ****
  
  
  /* Resolve face name FACE_NAME.  If FACE_NAME is a string, intern it
!    to make it a symvol.  If FACE_NAME is an alias for another face,
!    return that face's name.  */
  
  static Lisp_Object
! resolve_face_name (face_name)
       Lisp_Object face_name;
  {
!   Lisp_Object aliased;
!   int alias_loop_max = 10;
  
    if (STRINGP (face_name))
      face_name = intern (SDATA (face_name));
  
!   while (SYMBOLP (face_name))
      {
!       aliased = Fget (face_name, Qface_alias);
!       if (NILP (aliased))
        break;
!       if (--alias_loop_max == 0)
        break;
!       face_name = aliased;
      }
  
    return face_name;
--- 3205,3251 ----
  
  
  /* 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,
!    return that face's name.
! 
!    Return default face in case of errors.  */
  
  static Lisp_Object
! resolve_face_name (face_name, signal_p)
       Lisp_Object face_name;
+      int signal_p;
  {
!   Lisp_Object orig_face;
!   Lisp_Object tortoise, hare;
  
    if (STRINGP (face_name))
      face_name = intern (SDATA (face_name));
  
!   if (NILP (face_name) || !SYMBOLP (face_name))
!     return face_name;
! 
!   orig_face = face_name;
!   tortoise = hare = face_name;
! 
!   while (1)
      {
!       face_name = hare;
!       hare = Fget (hare, Qface_alias);
!       if (NILP (hare) || !SYMBOLP (hare))
        break;
! 
!       face_name = hare;
!       hare = Fget (hare, Qface_alias);
!       if (NILP (hare) || !SYMBOLP (hare))
        break;
! 
!       tortoise = Fget (tortoise, Qface_alias);
!       if (EQ (hare, tortoise))
!       {
!         if (signal_p)
!           Fsignal (Qcircular_list, Fcons (orig_face, Qnil));
!         return Qdefault;
!       }
      }
  
    return face_name;
***************
*** 3247,3253 ****
  {
    Lisp_Object lface;
  
!   face_name = resolve_face_name (face_name);
  
    if (f)
      lface = assq_no_quit (face_name, f->face_alist);
--- 3269,3275 ----
  {
    Lisp_Object lface;
  
!   face_name = resolve_face_name (face_name, signal_p);
  
    if (f)
      lface = assq_no_quit (face_name, f->face_alist);
***************
*** 3982,3988 ****
    CHECK_SYMBOL (face);
    CHECK_SYMBOL (attr);
  
!   face = resolve_face_name (face);
  
    /* If FRAME is 0, change face on all frames, and change the
       default for new frames.  */
--- 4004,4010 ----
    CHECK_SYMBOL (face);
    CHECK_SYMBOL (attr);
  
!   face = resolve_face_name (face, 1);
  
    /* If FRAME is 0, change face on all frames, and change the
       default for new frames.  */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]