From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Elisp manual: Note that created faces cannot be removed. Date: Mon, 22 Jul 2019 10:02:09 +0000 Message-ID: <20190722100209.GA5933@ACM> References: <20190720183715.GC27030@ACM> <83a7d8sg7w.fsf@gnu.org> <838ssssg4v.fsf@gnu.org> <20190720202608.GD27030@ACM> <837e8crui6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="186861"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Noam Postavsky , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 22 12:02:23 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hpV9B-000mNs-UF for ged-emacs-devel@m.gmane.org; Mon, 22 Jul 2019 12:02:22 +0200 Original-Received: from localhost ([::1]:60160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hpV9A-0002tg-Kb for ged-emacs-devel@m.gmane.org; Mon, 22 Jul 2019 06:02:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53522) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hpV96-0002qs-Lg for emacs-devel@gnu.org; Mon, 22 Jul 2019 06:02:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hpV94-0007Gi-NT for emacs-devel@gnu.org; Mon, 22 Jul 2019 06:02:16 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:15200 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1hpV94-0007DJ-GT for emacs-devel@gnu.org; Mon, 22 Jul 2019 06:02:14 -0400 Original-Received: (qmail 497 invoked by uid 3782); 22 Jul 2019 09:09:45 -0000 Original-Received: from acm.muc.de (p4FE15FBF.dip0.t-ipconnect.de [79.225.95.191]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 22 Jul 2019 11:09:43 +0200 Original-Received: (qmail 6086 invoked by uid 1000); 22 Jul 2019 10:02:09 -0000 Content-Disposition: inline In-Reply-To: <837e8crui6.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:238782 Archived-At: Hello, Eli. On Sun, Jul 21, 2019 at 05:28:33 +0300, Eli Zaretskii wrote: > > Date: Sat, 20 Jul 2019 20:26:08 +0000 > > Cc: emacs-devel@gnu.org > > From: Alan Mackenzie > > > > I think without some index entries leading to it, this sentence will > > > > be lost in the ocean of the information in the manual. > > Well, this page was the first one I scanned whilst seeking a remove-face > > function. > > > Also, defface is not the only way of defining a face, unlike what the > > > proposed text seems to imply. > > OK. How about this slightly amended patch? > Fine with me, thanks. Sorry to go on about this (trivial) point, but I'm not happy about my proposed text any more. With the mechanism pointed out by Noam, it clearly _is_ possible to undefine a face, but it's unsafe. So, using "undefine" rather than "remove" (suggested to me by private email), and inserting the word "safely", I now propose this: diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 276d60b21a..4ae0bba723 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -2476,6 +2476,10 @@ Defining Faces usual procedure is to define a face with @code{defface}, and then use its name directly. +@cindex face (non-removability of) +Note that once you have defined a face (usually with @code{defface}), +you cannot later undefine this face safely, except by restarting Emacs. + @defmac defface face spec doc [keyword value]@dots{} This macro declares @var{face} as a named face whose default face spec is given by @var{spec}. You should not quote the symbol @var{face}, -- Alan Mackenzie (Nuremberg, Germany).