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: Tue, 10 May 2022 16:41:15 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488F628D0AB0F1B08FE58D7F3C99@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87v8ude4bz.fsf@gnus.org>

> > The argument of a `const' (or `other') inside a defcustom type should
> > (almost always) not be quoted. Yet people keep doing it.
> > It would be nice if there was some way to warn about this.
> 
> Yes, that would be nice, so I've now implemented it.  However, there's
> one false positive:
> 
> (defcustom erc-button-alist
>   '(('nicknames 0 erc-button-buttonize-nicks erc-nick-popup 0)
> ...
>       (choice :tag "Matches"
>               regexp
>               (variable :tag "Variable containing regexp")
>               ;; FIXME It really does mean 'nicknames
>               ;; rather than just nicknames.
>               (const :tag "Nicknames" 'nicknames))
> 
> And this really means 'nicknames.  Anybody got any suggestions how to
> work around that?

Don't work around it.
Don't try to warn not to quote.

In (elisp) `Composite Types', (1) mention that
you typically do not want to quote, and (2)
show an example of the exception, with a quote,
saying what the behavior is in that case.

Warnings are not appropriate here, and will
likely confuse.  Making the case clear in the
doc is helpful.





  reply	other threads:[~2022-05-10 16:41 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 [this message]
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

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=SJ0PR10MB5488F628D0AB0F1B08FE58D7F3C99@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).