all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: akira.komamura@gmail.com, 59900@debbugs.gnu.org
Subject: bug#59900: 30.0.50; map pattern in pcase causes a byte-compile error
Date: Fri, 09 Dec 2022 21:06:46 +0200	[thread overview]
Message-ID: <83a63wz9a1.fsf@gnu.org> (raw)
In-Reply-To: <875yekv4jr.fsf@web.de> (message from Michael Heerdegen on Fri, 09 Dec 2022 19:02:32 +0100)

> From: Michael Heerdegen <michael_heerdegen@web.de>
> Cc: akira.komamura@gmail.com,  59900@debbugs.gnu.org
> Date: Fri, 09 Dec 2022 19:02:32 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Thanks, but all this still doesn't answer my questions,
> > unfortunately.  You-all are describing something that I cannot wrap my
> > head around, because that basic question was not answered yet.
> 
> What specific question?

The one I asked at the very beginning of this discussion:

  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59900#8

> pcase is extensible: It allows to define new pattern types.  "rx.el"
> defines a `rx' pcase pattern, "map.el" a `map' pcase pattern.  The
> normal way to be able to use them is to `require' the library in which
> they are defined.
> 
> Since `pcase' is a macro, the library (rx.el or map.el) must be loaded
> when a `pcase' form using such a pattern is compiled.
> 
> The `rx' pattern definition in rx.el uses autoload cookies so that
> compiling works even when rx.el is not loaded - it gets loaded
> automatically when compiling.
> 
> The map.el `map' pcase pattern doesn't use autoloading.  The OP found a
> case where compiling succeeded until some days ago without requiring
> map.el explictily, and now a require is needed.  But that was only by
> luck: AFAIU, map.el was already loaded in that scenario, and now it is
> any more.  But there is no guarantee that the library is always loaded
> when compiling arbitrary files, so one should _always_ explicitly
> require map.el when the file contains pcase forms with `map' patterns -
> even if this worked without in some cases in the past by luck.
> 
> The wish of the OP to make the `map' pattern in map.el `autoload'able
> like the `rx' pattern in rx.el is reasonable, I can try to create a
> patch.
> 
> But strictly speaking here is no bug, just the OP relying on something
> that in the past worked by luck.

It sounds like the bug is in the package which uses map.el, and that
package is not part of Emacs.





  reply	other threads:[~2022-12-09 19:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-08  7:50 bug#59900: 30.0.50; map pattern in pcase causes a byte-compile error Akira Komamura
2022-12-08 11:06 ` Eli Zaretskii
2022-12-08 13:03   ` Visuwesh
2022-12-08 14:20     ` Eli Zaretskii
2022-12-08 14:49       ` Visuwesh
2022-12-08 13:11   ` Akira Komamura
2022-12-09  2:11     ` Michael Heerdegen
2022-12-09  7:12       ` Eli Zaretskii
2022-12-09  7:58         ` Akira Komamura
2022-12-09 18:02         ` Michael Heerdegen
2022-12-09 19:06           ` Eli Zaretskii [this message]
2022-12-09 21:02             ` Michael Heerdegen
2022-12-10  1:01               ` Michael Heerdegen
2022-12-10  7:53                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83a63wz9a1.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=59900@debbugs.gnu.org \
    --cc=akira.komamura@gmail.com \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.