From unknown Sat Aug 09 13:08:56 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#78884 <78884@debbugs.gnu.org> To: bug#78884 <78884@debbugs.gnu.org> Subject: Status: 30.1; peg-parse does not treat its arguments as sequence Reply-To: bug#78884 <78884@debbugs.gnu.org> Date: Sat, 09 Aug 2025 20:08:56 +0000 retitle 78884 30.1; peg-parse does not treat its arguments as sequence reassign 78884 emacs submitter 78884 Tim Landscheidt severity 78884 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 23 20:12:27 2025 Received: (at submit) by debbugs.gnu.org; 24 Jun 2025 00:12:28 +0000 Received: from localhost ([127.0.0.1]:33619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uTrH1-0001QR-Ga for submit@debbugs.gnu.org; Mon, 23 Jun 2025 20:12:27 -0400 Received: from lists.gnu.org ([2001:470:142::17]:34276) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uTrGz-0001Pi-1G for submit@debbugs.gnu.org; Mon, 23 Jun 2025 20:12:25 -0400 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 1uTrGs-0000rA-TK for bug-gnu-emacs@gnu.org; Mon, 23 Jun 2025 20:12:18 -0400 Received: from gavdos.tim-landscheidt.de ([2a01:4f8:1c0c:4bd6::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uTrGr-0006b2-Bk for bug-gnu-emacs@gnu.org; Mon, 23 Jun 2025 20:12:18 -0400 Received: from port-62-145-29-194.static.as20676.net ([62.145.29.194]:58688 helo=vagabond) by gavdos.tim-landscheidt.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uTrGj-000Ut1-3B for bug-gnu-emacs@gnu.org; Tue, 24 Jun 2025 00:12:13 +0000 From: Tim Landscheidt To: bug-gnu-emacs@gnu.org Subject: 30.1; peg-parse does not treat its arguments as sequence Organization: https://www.tim-landscheidt.de/ X-Debbugs-Cc: Stefan Monnier Date: Tue, 24 Jun 2025 00:12:11 +0000 Message-ID: <875xgmdmlg.fsf@vagabond.tim-landscheidt.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a01:4f8:1c0c:4bd6::1; envelope-from=tim@tim-landscheidt.de; helo=gavdos.tim-landscheidt.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) The docstring for Emacs 30.1's peg-parse reads: | (peg-parse &rest PEXS) | Match PEXS at point. | PEXS is a sequence of PEG expressions, implicitly combined with =E2=80=98= and=E2=80=99. | Returns STACK if the match succeed and signals an error on failure, | moving point along the way. However, it will fail with (for example) "Wrong type argument: listp" when called as such: | ELISP> (with-temp-buffer | (insert "ABCDEF") | (goto-char (point-min)) | (peg-parse | (bob) | "ABC")) | *** Eval error *** Wrong type argument: listp, "ABC" | ELISP> An explicit sequence with "and" works: | ELISP> (with-temp-buffer | (insert "ABCDEF") | (goto-char (point-min)) | (peg-parse | (and | (bob) | "ABC"))) | t | ELISP> From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 24 14:12:48 2025 Received: (at 78884) by debbugs.gnu.org; 24 Jun 2025 18:12:48 +0000 Received: from localhost ([127.0.0.1]:48084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uU88W-0006Q8-G4 for submit@debbugs.gnu.org; Tue, 24 Jun 2025 14:12:48 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:45585) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uU88T-0006P9-Le for 78884@debbugs.gnu.org; Tue, 24 Jun 2025 14:12:46 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id E59DF1000BC; Tue, 24 Jun 2025 14:12:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1750788757; bh=UcEdMqP7jgJIWc+7H1FHiJvR0MF3crYm6cOMM2F5h5Y=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=CetKpssK3BKE4EIvKTkGDwr5luptmwsLgl2KhxAWNh/7mlmfs1xH0oMv5tCaotd9b 9ejzCHoaVb//fTFUrwRW8PdOA6/nI1/cN7VcAWyP3v2W8FxJCtTbx298/H4OnYDWWP HHDRoco4anyHL7Zgqu5sM2Fnua/T7D+GnRlcMGGqzah1UaSjAYhqzYE0cN7Z/+i0AO fGviNu0r95JVD1aV+nvgLuHD02mFF7rjdnxg+q9HoWqxy2+s2l5NpTUknhTL5+EwtD h137Jo/KEmH19K7hPhFSZhHNEGSl7bgyiYX4OQaO2Va9/pwoJJr76wAooC9csH8UV9 khFbVVhBB5zLA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id E3841100029; Tue, 24 Jun 2025 14:12:37 -0400 (EDT) Received: from pastel (unknown [104.247.225.139]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id BD820120682; Tue, 24 Jun 2025 14:12:37 -0400 (EDT) From: Stefan Monnier To: Tim Landscheidt Subject: Re: bug#78884: 30.1; peg-parse does not treat its arguments as sequence In-Reply-To: <875xgmdmlg.fsf@vagabond.tim-landscheidt.de> Message-ID: References: <875xgmdmlg.fsf@vagabond.tim-landscheidt.de> Date: Tue, 24 Jun 2025 14:12:36 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.318 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78884 Cc: 78884@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Tim Landscheidt [2025-06-24 00:12:11] wrote: > The docstring for Emacs 30.1's peg-parse reads: > > | (peg-parse &rest PEXS) > > | Match PEXS at point. > | PEXS is a sequence of PEG expressions, implicitly combined with =E2=80= =98and=E2=80=99. > | Returns STACK if the match succeed and signals an error on failure, > | moving point along the way. > > However, it will fail with (for example) "Wrong type > argument: listp" when called as such: > > | ELISP> (with-temp-buffer > | (insert "ABCDEF") > | (goto-char (point-min)) > | (peg-parse > | (bob) > | "ABC")) > | *** Eval error *** Wrong type argument: listp, "ABC" > | ELISP> > > An explicit sequence with "and" works: > > | ELISP> (with-temp-buffer > | (insert "ABCDEF") > | (goto-char (point-min)) > | (peg-parse > | (and > | (bob) > | "ABC"))) > | t > > | ELISP> Can you check that the quick-fix below fixes things on your side (and not just for your example)? Stefan diff --git a/lisp/progmodes/peg.el b/lisp/progmodes/peg.el index 7827990af35..b5ffff31362 100644 --- a/lisp/progmodes/peg.el +++ b/lisp/progmodes/peg.el @@ -320,8 +320,9 @@ peg-parse moving point along the way." (if (and (consp (car pexs)) (symbolp (caar pexs)) - (not (ignore-errors - (not (eq 'call (car (peg-normalize (car pexs)))))))) + (not (or (get (peg--rule-id (caar pexs)) 'peg--rule-definition) + (ignore-errors + (not (eq 'call (car (peg-normalize (car pexs))))))))) ;; The first of `pexs' has not been defined as a rule, so assume ;; that none of them have been and they should be fed to ;; `with-peg-rules' From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 27 23:15:59 2025 Received: (at 78884-done) by debbugs.gnu.org; 28 Jun 2025 03:15:59 +0000 Received: from localhost ([127.0.0.1]:45393 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uVM2o-0003Ib-IK for submit@debbugs.gnu.org; Fri, 27 Jun 2025 23:15:58 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:57326) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uVM2m-0003Hk-QR for 78884-done@debbugs.gnu.org; Fri, 27 Jun 2025 23:15:57 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5C00D4409C3; Fri, 27 Jun 2025 23:15:51 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1751080550; bh=qbRI97rmKu8TtAi0m51QIAJwF8n9cRWIXK6ddXOLlFs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=fibsgTaDiycrxQCzmb0g8kIMDhPiwohlklQYf4c7D/nFSCcJHeko5J55DOjp/6JRv 4cFzCKxK+1PbxQ4AHVQ+yTfS7VaFU3sKFL1OjmQXoINj75Uq2ACmUpcXjMUCwUTs2L dbbdGY7G0ZrtqHEX14oY4keyihBqDgv1jpbnV9QQtsVA013OupDxgDoOLNh3JEeXum yCvkEJS9bjKZfpFVBYLYYfhrzmzQDvs7y1pIR+RVnnlm/1PvSn1UV4DEQTpDR66ZSn CixRL9/LS56RnFbDOhFOSJQTa5ZTNKgvM35RZbAMMUIgNSC57diS3+K2VG2M2hQvcW JbC/xMsXCUu7w== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 11ADC4409B4; Fri, 27 Jun 2025 23:15:50 -0400 (EDT) Received: from pastel (unknown [104.247.225.139]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E38D012062E; Fri, 27 Jun 2025 23:15:49 -0400 (EDT) From: Stefan Monnier To: Tim Landscheidt Subject: Re: bug#78884: 30.1; peg-parse does not treat its arguments as sequence In-Reply-To: Message-ID: References: <875xgmdmlg.fsf@vagabond.tim-landscheidt.de> Date: Fri, 27 Jun 2025 23:15:48 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.296 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78884-done Cc: 78884-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Can you check that the quick-fix below fixes things on your side (and > not just for your example)? Well, I pushed it to `master`, and I'm closing the bug. In case it's not fully fixed, feel free to reopen, of course. Stefan From unknown Sat Aug 09 13:08:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 26 Jul 2025 11:24:13 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator