From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: Qs on resetting faces Date: Tue, 11 Oct 2005 14:58:36 -0700 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1129068011 32120 80.91.229.2 (11 Oct 2005 22:00:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Oct 2005 22:00:11 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 12 00:00:07 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EPS9D-00059i-FM for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Oct 2005 23:58:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EPS9C-0000NU-W4 for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Oct 2005 17:58:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EPS90-0000NE-GZ for help-gnu-emacs@gnu.org; Tue, 11 Oct 2005 17:58:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EPS8y-0000N2-RM for help-gnu-emacs@gnu.org; Tue, 11 Oct 2005 17:58:46 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EPS8y-0000Mz-O2 for help-gnu-emacs@gnu.org; Tue, 11 Oct 2005 17:58:44 -0400 Original-Received: from [141.146.126.231] (helo=agminet04.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EPS8z-0006PM-02 for help-gnu-emacs@gnu.org; Tue, 11 Oct 2005 17:58:45 -0400 Original-Received: from rgmsgw301.us.oracle.com (rgmsgw301.us.oracle.com [138.1.186.50]) by agminet04.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id j9BLwhQS018269 for ; Tue, 11 Oct 2005 16:58:43 -0500 Original-Received: from rgmsgw301.us.oracle.com (localhost [127.0.0.1]) by rgmsgw301.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id j9BLwggf019104 for ; Tue, 11 Oct 2005 15:58:42 -0600 Original-Received: from dradamslap (dhcp-amer-csvpn-gw1-141-144-65-58.vpn.oracle.com [141.144.65.58]) by rgmsgw301.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id j9BLwfD1019097 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Tue, 11 Oct 2005 15:58:42 -0600 Original-To: "Help-Gnu-Emacs" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:30151 Archived-At: 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.