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: Akira Komamura <akira.komamura <at> gmail.com>
Subject: bug#59900: closed (Re: bug#59900: 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 bug report

#59900: 30.0.50; map pattern in pcase causes a byte-compile error

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 59900 <at> debbugs.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: 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.

[Message part 3 (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)
  ...



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

Previous Next


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