all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Qs on resetting faces
@ 2005-10-11 21:58 Drew Adams
  0 siblings, 0 replies; only message in thread
From: Drew Adams @ 2005-10-11 21:58 UTC (permalink / raw)


Suppose I have a minor mode that changes some face definitions, and I want
to undo these changes when the mode is subsequently turned off.

Two possibilities I see:

1. I could undo the minor-mode changes by resetting the face to whatever its
defface said - that is, reset it to its default initial value.

2. I could save the current face spec before turning on the minor mode, and
then restore that definition when turning the mode off.

#2 is better, because it respects any changes the user might have made to
the face. But I'd like to know how to do each of #1 and #2.

For #1, what function or code will reset a face to its custom default value?

For #2, what function or code will do the following?

a. Copy (save) the definition of a given face - either its definition for a
given frame or its current default definition (for new frames).

b. Restore the saved definition to the face.

This is not obvious to me. Thanks.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-10-11 21:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-11 21:58 Qs on resetting faces Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.