GNU bug report logs - #31350
27.0; `pcase' message: "Redundant pcase pattern"

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Thu, 3 May 2018 00:49:01 UTC

Severity: minor

Tags: fixed, moreinfo

Found in version 27.0

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #19 received at 31350 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 31350 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#31350: 27.0; `pcase' message: "Redundant pcase pattern"
Date: Sun, 04 Oct 2020 00:52:03 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> > These are the two clauses in question:
> >
> >  (`,a `(not,a))
> >  ((and a (guard (not recursivep))) `(not ,a))
>
> Can you post a complete test case that demonstrates the problem?

Well, when we compile something like

(defun test (foo recursivep)
  (pcase foo
    (a `(not ,a))
    ((and a (guard recursivep))
     `(not ,a))))

the message Drew means says

  Redundant pcase pattern: (and a (guard recursivep))

I'm happy with that, I think it tells anything I need to know.  I'm not
happy about the fact that I missed the `message' because it's only a
message and I only see it when I look into the *Messages* buffer because
it's overwritten very soon in the echo area.

The compiler log only shows

Compiling file /home/micha/today/pctest.el at Sun Oct  4 00:44:51 2020
pctest.el:46:1: Warning: Unused lexical argument `recursivep'

which is confusing if you missed the message about the redundant
pattern.

Michael.




This bug report was last modified 4 years and 239 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.