unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How do I get rid of a face defined with defface?
@ 2019-07-20 13:19 Alan Mackenzie
  2019-07-20 13:58 ` Eli Zaretskii
  2019-07-20 21:56 ` Noam Postavsky
  0 siblings, 2 replies; 6+ messages in thread
From: Alan Mackenzie @ 2019-07-20 13:19 UTC (permalink / raw)
  To: help-gnu-emacs

Hello, Emacs.

In CC Mode, some debug faces are generated with, e.g., 

    (defface c-debug-is-sws-face ....)

.  Certain macros generate additional code when, e.g.,

    (facep 'c-debuf-is-sws-face)

holds.

I now want to turn off these debugging facilities, and to get these
macros to generate just the normal code, I need to get rid of the face
c-debug-is-sws-face.  I can't find any mention in the manual of how to
do this (this may be a manual bug), nor any statement that it is not
possible (again, a possible manual bug).

So, can I get rid of this face?  If so, how?  Whether or not, where is
the spot in the manual saying so?

Thanks in advance for the help!

-- 
Alan Mackenzie (Nuremberg, Germany).



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How do I get rid of a face defined with defface?
  2019-07-20 13:19 How do I get rid of a face defined with defface? Alan Mackenzie
@ 2019-07-20 13:58 ` Eli Zaretskii
  2019-07-20 14:05   ` Stefan Monnier
  2019-07-20 21:56 ` Noam Postavsky
  1 sibling, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2019-07-20 13:58 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sat, 20 Jul 2019 13:19:51 +0000
> From: Alan Mackenzie <acm@muc.de>
> 
> In CC Mode, some debug faces are generated with, e.g., 
> 
>     (defface c-debug-is-sws-face ....)

That line is commented out in the current sources.  And
list-faces-display doesn't show it.

> .  Certain macros generate additional code when, e.g.,
> 
>     (facep 'c-debuf-is-sws-face)
> 
> holds.
> 
> I now want to turn off these debugging facilities, and to get these
> macros to generate just the normal code, I need to get rid of the face
> c-debug-is-sws-face.  I can't find any mention in the manual of how to
> do this (this may be a manual bug), nor any statement that it is not
> possible (again, a possible manual bug).

How to do what? get rid of a face that isn't defined in the first
place?  You don't need to do anything, I think.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How do I get rid of a face defined with defface?
  2019-07-20 13:58 ` Eli Zaretskii
@ 2019-07-20 14:05   ` Stefan Monnier
  2019-07-20 14:10     ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2019-07-20 14:05 UTC (permalink / raw)
  To: help-gnu-emacs

> How to do what?

I think he wants to *undefine* a face in the running session.
Like Alan I neither know how to do that nor whether it can be done.


        Stefan




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How do I get rid of a face defined with defface?
  2019-07-20 14:05   ` Stefan Monnier
@ 2019-07-20 14:10     ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2019-07-20 14:10 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Sat, 20 Jul 2019 10:05:06 -0400
> 
> > How to do what?
> 
> I think he wants to *undefine* a face in the running session.

You can't, AFAIK.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How do I get rid of a face defined with defface?
  2019-07-20 13:19 How do I get rid of a face defined with defface? Alan Mackenzie
  2019-07-20 13:58 ` Eli Zaretskii
@ 2019-07-20 21:56 ` Noam Postavsky
  2019-07-21  2:30   ` Eli Zaretskii
  1 sibling, 1 reply; 6+ messages in thread
From: Noam Postavsky @ 2019-07-20 21:56 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: Help Gnu Emacs mailing list

On Sat, 20 Jul 2019 at 09:19, Alan Mackenzie <acm@muc.de> wrote:

> .  Certain macros generate additional code when, e.g.,
>
>     (facep 'c-debuf-is-sws-face)
>
> holds.

> So, can I get rid of this face?  If so, how?  Whether or not, where is
> the spot in the manual saying so?

Based on the code that facep calls, I came up with this:

(setq face-new-frame-defaults
      (assq-delete-all 'c-debug-is-sws-face face-new-frame-defaults))

which seems to work.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How do I get rid of a face defined with defface?
  2019-07-20 21:56 ` Noam Postavsky
@ 2019-07-21  2:30   ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2019-07-21  2:30 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: acm, help-gnu-emacs

> From: Noam Postavsky <npostavs@gmail.com>
> Date: Sat, 20 Jul 2019 17:56:16 -0400
> Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
> 
> (setq face-new-frame-defaults
>       (assq-delete-all 'c-debug-is-sws-face face-new-frame-defaults))
> 
> which seems to work.

I don't think you can do that safely, because the face could be used
by some frames.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-07-21  2:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-20 13:19 How do I get rid of a face defined with defface? Alan Mackenzie
2019-07-20 13:58 ` Eli Zaretskii
2019-07-20 14:05   ` Stefan Monnier
2019-07-20 14:10     ` Eli Zaretskii
2019-07-20 21:56 ` Noam Postavsky
2019-07-21  2:30   ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).