From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#59900: 30.0.50; map pattern in pcase causes a byte-compile error Date: Fri, 09 Dec 2022 21:06:46 +0200 Message-ID: <83a63wz9a1.fsf@gnu.org> References: <877cz22v26.fsf@gmail.com> <83ilim2lyz.fsf@gnu.org> <87k031nx6l.fsf@web.de> <837cz1125q.fsf@gnu.org> <875yekv4jr.fsf@web.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18244"; mail-complaints-to="usenet@ciao.gmane.io" Cc: akira.komamura@gmail.com, 59900@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 09 20:07:18 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p3iiM-0004Yq-F4 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Dec 2022 20:07:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3ii9-0008LI-96; Fri, 09 Dec 2022 14:07:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3ii6-0008Kx-Lp for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 14:07:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p3ii6-0005hD-DJ for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 14:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3ii6-0001z4-5g for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 14:07:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Dec 2022 19:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59900 X-GNU-PR-Package: emacs Original-Received: via spool by 59900-submit@debbugs.gnu.org id=B59900.16706128207620 (code B ref 59900); Fri, 09 Dec 2022 19:07:02 +0000 Original-Received: (at 59900) by debbugs.gnu.org; 9 Dec 2022 19:07:00 +0000 Original-Received: from localhost ([127.0.0.1]:37867 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3ii4-0001yq-9S for submit@debbugs.gnu.org; Fri, 09 Dec 2022 14:07:00 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3ii2-0001yi-Qd for 59900@debbugs.gnu.org; Fri, 09 Dec 2022 14:06:59 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3ihx-0005gK-IR; Fri, 09 Dec 2022 14:06:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=qO3VyxtcdtsF/Y0uPHvCnJdQCprKrm6WSzXcNi0dIsI=; b=nST/eefrUv7f DwMeG7KqtTs2jbG2t77pFhrpa35mEhkJQ0sEZoaIgxZ046rxbRdVWLnqpDVlU9OyMaSPUCDDK1DSK FMnHVJ+qkefS5pR04UebO7A8E6ehu76uR0Y5gng1Dl9+pIIjexVzE1RarkicBm2EM3+6xlb6PUYJ8 GHjydeZypetGNW9juwx/eWrlqBe+PEIG7hqRAMgpZbPQfag92NtgMh56eqTeNLgqOrT0whOC/MNPq Clbn5d5CSNhroy0uFx5kXxnCfwgrgB/nKUiqfUSgRJ1x6p/xgPVHQW4OdVYP+VJ+uUfgda8rL2nHu Ij3L8Cghi1NvPymC5aGHjQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3ihw-0002kZ-OL; Fri, 09 Dec 2022 14:06:53 -0500 In-Reply-To: <875yekv4jr.fsf@web.de> (message from Michael Heerdegen on Fri, 09 Dec 2022 19:02:32 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250431 Archived-At: > From: Michael Heerdegen > Cc: akira.komamura@gmail.com, 59900@debbugs.gnu.org > Date: Fri, 09 Dec 2022 19:02:32 +0100 > > Eli Zaretskii 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.