help-gnu-emacs
[Top][All Lists]
Advanced

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

Qs on resetting faces


From: Drew Adams
Subject: Qs on resetting faces
Date: Tue, 11 Oct 2005 14:58:36 -0700

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.





reply via email to

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