unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Gregory Heytings <gregory@heytings.org>
Cc: 57499-done@debbugs.gnu.org
Subject: bug#57499: Documentation bug in the docstring of set-face-attribute?
Date: Thu, 01 Sep 2022 17:56:30 +0300	[thread overview]
Message-ID: <83r10vqh29.fsf@gnu.org> (raw)
In-Reply-To: <f61b9c26196f03bc3d6d@heytings.org> (message from Gregory Heytings on Thu, 01 Sep 2022 13:15:42 +0000)

> 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	other threads:[~2022-09-01 14:56 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-31  8:14 bug#57499: Documentation bug in the docstring of set-face-attribute? Gregory Heytings
2022-08-31  8:17 ` Gregory Heytings
2022-08-31 11:11 ` Eli Zaretskii
2022-08-31 12:04   ` Gregory Heytings
2022-08-31 12:39     ` Eli Zaretskii
2022-08-31 12:53       ` Gregory Heytings
2022-08-31 13:06         ` Eli Zaretskii
2022-08-31 13:43           ` Gregory Heytings
2022-08-31 16:11             ` Eli Zaretskii
2022-08-31 18:33               ` Gregory Heytings
2022-08-31 19:13                 ` Eli Zaretskii
2022-08-31 19:33                   ` Gregory Heytings
2022-08-31 19:49                     ` Eli Zaretskii
2022-08-31 21:13                       ` Gregory Heytings
2022-09-01  7:04                         ` Eli Zaretskii
2022-09-01  8:25                           ` Gregory Heytings
2022-09-01  8:44                             ` Eli Zaretskii
2022-09-01  9:02                               ` Gregory Heytings
2022-09-01 11:33                                 ` Eli Zaretskii
2022-09-01 11:56                                   ` Gregory Heytings
2022-09-01 12:08                                     ` Eli Zaretskii
2022-09-01 13:15                                       ` Gregory Heytings
2022-09-01 14:56                                         ` Eli Zaretskii [this message]
2022-09-01 17:07                                           ` Gregory Heytings
2022-09-01 18:24                                             ` Eli Zaretskii
2022-09-01 19:35                                               ` Gregory Heytings
2022-09-02 16:00                                                 ` Eli Zaretskii
2022-09-02 20:48                                                   ` Gregory Heytings
2022-09-03  6:00                                                     ` Eli Zaretskii
2022-09-03  6:43                                                       ` Gregory Heytings
2022-09-03  1:26                                                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83r10vqh29.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=57499-done@debbugs.gnu.org \
    --cc=gregory@heytings.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).