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 [emacs-unicode-2]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/xfaces.c [emacs-unicode-2]
Date: Wed, 15 Sep 2004 05:22:58 -0400

Index: emacs/src/xfaces.c
diff -c emacs/src/xfaces.c:1.281.2.16 emacs/src/xfaces.c:1.281.2.17
*** emacs/src/xfaces.c:1.281.2.16       Fri Aug 27 07:00:34 2004
--- emacs/src/xfaces.c  Wed Sep 15 09:00:02 2004
***************
*** 389,394 ****
--- 389,398 ----
  Lisp_Object Qface;
  extern Lisp_Object Qmouse_face;
  
+ /* Property for basic faces which other faces cannot inherit.  */
+ 
+ Lisp_Object Qface_no_inherit;
+ 
  /* Error symbol for wrong_type_argument in load_pixmap.  */
  
  Lisp_Object Qbitmap_spec_p;
***************
*** 3944,3951 ****
       depend on the face, make sure they are all removed.  This is done
       by incrementing face_change_count.  The next call to
       init_iterator will then free realized faces.  */
!   ++face_change_count;
!   ++windows_or_buffers_changed;
  
    xassert (LFACEP (lface));
    check_lface (lface);
--- 3948,3958 ----
       depend on the face, make sure they are all removed.  This is done
       by incrementing face_change_count.  The next call to
       init_iterator will then free realized faces.  */
!   if (NILP (Fget (face, Qface_no_inherit)))
!     {
!       ++face_change_count;
!       ++windows_or_buffers_changed;
!     }
  
    xassert (LFACEP (lface));
    check_lface (lface);
***************
*** 4020,4027 ****
       depend on the face, make sure they are all removed.  This is done
       by incrementing face_change_count.  The next call to
       init_iterator will then free realized faces.  */
!   ++face_change_count;
!   ++windows_or_buffers_changed;
  
    return to;
  }
--- 4027,4037 ----
       depend on the face, make sure they are all removed.  This is done
       by incrementing face_change_count.  The next call to
       init_iterator will then free realized faces.  */
!   if (NILP (Fget (to, Qface_no_inherit)))
!     {
!       ++face_change_count;
!       ++windows_or_buffers_changed;
!     }
  
    return to;
  }
***************
*** 4385,4390 ****
--- 4395,4401 ----
       by incrementing face_change_count.  The next call to
       init_iterator will then free realized faces.  */
    if (!EQ (frame, Qt)
+       && NILP (Fget (face, Qface_no_inherit))
        && (EQ (attr, QCfont)
          || EQ (attr, QCfontset)
          || NILP (Fequal (old_value, value))))
***************
*** 4538,4543 ****
--- 4549,4555 ----
       struct frame *f;
       Lisp_Object param, new_value;
  {
+   Lisp_Object face = Qnil;
    Lisp_Object lface;
  
    /* If there are no faces yet, give up.  This is the case when called
***************
*** 4546,4562 ****
    if (NILP (f->face_alist))
      return;
  
-   /* Changing a named face means that all realized faces depending on
-      that face are invalid.  Since we cannot tell which realized faces
-      depend on the face, make sure they are all removed.  This is done
-      by incrementing face_change_count.  The next call to
-      init_iterator will then free realized faces.  */
-   ++face_change_count;
-   ++windows_or_buffers_changed;
- 
    if (EQ (param, Qforeground_color))
      {
!       lface = lface_from_face_name (f, Qdefault, 1);
        LFACE_FOREGROUND (lface) = (STRINGP (new_value)
                                  ? new_value : Qunspecified);
        realize_basic_faces (f);
--- 4558,4567 ----
    if (NILP (f->face_alist))
      return;
  
    if (EQ (param, Qforeground_color))
      {
!       face = Qdefault;
!       lface = lface_from_face_name (f, face, 1);
        LFACE_FOREGROUND (lface) = (STRINGP (new_value)
                                  ? new_value : Qunspecified);
        realize_basic_faces (f);
***************
*** 4571,4599 ****
        XSETFRAME (frame, f);
        call1 (Qframe_update_face_colors, frame);
  
!       lface = lface_from_face_name (f, Qdefault, 1);
        LFACE_BACKGROUND (lface) = (STRINGP (new_value)
                                  ? new_value : Qunspecified);
        realize_basic_faces (f);
      }
!   if (EQ (param, Qborder_color))
      {
!       lface = lface_from_face_name (f, Qborder, 1);
        LFACE_BACKGROUND (lface) = (STRINGP (new_value)
                                  ? new_value : Qunspecified);
      }
    else if (EQ (param, Qcursor_color))
      {
!       lface = lface_from_face_name (f, Qcursor, 1);
        LFACE_BACKGROUND (lface) = (STRINGP (new_value)
                                  ? new_value : Qunspecified);
      }
    else if (EQ (param, Qmouse_color))
      {
!       lface = lface_from_face_name (f, Qmouse, 1);
        LFACE_BACKGROUND (lface) = (STRINGP (new_value)
                                  ? new_value : Qunspecified);
      }
  }
  
  
--- 4576,4620 ----
        XSETFRAME (frame, f);
        call1 (Qframe_update_face_colors, frame);
  
!       face = Qdefault;
!       lface = lface_from_face_name (f, face, 1);
        LFACE_BACKGROUND (lface) = (STRINGP (new_value)
                                  ? new_value : Qunspecified);
        realize_basic_faces (f);
      }
!   else if (EQ (param, Qborder_color))
      {
!       face = Qborder;
!       lface = lface_from_face_name (f, face, 1);
        LFACE_BACKGROUND (lface) = (STRINGP (new_value)
                                  ? new_value : Qunspecified);
      }
    else if (EQ (param, Qcursor_color))
      {
!       face = Qcursor;
!       lface = lface_from_face_name (f, face, 1);
        LFACE_BACKGROUND (lface) = (STRINGP (new_value)
                                  ? new_value : Qunspecified);
      }
    else if (EQ (param, Qmouse_color))
      {
!       face = Qmouse;
!       lface = lface_from_face_name (f, face, 1);
        LFACE_BACKGROUND (lface) = (STRINGP (new_value)
                                  ? new_value : Qunspecified);
      }
+ 
+   /* Changing a named face means that all realized faces depending on
+      that face are invalid.  Since we cannot tell which realized faces
+      depend on the face, make sure they are all removed.  This is done
+      by incrementing face_change_count.  The next call to
+      init_iterator will then free realized faces.  */
+   if (!NILP (face)
+       && NILP (Fget (face, Qface_no_inherit)))
+     {
+       ++face_change_count;
+       ++windows_or_buffers_changed;
+     }
  }
  
  
***************
*** 7951,7956 ****
--- 7972,7979 ----
  {
    Qface = intern ("face");
    staticpro (&Qface);
+   Qface_no_inherit = intern ("face-no-inherit");
+   staticpro (&Qface_no_inherit);
    Qbitmap_spec_p = intern ("bitmap-spec-p");
    staticpro (&Qbitmap_spec_p);
    Qframe_update_face_colors = intern ("frame-update-face-colors");




reply via email to

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