Subject: bug#59900: closed (Re: bug#59900: 30.0.50; map pattern in pcase causes a byte-compile error)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 10 Dec 2022 07:54:02 +0000

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 [email-masked].

-- 
59900: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59900
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#59900: 30.0.50; map pattern in pcase causes a byte-compile error
From: Eli Zaretskii <[email-masked]>
To: Michael Heerdegen <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sat, 10 Dec 2022 09:53:42 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Michael Heerdegen <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Sat, 10 Dec 2022 02:01:35 +0100
> 
> Michael Heerdegen <[email-masked]> 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.

Subject: 30.0.50; map pattern in pcase causes a byte-compile error
From: Akira Komamura <[email-masked]>
To: [email-masked]
Date: Thu, 08 Dec 2022 16:50:25 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

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)
  ...