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 17:56:30 +0300

> Date: Thu, 01 Sep 2022 13:15:42 +0000
> From: Gregory Heytings <gregory@heytings.org>
> cc: 57499-done@debbugs.gnu.org
> 
> >> Would a warning in *Messages* be okay then?
> >
> > We could try that, yes.  But it has to be only in *Messages*, not an 
> > actual warning, since faces get merged and realized as part of 
> > redisplay, when signaling an error is a bad idea.
> >
> 
> Like this?  I just checked, it passes make bootstrap and make check.

Not exactly what I had in mind.

> +char warning_attribute_nil[] =
> +  "Warning: using :%s nil with frame t has no effect.";

I thought you wanted to warn about using nil where nil is not a valid
value.  The calls to the macro are all in the case where the actual
problem is that nil is not a valid value, so the warning text is not
what we want to convey (or so I thought).

> +      if (redisplaying_p)                                            \
> +     CALLN (Fmessage,                                                \
> +            build_string (warning_attribute_nil),                    \
> +            build_string (S));                                       \

There's no need to use Fmessage, just add_to_log should be enough.

> +      else                                                           \
> +     Fsignal (Quser_error,                                           \
> +              list1 (CALLN (Fformat,                                 \
> +                            build_string (warning_attribute_nil),    \
> +                            build_string (S))));                     \

And I don't agree with signaling a user-error for these cases, when
they are outside redisplay.  For starters, the face code could be
called during C-n or C-v or some other command that uses the display
code internally.  Signaling an error is only TRT if we stop supporting
this back-compatibility shim.





reply via email to

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