unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Lars Ingebrigtsen <larsi@gnus.org>, Glenn Morris <rgm@gnu.org>
Cc: "16271@debbugs.gnu.org" <16271@debbugs.gnu.org>
Subject: bug#16271: warn about quoted const's in defcustom
Date: Wed, 11 May 2022 14:21:59 +0000	[thread overview]
Message-ID: <SJ0PR10MB54887C574035B9B699E37930F3C89@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <875ymce3x7.fsf@gnus.org>

> > And this really means 'nicknames.  Anybody
> > got any suggestions how to work around that?

Suggestions given.  And ignored.

> I just changed that form, since it seemed pretty
> nonsensical anyway.

Clearly that doesn't solve the problem at all.

The problem is not the existence of that code
in Emacs.  The problem is the lack of good
help regarding the possible values.

And a quoted symbol (more generally, a quoted
sexp) is perfectly fine as a value, here.
Not typical, but fine.

Whether vanilla Emacs code contains such an
example is 100% irrelevant.  Removing that
code in order to avoid a warning message is,
well, misguided.

That just masks/hides the problem.

But it also points to the fact that using a
_warning_ to solve the problem is misguided.

The problem is insufficient communication to
users of what the possible values are.

And in particular, that (1) you typically use
a value without quoting it, AND (2) you can
use a quoted sexp if you in fact want the
value that's used to be a quoted sexp.

To communicate that information a warning is
(1) inappropriate - there's nothing to "warn"
about, and (2) insufficient - no simple
warning text will make clear what's involved.

There's _no substitute_ for documenting this
properly in the manual.  Include an example.

That there's no substitute for documenting
this in the manual doesn't mean that other
help can't also be provided somehow, somewhere.
But not a _warning_.  That's counter-productive
and misleading.

> I've now pushed this checker to Emacs 29, and 
> it found a handful of wrongly quoted symbols,
> which I've also fixed.

If they were truly wrongly quoted, great.
But irrelevant to fixing this problem, which
is one of helping users understand.

Misses the point altogether.  It doesn't tell
users about either of (1) and (2).  Instead,
it suggests something else - that there's
actually something to _warn_ about.

> However, as the 'nicknames thing shows, there
> may be legitimate usages of the 'foo form, so
> perhaps the checker should be hidden behind a
> user option.

Of course there are legitimate uses.  And no,
nothing about this should be hidden behind a
user option.

> But I guess we'll find out.

Maybe in another decade or two this will get
handled properly.  Or not.





      parent reply	other threads:[~2022-05-11 14:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-28  2:20 bug#16271: warn about quoted const's in defcustom Glenn Morris
2022-05-10 16:32 ` Lars Ingebrigtsen
2022-05-10 16:41   ` Drew Adams
2022-05-11 10:53   ` Lars Ingebrigtsen
2022-05-11 12:32     ` Andreas Schwab
2022-05-11 13:02       ` Lars Ingebrigtsen
2022-05-11 14:21     ` Drew Adams [this message]

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=SJ0PR10MB54887C574035B9B699E37930F3C89@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=16271@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=rgm@gnu.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).