unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Elisp manual: Note that created faces cannot be removed.
@ 2019-07-20 18:37 Alan Mackenzie
  2019-07-20 18:39 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Mackenzie @ 2019-07-20 18:37 UTC (permalink / raw)
  To: emacs-devel

Hello, Emacs.

It transpires that once a face has been created by defface, it cannot
then be removed.  This is not mentioned in the Elisp manual, despite this
non removeability being exceptionally rare in Emacs.

So I propose the following patch, which is surely(?) uncontroversial:


diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 276d60b21a..22b7eb0bd1 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -2476,6 +2476,9 @@ Defining Faces
 usual procedure is to define a face with @code{defface}, and then use
 its name directly.
 
+Note that once you have defined a face with @code{defface}, you cannot
+later remove this face 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},


.  Is it too late to push this patch to Emacs 26, or does the rule about
documentation changes being OK still hold?

-- 
Alan Mackenzie (Nuremberg, Germany).



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

* Re: Elisp manual: Note that created faces cannot be removed.
  2019-07-20 18:37 Elisp manual: Note that created faces cannot be removed Alan Mackenzie
@ 2019-07-20 18:39 ` Eli Zaretskii
  2019-07-20 18:41   ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2019-07-20 18:39 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: emacs-devel

> Date: Sat, 20 Jul 2019 18:37:15 +0000
> From: Alan Mackenzie <acm@muc.de>
> 
> So I propose the following patch, which is surely(?) uncontroversial:
> 
> 
> diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
> index 276d60b21a..22b7eb0bd1 100644
> --- a/doc/lispref/display.texi
> +++ b/doc/lispref/display.texi
> @@ -2476,6 +2476,9 @@ Defining Faces
>  usual procedure is to define a face with @code{defface}, and then use
>  its name directly.
>  
> +Note that once you have defined a face with @code{defface}, you cannot
> +later remove this face except by restarting Emacs.

I think without some index entries leading to it, this sentence will
be lost in the ocean of the information in the manual.



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

* Re: Elisp manual: Note that created faces cannot be removed.
  2019-07-20 18:39 ` Eli Zaretskii
@ 2019-07-20 18:41   ` Eli Zaretskii
  2019-07-20 20:26     ` Alan Mackenzie
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2019-07-20 18:41 UTC (permalink / raw)
  To: acm; +Cc: emacs-devel

> Date: Sat, 20 Jul 2019 21:39:31 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: emacs-devel@gnu.org
> 
> > +Note that once you have defined a face with @code{defface}, you cannot
> > +later remove this face except by restarting Emacs.
> 
> I think without some index entries leading to it, this sentence will
> be lost in the ocean of the information in the manual.

Also, defface is not the only way of defining a face, unlike what the
proposed text seems to imply.



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

* Re: Elisp manual: Note that created faces cannot be removed.
  2019-07-20 18:41   ` Eli Zaretskii
@ 2019-07-20 20:26     ` Alan Mackenzie
  2019-07-21  2:28       ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Mackenzie @ 2019-07-20 20:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Hello, Eli.

On Sat, Jul 20, 2019 at 21:41:20 +0300, Eli Zaretskii wrote:
> > Date: Sat, 20 Jul 2019 21:39:31 +0300
> > From: Eli Zaretskii <eliz@gnu.org>
> > Cc: emacs-devel@gnu.org

> > > +Note that once you have defined a face with @code{defface}, you cannot
> > > +later remove this face except by restarting Emacs.

> > 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?



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 remove this face 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).



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

* Re: Elisp manual: Note that created faces cannot be removed.
  2019-07-20 20:26     ` Alan Mackenzie
@ 2019-07-21  2:28       ` Eli Zaretskii
  2019-07-22 10:02         ` Alan Mackenzie
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2019-07-21  2:28 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: emacs-devel

> Date: Sat, 20 Jul 2019 20:26:08 +0000
> Cc: emacs-devel@gnu.org
> From: Alan Mackenzie <acm@muc.de>
> 
> > > 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.



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

* Re: Elisp manual: Note that created faces cannot be removed.
  2019-07-21  2:28       ` Eli Zaretskii
@ 2019-07-22 10:02         ` Alan Mackenzie
  2019-07-22 14:33           ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Mackenzie @ 2019-07-22 10:02 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Noam Postavsky, emacs-devel

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 <acm@muc.de>

> > > > 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).



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

* Re: Elisp manual: Note that created faces cannot be removed.
  2019-07-22 10:02         ` Alan Mackenzie
@ 2019-07-22 14:33           ` Eli Zaretskii
  2019-07-22 15:18             ` Alan Mackenzie
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2019-07-22 14:33 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: npostavs, emacs-devel

> Date: Mon, 22 Jul 2019 10:02:09 +0000
> Cc: emacs-devel@gnu.org, Noam Postavsky <npostavs@gmail.com>
> From: Alan Mackenzie <acm@muc.de>
> 
> 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.

That's fine with me, but unlike you, I don't really see a difference:
for the reader of the ELisp manual "cannot undefine safely" and
"cannot remove" are identical for all practical purposes.  Moreover,
"undefine a face" is not really well-defined.




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

* Re: Elisp manual: Note that created faces cannot be removed.
  2019-07-22 14:33           ` Eli Zaretskii
@ 2019-07-22 15:18             ` Alan Mackenzie
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Mackenzie @ 2019-07-22 15:18 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: npostavs, emacs-devel

Hello, Eli.

On Mon, Jul 22, 2019 at 17:33:40 +0300, Eli Zaretskii wrote:
> > Date: Mon, 22 Jul 2019 10:02:09 +0000
> > Cc: emacs-devel@gnu.org, Noam Postavsky <npostavs@gmail.com>
> > From: Alan Mackenzie <acm@muc.de>

> > 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.

> That's fine with me, but unlike you, I don't really see a difference:
> for the reader of the ELisp manual "cannot undefine safely" and
> "cannot remove" are identical for all practical purposes.  Moreover,
> "undefine a face" is not really well-defined.

Well, I've just committed the change.  Maybe there's only a slight
difference between "cannot remove" and "cannot undefine safely", but
there actually is a difference - the latter is closer to the truth.

"undefine a face" might not be well-defined, but since we can't do it
anyway (at least, not safely), that surely doesn't matter too much.
Stefan has suggested we hack such a facility, but ...  Well somebody
would have to do it, and the benefit of it would not be great.

Anyway, I think we've talked around this enough already, so let's just
close the conversation.  :-)

-- 
Alan Mackenzie (Nuremberg, Germany).



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

end of thread, other threads:[~2019-07-22 15:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-20 18:37 Elisp manual: Note that created faces cannot be removed Alan Mackenzie
2019-07-20 18:39 ` Eli Zaretskii
2019-07-20 18:41   ` Eli Zaretskii
2019-07-20 20:26     ` Alan Mackenzie
2019-07-21  2:28       ` Eli Zaretskii
2019-07-22 10:02         ` Alan Mackenzie
2019-07-22 14:33           ` Eli Zaretskii
2019-07-22 15:18             ` Alan Mackenzie

Code repositories for project(s) associated with this public inbox

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

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).