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: Tue, 14 Sep 2004 16:15:17 -0400

Index: emacs/src/xfaces.c
diff -c emacs/src/xfaces.c:1.304 emacs/src/xfaces.c:1.305
*** emacs/src/xfaces.c:1.304    Mon Aug 16 22:53:28 2004
--- emacs/src/xfaces.c  Tue Sep 14 20:04:09 2004
***************
*** 385,390 ****
--- 385,394 ----
  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;
***************
*** 3865,3872 ****
       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);
--- 3869,3879 ----
       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);
***************
*** 3941,3948 ****
       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;
  }
--- 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 (to, Qface_no_inherit)))
!     {
!       ++face_change_count;
!       ++windows_or_buffers_changed;
!     }
  
    return to;
  }
***************
*** 4299,4304 ****
--- 4309,4315 ----
       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)
          || NILP (Fequal (old_value, value))))
      {
***************
*** 4451,4456 ****
--- 4462,4468 ----
       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
***************
*** 4459,4475 ****
    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);
--- 4471,4480 ----
    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);
***************
*** 4484,4512 ****
        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);
      }
  }
  
  
--- 4489,4533 ----
        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;
+     }
  }
  
  
***************
*** 7758,7763 ****
--- 7779,7786 ----
  {
    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]