[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#16271: warn about quoted const's in defcustom
From: |
Drew Adams |
Subject: |
bug#16271: warn about quoted const's in defcustom |
Date: |
Tue, 10 May 2022 16:41:15 +0000 |
> > 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.