[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#57915: 29.0.50; Misleading warning about use of quote in clause of c
From: |
Lars Ingebrigtsen |
Subject: |
bug#57915: 29.0.50; Misleading warning about use of quote in clause of cl-case |
Date: |
Mon, 19 Sep 2022 10:32:01 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Jonas Bernoulli <jonas@bernoul.li> writes:
> I inherited some code like this:
>
> (cl-case foo
> ((quote) ...)
> ((funcall) ...))
>
> While I probably would not have written it like this, I think it
> makes sense, since (quote ...) looks like ... is being quoted. Using
> ((quote) ...) make it clear to the human reader that that is not what is
> happening. Unfortunately the byte-compiler now provides this misleading
> warning:
>
> Warning: Case (quote) will match ‘quote’. If that’s intended,
> write (nil quote) instead. Otherwise, don’t quote ‘nil’.
[...]
> Could this special case, (quote), be handled differently? I understand
> we want to catch, pcase-inspired clauses like 'x. I am not sure we can
> tell the difference between (quote), (quote nil) and 'nil, but it seems
> to me, that if that is not the case, we should avoid the invalid
> recommendation at the cost of not warning about the other, likely
> unintended uses.
Yeah, since there isn't really any other way to express this (or is
there?), we should probably not warn about this construction.
I've added Philipp to the CCs; perhaps he has some comments.