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

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

bug#57499: Documentation bug in the docstring of set-face-attribute?


From: Eli Zaretskii
Subject: bug#57499: Documentation bug in the docstring of set-face-attribute?
Date: Thu, 01 Sep 2022 21:24:59 +0300

> Date: Thu, 01 Sep 2022 17:07:13 +0000
> From: Gregory Heytings <gregory@heytings.org>
> cc: 57499-done@debbugs.gnu.org
> 
> +---
> +** The value nil is now deprecated for some face attributes.
> +The face attributes :background, :foreground and :distant-foreground
> +could be given a value nil for backward-compatibility with Emacs 20.
> +This is now deprecated, the 'unspecified value should be used instead.

It isn't deprecated, it's invalid.  There's no need to have anything
like this in NEWS, because all our documentation says the color
attributes can have only string values (in addition to 'unspecified').

> +#define HANDLE_INVALID_OR_DEPRECATED_NIL_VALUE(A)                    \
> +  if (NILP (value))                                                  \
> +    {                                                                        
> \
> +      if (EQ (frame, Qt))                                            \
> +     add_to_log ("Warning: invalid value nil for attribute `%s' "    \
> +                 "with frame t or nil: use 'unspecified instead of " \
> +                 "nil", A);                                          \
> +      else                                                           \
> +     add_to_log ("Warning: using value nil for attribute `%s' is "   \
> +                 "deprecated: use 'unspecified instead of nil", A);  \
> +      /* Compatibility with 20.x.  */                                        
> \
> +      value = Qunspecified;                                          \

No need to differentiate between FRAME = t and the other cases.

And the message text should just say

  Warning: nil value for `%s' is invalid, use 'unspecified instead.





reply via email to

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