comparison src/xfaces.c @ 89978:566253900690

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-40 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-535 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-536 sync-tree with gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-537 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-538 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-539 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-540 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-541 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-542 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-545 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-546 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-547 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-548 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-549 Use symbol-matching for generic-mode keywords * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-550 Update from CVS * miles@gnu.org--gnu-2004/gnus--devo--0--patch-2 Add {arch}/=cvs-sync-make-log * miles@gnu.org--gnu-2004/gnus--rel--5.8--base-0 Import from Gnus CVS branch V5-8 * miles@gnu.org--gnu-2004/gnus--rel--5.8--patch-1 {arch}/=tagging-method: Add CVS and autoconf grot to junk regexp * miles@gnu.org--gnu-2004/gnus--rel--5.8--patch-2 Use explicit tags for autoconf input files * miles@gnu.org--gnu-2004/gnus--rel--5.8--patch-3 Remove RCS keywords * miles@gnu.org--gnu-2004/gnus--rel--5.8--patch-4 Fix copied explicit id-tags * miles@gnu.org--gnu-2004/gnus--rel--5.8--patch-5 Add {arch}/=cvs-sync-make-log * miles@gnu.org--gnu-2004/gnus--rel--5.8--patch-6 configure.in: Use ifelse instead of m4_if for arch-tag: comment * miles@gnu.org--gnu-2004/gnus--rel--5.10--base-0 tag of miles@gnu.org--gnu-2004/gnus--rel--5.8--base-0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-1 Gnus 5.10, from CVS branch v5-10 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-2 Merge from gnus--rel--5.8 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-3 Use explicit tags for autoconf input files * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-4 sync-tree with gnus--rel--5.8 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-5 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-6 Merge from gnus--rel--5.8 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-7 Remove RCS keywords * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-8 Merge from gnus--rel--5.8 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-9 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-10 Add {arch}/=cvs-sync-make-log * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-11 Merge from gnus--rel--5.8 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-12 Update from CVS: make.bat: Fix line endings around arch-tag. * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-13 - miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-17 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-21 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-22 Update from CVS: lisp/nndb.el (require): Remove tcp and duplicate cl. * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-23 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-24 lisp/nnimap.el (nnimap-open-connection): Remove extraneous end-paren * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-25 - miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-26 Update from CVS
author Miles Bader <miles@gnu.org>
date Wed, 15 Sep 2004 09:00:10 +0000
parents d8411455de48 0d0a17cf1b63
children cb7f41387eb3
comparison
equal deleted inserted replaced
89977:549fdd6f6856 89978:566253900690
386 386
387 /* The symbols `face' and `mouse-face' used as text properties. */ 387 /* The symbols `face' and `mouse-face' used as text properties. */
388 388
389 Lisp_Object Qface; 389 Lisp_Object Qface;
390 extern Lisp_Object Qmouse_face; 390 extern Lisp_Object Qmouse_face;
391
392 /* Property for basic faces which other faces cannot inherit. */
393
394 Lisp_Object Qface_no_inherit;
391 395
392 /* Error symbol for wrong_type_argument in load_pixmap. */ 396 /* Error symbol for wrong_type_argument in load_pixmap. */
393 397
394 Lisp_Object Qbitmap_spec_p; 398 Lisp_Object Qbitmap_spec_p;
395 399
3942 /* Changing a named face means that all realized faces depending on 3946 /* Changing a named face means that all realized faces depending on
3943 that face are invalid. Since we cannot tell which realized faces 3947 that face are invalid. Since we cannot tell which realized faces
3944 depend on the face, make sure they are all removed. This is done 3948 depend on the face, make sure they are all removed. This is done
3945 by incrementing face_change_count. The next call to 3949 by incrementing face_change_count. The next call to
3946 init_iterator will then free realized faces. */ 3950 init_iterator will then free realized faces. */
3947 ++face_change_count; 3951 if (NILP (Fget (face, Qface_no_inherit)))
3948 ++windows_or_buffers_changed; 3952 {
3953 ++face_change_count;
3954 ++windows_or_buffers_changed;
3955 }
3949 3956
3950 xassert (LFACEP (lface)); 3957 xassert (LFACEP (lface));
3951 check_lface (lface); 3958 check_lface (lface);
3952 return lface; 3959 return lface;
3953 } 3960 }
4018 /* Changing a named face means that all realized faces depending on 4025 /* Changing a named face means that all realized faces depending on
4019 that face are invalid. Since we cannot tell which realized faces 4026 that face are invalid. Since we cannot tell which realized faces
4020 depend on the face, make sure they are all removed. This is done 4027 depend on the face, make sure they are all removed. This is done
4021 by incrementing face_change_count. The next call to 4028 by incrementing face_change_count. The next call to
4022 init_iterator will then free realized faces. */ 4029 init_iterator will then free realized faces. */
4023 ++face_change_count; 4030 if (NILP (Fget (to, Qface_no_inherit)))
4024 ++windows_or_buffers_changed; 4031 {
4032 ++face_change_count;
4033 ++windows_or_buffers_changed;
4034 }
4025 4035
4026 return to; 4036 return to;
4027 } 4037 }
4028 4038
4029 4039
4383 that face are invalid. Since we cannot tell which realized faces 4393 that face are invalid. Since we cannot tell which realized faces
4384 depend on the face, make sure they are all removed. This is done 4394 depend on the face, make sure they are all removed. This is done
4385 by incrementing face_change_count. The next call to 4395 by incrementing face_change_count. The next call to
4386 init_iterator will then free realized faces. */ 4396 init_iterator will then free realized faces. */
4387 if (!EQ (frame, Qt) 4397 if (!EQ (frame, Qt)
4398 && NILP (Fget (face, Qface_no_inherit))
4388 && (EQ (attr, QCfont) 4399 && (EQ (attr, QCfont)
4389 || EQ (attr, QCfontset) 4400 || EQ (attr, QCfontset)
4390 || NILP (Fequal (old_value, value)))) 4401 || NILP (Fequal (old_value, value))))
4391 { 4402 {
4392 ++face_change_count; 4403 ++face_change_count;
4536 void 4547 void
4537 update_face_from_frame_parameter (f, param, new_value) 4548 update_face_from_frame_parameter (f, param, new_value)
4538 struct frame *f; 4549 struct frame *f;
4539 Lisp_Object param, new_value; 4550 Lisp_Object param, new_value;
4540 { 4551 {
4552 Lisp_Object face = Qnil;
4541 Lisp_Object lface; 4553 Lisp_Object lface;
4542 4554
4543 /* If there are no faces yet, give up. This is the case when called 4555 /* If there are no faces yet, give up. This is the case when called
4544 from Fx_create_frame, and we do the necessary things later in 4556 from Fx_create_frame, and we do the necessary things later in
4545 face-set-after-frame-defaults. */ 4557 face-set-after-frame-defaults. */
4546 if (NILP (f->face_alist)) 4558 if (NILP (f->face_alist))
4547 return; 4559 return;
4548 4560
4561 if (EQ (param, Qforeground_color))
4562 {
4563 face = Qdefault;
4564 lface = lface_from_face_name (f, face, 1);
4565 LFACE_FOREGROUND (lface) = (STRINGP (new_value)
4566 ? new_value : Qunspecified);
4567 realize_basic_faces (f);
4568 }
4569 else if (EQ (param, Qbackground_color))
4570 {
4571 Lisp_Object frame;
4572
4573 /* Changing the background color might change the background
4574 mode, so that we have to load new defface specs. Call
4575 frame-update-face-colors to do that. */
4576 XSETFRAME (frame, f);
4577 call1 (Qframe_update_face_colors, frame);
4578
4579 face = Qdefault;
4580 lface = lface_from_face_name (f, face, 1);
4581 LFACE_BACKGROUND (lface) = (STRINGP (new_value)
4582 ? new_value : Qunspecified);
4583 realize_basic_faces (f);
4584 }
4585 else if (EQ (param, Qborder_color))
4586 {
4587 face = Qborder;
4588 lface = lface_from_face_name (f, face, 1);
4589 LFACE_BACKGROUND (lface) = (STRINGP (new_value)
4590 ? new_value : Qunspecified);
4591 }
4592 else if (EQ (param, Qcursor_color))
4593 {
4594 face = Qcursor;
4595 lface = lface_from_face_name (f, face, 1);
4596 LFACE_BACKGROUND (lface) = (STRINGP (new_value)
4597 ? new_value : Qunspecified);
4598 }
4599 else if (EQ (param, Qmouse_color))
4600 {
4601 face = Qmouse;
4602 lface = lface_from_face_name (f, face, 1);
4603 LFACE_BACKGROUND (lface) = (STRINGP (new_value)
4604 ? new_value : Qunspecified);
4605 }
4606
4549 /* Changing a named face means that all realized faces depending on 4607 /* Changing a named face means that all realized faces depending on
4550 that face are invalid. Since we cannot tell which realized faces 4608 that face are invalid. Since we cannot tell which realized faces
4551 depend on the face, make sure they are all removed. This is done 4609 depend on the face, make sure they are all removed. This is done
4552 by incrementing face_change_count. The next call to 4610 by incrementing face_change_count. The next call to
4553 init_iterator will then free realized faces. */ 4611 init_iterator will then free realized faces. */
4554 ++face_change_count; 4612 if (!NILP (face)
4555 ++windows_or_buffers_changed; 4613 && NILP (Fget (face, Qface_no_inherit)))
4556 4614 {
4557 if (EQ (param, Qforeground_color)) 4615 ++face_change_count;
4558 { 4616 ++windows_or_buffers_changed;
4559 lface = lface_from_face_name (f, Qdefault, 1);
4560 LFACE_FOREGROUND (lface) = (STRINGP (new_value)
4561 ? new_value : Qunspecified);
4562 realize_basic_faces (f);
4563 }
4564 else if (EQ (param, Qbackground_color))
4565 {
4566 Lisp_Object frame;
4567
4568 /* Changing the background color might change the background
4569 mode, so that we have to load new defface specs. Call
4570 frame-update-face-colors to do that. */
4571 XSETFRAME (frame, f);
4572 call1 (Qframe_update_face_colors, frame);
4573
4574 lface = lface_from_face_name (f, Qdefault, 1);
4575 LFACE_BACKGROUND (lface) = (STRINGP (new_value)
4576 ? new_value : Qunspecified);
4577 realize_basic_faces (f);
4578 }
4579 if (EQ (param, Qborder_color))
4580 {
4581 lface = lface_from_face_name (f, Qborder, 1);
4582 LFACE_BACKGROUND (lface) = (STRINGP (new_value)
4583 ? new_value : Qunspecified);
4584 }
4585 else if (EQ (param, Qcursor_color))
4586 {
4587 lface = lface_from_face_name (f, Qcursor, 1);
4588 LFACE_BACKGROUND (lface) = (STRINGP (new_value)
4589 ? new_value : Qunspecified);
4590 }
4591 else if (EQ (param, Qmouse_color))
4592 {
4593 lface = lface_from_face_name (f, Qmouse, 1);
4594 LFACE_BACKGROUND (lface) = (STRINGP (new_value)
4595 ? new_value : Qunspecified);
4596 } 4617 }
4597 } 4618 }
4598 4619
4599 4620
4600 /* Get the value of X resource RESOURCE, class CLASS for the display 4621 /* Get the value of X resource RESOURCE, class CLASS for the display
7949 void 7970 void
7950 syms_of_xfaces () 7971 syms_of_xfaces ()
7951 { 7972 {
7952 Qface = intern ("face"); 7973 Qface = intern ("face");
7953 staticpro (&Qface); 7974 staticpro (&Qface);
7975 Qface_no_inherit = intern ("face-no-inherit");
7976 staticpro (&Qface_no_inherit);
7954 Qbitmap_spec_p = intern ("bitmap-spec-p"); 7977 Qbitmap_spec_p = intern ("bitmap-spec-p");
7955 staticpro (&Qbitmap_spec_p); 7978 staticpro (&Qbitmap_spec_p);
7956 Qframe_update_face_colors = intern ("frame-update-face-colors"); 7979 Qframe_update_face_colors = intern ("frame-update-face-colors");
7957 staticpro (&Qframe_update_face_colors); 7980 staticpro (&Qframe_update_face_colors);
7958 7981