emacs-bug-tracker
[Top][All Lists]
Advanced

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

bug#57499: closed (Documentation bug in the docstring of set-face-attrib


From: GNU bug Tracking System
Subject: bug#57499: closed (Documentation bug in the docstring of set-face-attribute?)
Date: Thu, 01 Sep 2022 08:45:02 +0000

Your message dated Thu, 01 Sep 2022 11:44:48 +0300
with message-id <834jxrscu7.fsf@gnu.org>
and subject line Re: bug#57499: Documentation bug in the docstring of 
set-face-attribute?
has caused the debbugs.gnu.org bug report #57499,
regarding Documentation bug in the docstring of set-face-attribute?
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
57499: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57499
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: Documentation bug in the docstring of set-face-attribute? Date: Wed, 31 Aug 2022 08:14:00 +0000

The docstring of set-face-attribute says:

"As an exception, to reset the value of some attribute to `unspecified' in a way that overrides the non-`unspecified' value defined by the face's spec in `defface', for new frames, you must explicitly call this function with FRAME set to t and the attribute's value set to `unspecified'; just using FRAME of nil will not affect new frames in this case."

Not only is that sentence hard to parse, it also seems wrong.

Can someone come up with a scenario in which a call

(set-face-attribute 'some-face nil :some-attribute 'unspecified)

only affects existing frames? In my testing it affects all frames (existing and future ones), and that's also what the code seems to do: set-face-attribute sets where to 0 when frame is nil, and calls internal-set-face-attribute



--- End Message ---
--- Begin Message --- Subject: Re: bug#57499: Documentation bug in the docstring of set-face-attribute? Date: Thu, 01 Sep 2022 11:44:48 +0300
> Date: Thu, 01 Sep 2022 08:25:35 +0000
> From: Gregory Heytings <gregory@heytings.org>
> cc: 57499@debbugs.gnu.org
> 
> >> I just want to make it as clear as possible that to get that special 
> >> value `unspecified' one should use the symbol 'unspecified.
> >
> > We have gazillions of such situations everywhere in Emacs where symbol 
> > values are documented, and we never say anything beyond the name of the 
> > symbol with proper quoting.
> 
> For some reason this situation seems different (from a user point of 
> view), give that the same question pops again and again.  Why is adding 
> such a note a problem?

Because we don't say anything like that anywhere else.

> And when one calls
> 
> (set-face-attribute 'isearch t :background 'unspecified)
> 
> this is what is happening:
> 
> (internal-set-lisp-face-attributes 'isearch :background 'unspecified t)
> 
> So this call is already included in the previous one.  Why should we tell 
> users to add such a redundant call in their code?

The new text doesn't say the call with FRAM = t should be an
additional call.

> As far as I understand, the actual and real problem here is some users use 
> nil when they should use 'unspecified, because they are not aware that nil 
> and 'unspecified are subtly different.  The subtle difference is that 
> using nil works for frame = #<frame-1> ... #<frame-n>, but does not work 
> with frame = t.

That is a backward-compatibility feature that I don't want to mention
in the doc string.  Lisp programs should only use valid values that
are documented in the doc string.

> > When a new frame is created, attribute values in the FACE's `defspec' 
> > normally override the `unspecified' values in the FACE's default 
> > attributes.  To avoid that, i.e. to cause ATTRIBUTE's value be reset to 
> > `unspecified' when creating new frames, disregarding what the FACE's 
> > face spec says, call this function with FRAME set to t and the 
> > ATTRIBUTE's value set to `unspecified'.
> 
> See above: I really don't understand why the 'unspecified value should be 
> detailed as if it were different from the other values, when in fact it 
> isn't.  The real and actual problem here is that users are confused by the 
> fact that a nil value for an attribute is equivalent to an 'unspecified 
> value for existing frames, but is not equivalent to 'unspecified for new 
> frames.

I give up.  I've installed the last text I proposed, and I'm closing
this bug with that.


--- End Message ---

reply via email to

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