GNU bug report logs - #59900
30.0.50; map pattern in pcase causes a byte-compile error

Previous Next

Package: emacs;

Reported by: Akira Komamura <akira.komamura <at> gmail.com>

Date: Thu, 8 Dec 2022 09:51:03 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Akira Komamura <akira.komamura <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 59900 <at> debbugs.gnu.org
Subject: Re: bug#59900: 30.0.50; map pattern in pcase causes a byte-compile
 error
Date: Fri, 09 Dec 2022 03:11:14 +0100
Akira Komamura <akira.komamura <at> gmail.com> writes:

> I encountered similar errors in other libraries that contain a `map' pattern
> inside a `pcase' form. It didn't happen until recently, when I updated Emacs
> and
> began to get those errors.
>
>  So I wonder where's the place in the core Emacs sources
>  which causes the problem, and I couldn't find it.  I'm probably
>  missing something.

Maybe it started with

| 85555ad3b79 ; Require map only during compilation
| Philip Kaludercic <philipk <at> posteo.net> 2022-10-23

Anyway, AFAIU currently compiling pcase forms with `map' patterns
requires map.el to be currently loaded, and since you can't (and could
not) rely on that, it's better to add
(eval-when-compile (require 'map)).

> There are some other additional patterns for `pcase'. One of them is `rx'
> pattern. There is an autoload cookie right above the definition of
> `(pcase-defmacro rx ...' in `rx.el'. On the other hand, there is no autoload
> above `(pcase-defmacro map ...' in `map.el'. I think this might be the cause.
> Is there any reason for not autoloading the `pcase-defmacro` form?

I see no reason, it should be doable.

Michael.




This bug report was last modified 2 years and 215 days ago.

Previous Next


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