all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Akira Komamura <akira.komamura@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Michael Heerdegen <michael_heerdegen@web.de>, 59900@debbugs.gnu.org
Subject: bug#59900: 30.0.50; map pattern in pcase causes a byte-compile error
Date: Fri, 9 Dec 2022 16:58:28 +0900	[thread overview]
Message-ID: <CAFYM7h7NA-eYcs6+nTj=mN9fEJLEsn34grm7+PhZ2uE+GEf9ow@mail.gmail.com> (raw)
In-Reply-To: <837cz1125q.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

On Fri, Dec 9, 2022 at 4:12 PM Eli Zaretskii <eliz@gnu.org> wrote:

> 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.
>
> Would someone please take me through the problem step by step?
>

There is a MELPA package depending on `pcase'. It contains a `map' pattern:

(pcase-let* ((`(,_name . ,(map filename outline-path id
front-context-string indirectp))
  ...)

The support for `map' pattern is not built into `pcase.el'. Instead, it is
enabled through `pcase--get-macroexpander', which is implemented as follows:

(defun pcase--get-macroexpander (s)
  "Return the macroexpander for pcase pattern head S, or nil."
  (get s 'pcase-macroexpander))

It returns `pcase-macroexpander' property of the symbol (i.e. `map' in this
case). The property should be available at compile time. If not, the library
will fail to byte-compile.

To set the property of an additional pattern, `rx', `map', `seq', etc. all
use
`pcase-defmacro'. I think autoloading the `pcase-defmacro' form in `map.el'
can
prevent the error as well as possible future errors in other libraries.
This is
already done in `rx.el'.

[-- Attachment #2: Type: text/html, Size: 1681 bytes --]

  reply	other threads:[~2022-12-09  7:58 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 [this message]
2022-12-09 18:02         ` Michael Heerdegen
2022-12-09 19:06           ` Eli Zaretskii
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='CAFYM7h7NA-eYcs6+nTj=mN9fEJLEsn34grm7+PhZ2uE+GEf9ow@mail.gmail.com' \
    --to=akira.komamura@gmail.com \
    --cc=59900@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --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.