unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Jonas Bernoulli <jonas@bernoul.li>
Cc: Philipp Stephani <phst@google.com>, 57915@debbugs.gnu.org
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	[thread overview]
Message-ID: <87pmfrwyri.fsf@gnus.org> (raw)
In-Reply-To: <87y1ugo4qk.fsf@bernoul.li> (Jonas Bernoulli's message of "Sun, 18 Sep 2022 21:35:31 +0200")

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.





  reply	other threads:[~2022-09-19  8:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-18 19:35 bug#57915: 29.0.50; Misleading warning about use of quote in clause of cl-case Jonas Bernoulli
2022-09-19  8:32 ` Lars Ingebrigtsen [this message]
2022-09-19 11:38   ` Philipp Stephani via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-19 18:42     ` Lars Ingebrigtsen

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=87pmfrwyri.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=57915@debbugs.gnu.org \
    --cc=jonas@bernoul.li \
    --cc=phst@google.com \
    /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).