unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Stephani via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Jonas Bernoulli <jonas@bernoul.li>, 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 13:38:34 +0200	[thread overview]
Message-ID: <CAP-RRPv_4HdEkjhdDdWgzGEzaJAOH_gdFufemrjLABeT8zspEg@mail.gmail.com> (raw)
In-Reply-To: <87pmfrwyri.fsf@gnus.org>

On Mon, 19 Sept 2022 at 10:32, Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
> 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.

Makes sense, fixed in commit a71de4b52d3de14349ded7d88c4cae6e2a9376ae.

-- 
Google Germany GmbH
Erika-Mann-Straße 33
80636 München

Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

Diese E-Mail ist vertraulich. Falls Sie diese fälschlicherweise
erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes
weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich
bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.

This e-mail is confidential. If you received this communication by
mistake, please don’t forward it to anyone else, please erase all
copies and attachments, and please let me know that it has gone to the
wrong person.





  reply	other threads:[~2022-09-19 11:38 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
2022-09-19 11:38   ` Philipp Stephani via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
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=CAP-RRPv_4HdEkjhdDdWgzGEzaJAOH_gdFufemrjLABeT8zspEg@mail.gmail.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=57915@debbugs.gnu.org \
    --cc=jonas@bernoul.li \
    --cc=larsi@gnus.org \
    --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).