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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#59900: closed (30.0.50; map pattern in pcase causes a
 byte-compile error)
Date: Sat, 10 Dec 2022 07:54:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 10 Dec 2022 09:53:42 +0200
with message-id <83pmcry9rt.fsf <at> gnu.org>
and subject line Re: bug#59900: 30.0.50; map pattern in pcase causes a byte-compile error
has caused the debbugs.gnu.org bug report #59900,
regarding 30.0.50; map pattern in pcase causes a byte-compile error
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
59900: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59900
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Akira Komamura <akira.komamura <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; map pattern in pcase causes a byte-compile error
Date: Thu, 08 Dec 2022 16:50:25 +0900
After upgrading to Emacs 29, some packages throw byte-compile errors
due to use of `map' pattern in `pcase':

> org-bookmark-heading.el:176:6: Error: Unknown map pattern: (map
> 'filename 'outline-path 'id 'front-context-string 'indirectp)

The error can be avoided by `require'ing `map' at compile time in the
library depending on pcase:

(eval-when-compile
  ;; Support map pattern in pcase
  (require 'map))

However, this was not necessary in the previous versions.

As a similar example, the `rx' pattern for `pcase' is autoloaded (see
`rx.el'), so shouldn't the `map' pattern support be autoloaded as well?

;;;###autoload
(pcase-defmacro rx (&rest regexps)
  ...


[Message part 3 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: akira.komamura <at> gmail.com, 59900-done <at> debbugs.gnu.org
Subject: Re: bug#59900: 30.0.50; map pattern in pcase causes a byte-compile
 error
Date: Sat, 10 Dec 2022 09:53:42 +0200
> From: Michael Heerdegen <michael_heerdegen <at> web.de>
> Cc: akira.komamura <at> gmail.com,  59900 <at> debbugs.gnu.org
> Date: Sat, 10 Dec 2022 02:01:35 +0100
> 
> Michael Heerdegen <michael_heerdegen <at> web.de> writes:
> 
> > But I still want to create a patch to support autoloading of the `map'
> > pattern in "map.el", this is a good idea.
> 
> I'm not so sure after thinking more about it: _Nothing_ in "map.el" has
> an autoload cookie.  I'm not convinced that out of all things `map'
> pcase patterns should be the only thing that are autoloaded whereby
> everything else in map.el requires an explicit `require'.  That would be
> hardly consistent

Thanks.  I agree with that conclusion, and so I'm closing this bug
report.  The fix should be in the programs that use pcase-map, not in
core.


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.