From unknown Mon Jun 23 13:08:04 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#6415 <6415@debbugs.gnu.org> To: bug#6415 <6415@debbugs.gnu.org> Subject: Status: 23.1.50; edebug-eval-defun errors on dotted pair in some macros Reply-To: bug#6415 <6415@debbugs.gnu.org> Date: Mon, 23 Jun 2025 20:08:04 +0000 retitle 6415 23.1.50; edebug-eval-defun errors on dotted pair in some macros reassign 6415 emacs submitter 6415 Geoff Gole severity 6415 normal tag 6415 confirmed patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 13 14:05:08 2010 Received: (at submit) by debbugs.gnu.org; 13 Jun 2010 18:05:08 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONrYR-0006dq-K3 for submit@debbugs.gnu.org; Sun, 13 Jun 2010 14:05:08 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONpMm-0005ay-Qs for submit@debbugs.gnu.org; Sun, 13 Jun 2010 11:44:57 -0400 Received: from mx10.gnu.org ([199.232.76.166]:59499) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONpMh-00005B-GH for emacs-pretest-bug@gnu.org; Sun, 13 Jun 2010 11:44:52 -0400 Received: from eggs.gnu.org ([140.186.70.92]:50938) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ONp4d-0004LR-7Q for emacs-pretest-bug@gnu.org; Sun, 13 Jun 2010 11:26:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ONp4b-00047C-GZ for emacs-pretest-bug@gnu.org; Sun, 13 Jun 2010 11:26:10 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received: from mail-gw0-f41.google.com ([74.125.83.41]:37048) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONp4b-000478-EN for emacs-pretest-bug@gnu.org; Sun, 13 Jun 2010 11:26:09 -0400 Received: by gwaa18 with SMTP id a18so1680675gwa.0 for ; Sun, 13 Jun 2010 08:26:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=xcHBp+X4Og3Q7Zz3V/qo1euuuaikz/B5AfwtHjlrJyo=; b=Qc1RU70QvucvLhh/67h5shyJ4T9sqGK6qukg3YjB470VdWVQQM4n9ljftvwaK0og3w kDZ9Gd86Phnxx495BwK9wNZ5vYPN/XL6BfTtajbtTxnTKLlTh8c0MOEpJdRKHMmrHiRd 6gVa2L3lb7vB+l90e1m5FA2IOXYTVulhElzlc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=t00I0mfa5MwEzY6KxRDq19VUrlsNXuRK27rPJ4YkB8pnK6cL/q2+3nTy4m4mOCFrph 1Wp0Fb6W4I8KJ2tXQTm5jfj/iOTURlMhybTTSFV+JoWcGWvcQXhhMR1Y/CysJW6SqW6N W7dZ8KX4/80sArjXXJA5dhDXq0Bh7y28JotcY= MIME-Version: 1.0 Received: by 10.229.250.149 with SMTP id mo21mr1752045qcb.250.1276442767614; Sun, 13 Jun 2010 08:26:07 -0700 (PDT) Received: by 10.229.246.206 with HTTP; Sun, 13 Jun 2010 08:26:07 -0700 (PDT) Date: Sun, 13 Jun 2010 23:26:07 +0800 Message-ID: Subject: 23.1.50; edebug-eval-defun errors on dotted pair in some macros From: Geoff Gole To: emacs-pretest-bug@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 13 Jun 2010 14:05:06 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) When presented with a reasonable defun form containing an unevaluated dotted pair, edebug-eval-defun fails with Invalid read syntax: "Dotted spec required." I *think* that this is an error in the cl.el debug specs and not edebug itself. Unfortunately that's hard to verify by stepping edebug.el as said debug specs are largely incomprehensible. To reproduce: emacs -Q insert (defun bug () (destructuring-bind (x . y))) C-u C-M-x GNU Emacs 23.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.12.11) of 2009-07-30 From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 14:55:44 2010 Received: (at control) by debbugs.gnu.org; 5 Jul 2010 18:55:44 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVqpT-0005Wq-QT for submit@debbugs.gnu.org; Mon, 05 Jul 2010 14:55:44 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVqpR-0005Wf-S4 for control@debbugs.gnu.org; Mon, 05 Jul 2010 14:55:42 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1OVqpM-00018p-Dx; Mon, 05 Jul 2010 14:55:36 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19506.10920.237370.293945@fencepost.gnu.org> Date: Mon, 5 Jul 2010 14:55:36 -0400 From: Glenn Morris To: control Subject: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: blue X-Ran: _^D6`.n*"473<~z9_k3zcNT.&VUqg,L><1-C5CI?qj_;N+j(RUDNjCCbX]+_?U20tB^rc] X-Debbugs-No-Ack: yes X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) merge 6415 6566 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 21 16:38:59 2011 Received: (at control) by debbugs.gnu.org; 21 Sep 2011 20:38:59 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R6TZJ-0006nj-Js for submit@debbugs.gnu.org; Wed, 21 Sep 2011 16:38:59 -0400 Received: from hermes.netfonds.no ([80.91.224.195]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R6TZA-0006nQ-Fn for control@debbugs.gnu.org; Wed, 21 Sep 2011 16:38:50 -0400 Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=stories.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1R6TYn-0006D0-Ny for control@debbugs.gnu.org; Wed, 21 Sep 2011 22:38:25 +0200 Date: Wed, 21 Sep 2011 22:34:59 +0200 Message-Id: To: control@debbugs.gnu.org From: Lars Magne Ingebrigtsen Subject: control message for bug #6415 X-MailScanner-ID: 1R6TYn-0006D0-Ny X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1317242305.93281@bJWJkwMaWSrCocSiSeKUlQ X-Spam-Status: No X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) tags 6415 confirmed From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 21 16:43:07 2011 Received: (at 6415) by debbugs.gnu.org; 21 Sep 2011 20:43:08 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R6TdK-0006w5-L6 for submit@debbugs.gnu.org; Wed, 21 Sep 2011 16:43:07 -0400 Received: from hermes.netfonds.no ([80.91.224.195]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R6TdF-0006vN-LP for 6415@debbugs.gnu.org; Wed, 21 Sep 2011 16:43:04 -0400 Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=stories.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1R6Tcs-0006JV-KD; Wed, 21 Sep 2011 22:42:38 +0200 From: Lars Magne Ingebrigtsen To: Leo Subject: Re: 23.2; error: (invalid-read-syntax "Dotted spec required.") In-Reply-To: (Leo's message of "Mon, 05 Jul 2010 13:52:17 +0100") Date: Wed, 21 Sep 2011 22:34:57 +0200 Message-ID: References: User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) X-Now-Playing: Oneohtrix Point Never's _Returnal_: "Describing Bodies" MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1R6Tcs-0006JV-KD X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1317242558.68801@H15tWjWAtid7QYR6HJeCJA X-Spam-Status: No X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 6415 Cc: 6415@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Leo writes: > C-u C-M-x to edebug the following example function > > (defun test () > (destructuring-bind (beg . end) > '(1 . 2))) > > Should see a backtrace as attached to the end of this report. > > In GNU Emacs 23.2.9 of 2010-06-26 on Victoria.local > > Debugger entered--Lisp error: (invalid-read-syntax "Dotted spec required.") I can confirm that this bug is still present in Emacs 24. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/ From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 26 13:24:19 2011 Received: (at submit) by debbugs.gnu.org; 26 Sep 2011 17:24:19 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R8Eug-0000Jm-7i for submit@debbugs.gnu.org; Mon, 26 Sep 2011 13:24:19 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R8EpJ-0000Bk-Kw for submit@debbugs.gnu.org; Mon, 26 Sep 2011 13:18:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8EoZ-0001br-MA for submit@debbugs.gnu.org; Mon, 26 Sep 2011 13:18:00 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:33302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8EoZ-0001bn-KX for submit@debbugs.gnu.org; Mon, 26 Sep 2011 13:17:59 -0400 Received: from eggs.gnu.org ([140.186.70.92]:39449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8EoY-0002hE-De for bug-gnu-emacs@gnu.org; Mon, 26 Sep 2011 13:17:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8EoW-0001bK-Ea for bug-gnu-emacs@gnu.org; Mon, 26 Sep 2011 13:17:58 -0400 Received: from smtp-out.google.com ([74.125.121.67]:48486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8EoW-0001b6-30 for bug-gnu-emacs@gnu.org; Mon, 26 Sep 2011 13:17:56 -0400 Received: from hpaq11.eem.corp.google.com (hpaq11.eem.corp.google.com [172.25.149.11]) by smtp-out.google.com with ESMTP id p8QHHsmx008409 for ; Mon, 26 Sep 2011 10:17:54 -0700 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1317057474; bh=CmxAahY8Zn8GGjJ1ebHUC0xfehM=; h=MIME-Version:Date:Message-ID:Subject:From:To:Content-Type; b=Rl+V8P0RF+LzmktnEWd7lblifywMCrlY3obMsVMok5tGuBDP02AhrL2617cqpBIFP wv/VYfim1/3IlFz0uYTUQ== DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=dkim-signature:mime-version:date:message-id:subject:from:to: content-type:x-system-of-record; b=qselpFresaSO8l/8NhZ6op6YLNUUnmgQqYHMCdhbuntGc8T//9H5vu8KZTQlhLh3k cXLvr+oZP/YYdDfj8VCBQ== Received: from yia13 (yia13.prod.google.com [10.243.65.13]) by hpaq11.eem.corp.google.com with ESMTP id p8QHEECP007192 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 26 Sep 2011 10:17:53 -0700 Received: by yia13 with SMTP id 13so5699016yia.13 for ; Mon, 26 Sep 2011 10:17:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=mime-version:date:message-id:subject:from:to:content-type; bh=VL+4WVaHGxVZ8/V8axrxfnMGTVzzuJ5AkvBDc7RJNx4=; b=HGKVsgmPYAcZgJp+vg8IwkMAbU2nGL0kTVwQ09j8THfFLRvhDAKc6nFl9Ap7jvEH8t aGYEK0LhK4lS7FjAbujg== Received: by 10.150.244.7 with SMTP id r7mr6733855ybh.390.1317057473127; Mon, 26 Sep 2011 10:17:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.244.7 with SMTP id r7mr6733848ybh.390.1317057472829; Mon, 26 Sep 2011 10:17:52 -0700 (PDT) Received: by 10.151.43.13 with HTTP; Mon, 26 Sep 2011 10:17:52 -0700 (PDT) Date: Mon, 26 Sep 2011 10:17:52 -0700 Message-ID: Subject: bug#6415: [PATCH] fix edebug instrumentation of dotted pairs in macros From: Steve Yegge To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=000e0cd28a08d11a9204addb563a X-System-Of-Record: true X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 26 Sep 2011 13:24:17 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) --000e0cd28a08d11a9204addb563a Content-Type: text/plain; charset=ISO-8859-1 ** Description There were two separate problems conspiring to create this bug. First, the edebug spec for `destructuring-bind' is incorrect. Its definition has three violations of the CL hyperspec for destructuring lambda lists: - it should not support the &environment keyword - it should support the &whole keyword - it should support dotted forms It so happens that the `cl-macro-list1' edebug-spec does all three of these things properly. The second problem is in edebug. The unification algorithm has improper or missing handling for dotted pairs in specs. I chose to add the handling to `edebug-match-specs' since it seemed to be the cleanest place to insert it. ** ChangeLog 2011-09-26 Steve Yegge * emacs-lisp/cl-specs.el: Fixed edebug-spec for `destructuring-bind' to allow dotted pairs in the destructuring lambda list. (Bug#6415) * emacs-lisp/edebug.el: Fixed edebug instrumentation of dotted pairs in edebug specifications for macros. (Bug#6415) ** The patch itself === modified file 'lisp/emacs-lisp/cl-specs.el' --- lisp/emacs-lisp/cl-specs.el 2011-02-11 03:54:12 +0000 +++ lisp/emacs-lisp/cl-specs.el 2011-09-26 16:37:19 +0000 @@ -90,7 +90,7 @@ ((&rest (symbol sexp)) cl-declarations body)) (def-edebug-spec destructuring-bind - (&define cl-macro-list def-form cl-declarations def-body)) + (&define cl-macro-list1 def-form cl-declarations def-body)) ;; Setf === modified file 'lisp/emacs-lisp/edebug.el' --- lisp/emacs-lisp/edebug.el 2011-08-21 17:43:31 +0000 +++ lisp/emacs-lisp/edebug.el 2011-09-26 16:44:39 +0000 @@ -1567,8 +1567,28 @@ (let ((edebug-dotted-spec t));; Containing spec list was dotted. (edebug-match-specs cursor (list specs) remainder-handler))) - ;; Is the form dotted? - ((not (listp (edebug-cursor-expressions cursor)));; allow nil + ;; Special handling for the tail of a dotted form. + ((and + ;; Is the cursor on the tail of a dotted form? + (not (listp (edebug-cursor-expressions cursor)));; allow nil + ;; When matching a dotted form such as (a b . c) against a + ;; spec list that looks like + ;; ([&rest ...] [&optional ...]+ . [&or arg nil]) + ;; ,e.g., the `cl-macro-list1' edebug-spec, then the &rest spec + ;; will consume everything up to the dotted tail (`c' in this + ;; example). At that point the spec list will look like so: + ;; ([&optional ...]+ . [&or arg nil]) + ;; We need to be able to consume zero or more [&optional ...] + ;; spec(s) without moving the cursor or signaling an error. + ;; The current continuation provides no state that tells us + ;; about the upcoming &optional specs, so we use lookahead: + + ;; Recurse normally if we're about to process an optional spec. + (not (eq (car specs) '&optional)) + ;; Recurse normally if the spec is a dotted list. + (not (and (listp specs) + (not (listp (cdr (last specs))))))) + ;; Otherwise we need to be on the tail of a dotted spec. (if (not edebug-dotted-spec) (edebug-no-match cursor "Dotted spec required.")) ;; Cancel dotted spec and dotted form. --000e0cd28a08d11a9204addb563a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
** Description

There were two separate proble= ms conspiring to create this bug.

First, the edebu= g spec for `destructuring-bind' is incorrect.
Its definition = has three violations of the CL hyperspec for
destructuring lambda lists:

=A0 - it should n= ot support the &environment keyword
=A0 - it should support t= he &whole keyword
=A0 - it should support dotted forms
<= div>
It so happens that the `cl-macro-list1' edebug-spec does= all three
of these things properly.

The= second problem is in edebug. =A0The unification algorithm has
improper or missing handling for dotted pairs in specs. =A0I chose
to add the handling to `edebug-match-specs' since it seemed to be
the cleanest place to insert it.

** ChangeL= og

2011-09-26 =A0Steve Yegge =A0<stevey@google.com>

* emacs-lisp/cl-spe= cs.el: Fixed edebug-spec for
`dest= ructuring-bind' to allow dotted pairs in the
destructuring lambda list.= =A0(Bug#6415)

* emacs-lisp/edebug.el: Fixed edebug instrumentation of
dotted pa= irs in edebug specifications for macros. =A0(Bug#6415)

** The patch itself

=3D=3D=3D = modified file 'lisp/emacs-lisp/cl-specs.el'
--- lisp/emac= s-lisp/cl-specs.el= 2011-02-11 03:54:12 +0000
+++ lisp/emacs-lisp/cl-specs.el 2011-09-26 16:37:19 +0000
@@ -90,7 +90,= 7 @@
=A0 =A0((&rest (symbol sexp)) cl-declarations body))
=A0
=A0(def-edebug-spec destructuring-bind
- =A0(&d= efine cl-macro-list def-form cl-declarations def-body))
+ =A0(&am= p;define cl-macro-list1 def-form cl-declarations def-body))
=A0
=A0;; Setf
=A0

=3D=3D=3D modified file &= #39;lisp/emacs-lisp/edebug.el'
--- lisp/emacs-lisp/edebug.el<= span class=3D"Apple-tab-span" style=3D"white-space:pre"> 2011-08-21 = 17:43:31 +0000
+++ lisp/emacs-lisp/edebug.el 2011-09-26 16:44:39 +0000
@@ -1567,8 +156= 7,28 @@
=A0 =A0 =A0 =A0(let ((edebug-dotted-spec t));; Containing= spec list was dotted.
=A0 (e= debug-match-specs cursor (list specs) remainder-handler)))
=A0
- =A0 =A0 ;; Is the form dotted?
- =A0 =A0 ((not (listp (= edebug-cursor-expressions cursor)));; allow nil
+ =A0 =A0 ;; Special handling for the tail of a dotted form.
+ =A0 =A0 ((and
+ =A0 =A0 =A0 ;; Is the cursor on the tail of a = dotted form?
+ =A0 =A0 =A0 (not (listp (edebug-cursor-expressions= cursor)));; allow nil
+ =A0 =A0 =A0 ;; When matching a dotted form such as (a b . c) against= a
+ =A0 =A0 =A0 ;; spec list that looks like
+ =A0 =A0= =A0 ;; =A0 =A0 ([&rest ...] [&optional ...]+ . [&or arg nil])<= /div>
+ =A0 =A0 =A0 ;; ,e.g., the `cl-macro-list1' edebug-spec, the= n the &rest spec
+ =A0 =A0 =A0 ;; will consume everything up to the dotted tail (`c'= ; in this
+ =A0 =A0 =A0 ;; example). =A0At that point the spec li= st will look like so:
+ =A0 =A0 =A0 ;; =A0 =A0 ([&optional ..= .]+ . [&or arg nil])
+ =A0 =A0 =A0 ;; We need to be able to consume zero or more [&opti= onal ...]
+ =A0 =A0 =A0 ;; spec(s) without moving the cursor or s= ignaling an error.
+ =A0 =A0 =A0 ;; The current continuation prov= ides no state that tells us
+ =A0 =A0 =A0 ;; about the upcoming &optional specs, so we use loo= kahead:
+
+ =A0 =A0 =A0 ;; Recurse normally if we'r= e about to process an optional spec.
+ =A0 =A0 =A0 (not (eq (car = specs) '&optional))
+ =A0 =A0 =A0 ;; Recurse normally if the spec is a dotted list.
<= div>+ =A0 =A0 =A0 (not (and (listp specs)
+ =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 (not (listp (cdr (last specs)))))))
+ =A0 =A0 =A0;; O= therwise we need to be on the tail of a dotted spec.
=A0 =A0 =A0 =A0(if (not edebug-dotted-spec)
=A0 =A0(edebug-no-match = cursor "Dotted spec required."))
=A0 =A0 =A0 =A0;; Canc= el dotted spec and dotted form.

--000e0cd28a08d11a9204addb563a-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 26 21:44:38 2011 Received: (at 6415) by debbugs.gnu.org; 27 Sep 2011 01:44:38 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R8Mir-0007CZ-I6 for submit@debbugs.gnu.org; Mon, 26 Sep 2011 21:44:37 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R8Mio-0007CS-LX for 6415@debbugs.gnu.org; Mon, 26 Sep 2011 21:44:35 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAJkpgU5FpZLc/2dsb2JhbABCp295gVMBAQQBViMFCws0EhQYDSSIC7oRhwsEoF6EQw X-IronPort-AV: E=Sophos;i="4.68,447,1312171200"; d="scan'208";a="138652641" Received: from 69-165-146-220.dsl.teksavvy.com (HELO ceviche.home) ([69.165.146.220]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 26 Sep 2011 21:43:47 -0400 Received: by ceviche.home (Postfix, from userid 20848) id E40E7660B6; Mon, 26 Sep 2011 21:43:46 -0400 (EDT) From: Stefan Monnier To: Steve Yegge Subject: Re: bug#6415: [PATCH] fix edebug instrumentation of dotted pairs in macros Message-ID: References: Date: Mon, 26 Sep 2011 21:43:46 -0400 In-Reply-To: (Steve Yegge's message of "Mon, 26 Sep 2011 10:17:52 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 6415 Cc: 6415@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) > It so happens that the `cl-macro-list1' edebug-spec does all three > of these things properly. I haven't looked into it, so I'll trust on that one. > The second problem is in edebug. The unification algorithm has > improper or missing handling for dotted pairs in specs. I chose > to add the handling to `edebug-match-specs' since it seemed to be > the cleanest place to insert it. This edebug-dotted-spec business is really ugly, I wonder if/how we could just get rid of this variable. Or at least document clearly what it is supposed to mean. > - ;; Is the form dotted? > - ((not (listp (edebug-cursor-expressions cursor)));; allow nil > + ;; Special handling for the tail of a dotted form. > + ((and > + ;; Is the cursor on the tail of a dotted form? > + (not (listp (edebug-cursor-expressions cursor)));; allow nil > + ;; When matching a dotted form such as (a b . c) against a > + ;; spec list that looks like > + ;; ([&rest ...] [&optional ...]+ . [&or arg nil]) > + ;; ,e.g., the `cl-macro-list1' edebug-spec, then the &rest spec > + ;; will consume everything up to the dotted tail (`c' in this > + ;; example). At that point the spec list will look like so: > + ;; ([&optional ...]+ . [&or arg nil]) > + ;; We need to be able to consume zero or more [&optional ...] > + ;; spec(s) without moving the cursor or signaling an error. > + ;; The current continuation provides no state that tells us > + ;; about the upcoming &optional specs, so we use lookahead: > + > + ;; Recurse normally if we're about to process an optional spec. > + (not (eq (car specs) '&optional)) > + ;; Recurse normally if the spec is a dotted list. > + (not (and (listp specs) > + (not (listp (cdr (last specs))))))) > + ;; Otherwise we need to be on the tail of a dotted spec. > (if (not edebug-dotted-spec) > (edebug-no-match cursor "Dotted spec required.")) > ;; Cancel dotted spec and dotted form. Questions: - Should it really only be &optional? it looks like any &foo might work just as well. Also shouldn't we check the (eq (aref (car specs) 0) '&optional) instead? - What's the purpose of the (not (and (listp specs) (not (listp (cdr (last specs))))))? For one (listp specs) will always be t (we've checked (atom specs) earlier and we've just called (car specs) on the previous line) so the code is really (not (and t (not (listp (cdr (last specs)))))) aka (listp (cdr (last specs))) but if the car of specs is not an &optional, then we have a mismatch anyway, no? Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 11 17:38:57 2013 Received: (at control) by debbugs.gnu.org; 11 Oct 2013 21:38:57 +0000 Received: from localhost ([127.0.0.1]:43697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VUkQD-0008Kq-Eh for submit@debbugs.gnu.org; Fri, 11 Oct 2013 17:38:57 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:58679) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VUkQB-0008Ki-4u for control@debbugs.gnu.org; Fri, 11 Oct 2013 17:38:55 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1VUkQA-0001BQ-IR for control@debbugs.gnu.org; Fri, 11 Oct 2013 17:38:54 -0400 Date: Fri, 11 Oct 2013 17:38:54 -0400 Message-Id: Subject: control message for bug 15587 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -5.2 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.2 (-----) merge 6415 15587 From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 18 22:56:29 2017 Received: (at control) by debbugs.gnu.org; 19 Apr 2017 02:56:29 +0000 Received: from localhost ([127.0.0.1]:55381 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0fnB-0004AK-6k for submit@debbugs.gnu.org; Tue, 18 Apr 2017 22:56:29 -0400 Received: from mail-it0-f41.google.com ([209.85.214.41]:37966) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0fn9-0004A4-U3 for control@debbugs.gnu.org; Tue, 18 Apr 2017 22:56:28 -0400 Received: by mail-it0-f41.google.com with SMTP id e132so5683159ite.1 for ; Tue, 18 Apr 2017 19:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version; bh=atIvAsOAci2XNl0lMrdxjMAWOMewOc2/skrYwo1y9DQ=; b=HzrAJUb6hItL8skYc8X8eLAF25GJCzlXdAswWBV6rqexQAk3qPmz/absjXxqnWIntD q/JfV9mrV02IIXhw36eEq1RfsxByDF2wi/KsqtYHCPf2p3diwV2LvLi4/0iZ5Oexge9Q O9E3RUimPQwL9OxsyIBGo8QRwCJvgcfi5zQmnepGYuI9prFNWkckdYnVXfTmuLvaB+Zx UpRm0k04w3fCcNRRxVjPghAgXJzaIvjUyFnvNIfKYP+ge/rZ3feoOxGPYzlmshxOahRc l0zjqjU0sactVEd8ui+uv/b4LBoZf0QS1PTmplQcNoBptcP7bgKbwx/2kJ2JnsxXwz1D /yWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version; bh=atIvAsOAci2XNl0lMrdxjMAWOMewOc2/skrYwo1y9DQ=; b=IeRpIcP8dDuepe3qR+rCyBCShHy0kHSqvC1AHEplQc9wihCQGIpCmk0PeeCvk+8TBO R91hd5aoBGZqNT+gSJlWmeTM0bP3fvRdBYefc3DxV2765iOjZvwjMpBLIAtkWzLHJNrP ftABCKlw4Jv+zfrf8ty8pf9ffGFqCsHuGntXbhTPBeeblKOAJ30hw8Mkdaq7jEI4XIki 05trsFiZtTdDmkhyoy5KhFo8o1YyD+UCsevk185DjAeFpKbFpvsQkD/SI22BFLr6KURO baGsNMSrqI0rc/OhDuD8S3o10ZGyvV1GIOQpdRP+hlazuEvNLfpnTMLoTKAb5e/qcBin TdtQ== X-Gm-Message-State: AN3rC/5bD99LUagWc0/WzVMmpA7HolwFJ6xf+LrEucIMdxLW837RcUD0 5C0OWRAMXqB6jC9M X-Received: by 10.36.39.201 with SMTP id g192mr18044504ita.74.1492570582086; Tue, 18 Apr 2017 19:56:22 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id 204sm755650itz.29.2017.04.18.19.56.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Apr 2017 19:56:21 -0700 (PDT) From: npostavs@users.sourceforge.net To: control@debbugs.gnu.org Subject: control message for bug #24885 Date: Tue, 18 Apr 2017 22:57:50 -0400 Message-ID: <8760i1rtn5.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: control 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.7 (/) merge 24885 6415 quit From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 16:45:40 2017 Received: (at 6415) by debbugs.gnu.org; 5 Nov 2017 21:45:40 +0000 Received: from localhost ([127.0.0.1]:52736 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBSjb-0003WO-LR for submit@debbugs.gnu.org; Sun, 05 Nov 2017 16:45:40 -0500 Received: from aibo.runbox.com ([91.220.196.211]:52130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBSjZ-0003WF-EM for 6415@debbugs.gnu.org; Sun, 05 Nov 2017 16:45:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=rbselector1; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From; bh=RDlC3qQcPD3bErWC4CIZP9b26nvCxb2UQPXvsha3qQ4=; b=TjZMzSPpVkU4hKtyRXV5SqsYzT 2cLXxk/UXZIMp5bJMY4DTC9aKTnUW33bjtjotUPUK+qo3ph9HvljexgckdDKQpLH9qAyFqk7TXgL0 4gUN1evghoAnipH7n+qBCrrW60SjOKX4OH8LHpxMsCAHo9CEQ45ANEwyKDyANte6lNN99dGGMHOpu nmu4IgL2Kef3KN8RFFiBrQu7cPkSy43VKjiqpLxUz+kn9LWLUg21Q8xxJuACJPrQSgInJMSDlsKrs 6axBvCgV9sijM2Q9qUm6F/pX5azHLq8Nng/BAwRtU/1eiGAS18xcEy014u15VyL4Z03uxlXymQQae kS4F0byA==; Received: from [10.9.9.212] (helo=mailfront12.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1eBSjS-0001dX-T7; Sun, 05 Nov 2017 22:45:30 +0100 Received: from c-24-22-244-161.hsd1.wa.comcast.net ([24.22.244.161] helo=chinook) by mailfront12.runbox.com with esmtpsa (uid:179284 ) (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1eBSjN-00052U-8a; Sun, 05 Nov 2017 22:45:25 +0100 From: Gemini Lasswell To: Stefan Monnier Subject: Re: bug#6415: [PATCH] fix edebug instrumentation of dotted pairs in macros References: Date: Sun, 05 Nov 2017 13:45:21 -0800 In-Reply-To: (Stefan Monnier's message of "Mon, 26 Sep 2011 21:43:46 -0400") Message-ID: <87tvy8h026.fsf@runbox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 6415 Cc: 6415@debbugs.gnu.org, Steve Yegge 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.7 (/) --=-=-= Content-Type: text/plain Here's a new patch for this bug, based on the ideas in Steve's patch. It also allows &rest and specs wrapped in vectors to attempt to match before a dotted tail. --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0001-Fix-Edebug-s-handling-of-dotted-specs-bug-6415.patch >From e6120334f29d97a026a3a2b2892d71ad73be0225 Mon Sep 17 00:00:00 2001 From: Gemini Lasswell Date: Wed, 1 Nov 2017 21:13:02 -0700 Subject: [PATCH] Fix Edebug's handling of dotted specs (bug#6415) * lisp/emacs-lisp/cl-macs.el (cl-destructuring-bind): Use cl-macro-list1 instead of cl-macro-list in Edebug spec. * lisp/emacs-lisp/edebug.el (edebug-after-dotted-spec): Delete unused variable. (edebug-dotted-spec): Add docstring. (edebug-match-specs): Allow &optional and &rest specs to match nothing at the tail of a dotted form. Handle matches of dotted form tails which return non-lists. * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-dotted-forms): New test. * test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el: (edebug-test-code-use-destructuring-bind): New function. --- lisp/emacs-lisp/cl-macs.el | 2 +- lisp/emacs-lisp/edebug.el | 67 +++++++++++++--------- .../edebug-resources/edebug-test-code.el | 4 ++ test/lisp/emacs-lisp/edebug-tests.el | 14 +++++ 4 files changed, 58 insertions(+), 29 deletions(-) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index e313af2497..5535100d4a 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -684,7 +684,7 @@ cl--arglist-args (defmacro cl-destructuring-bind (args expr &rest body) "Bind the variables in ARGS to the result of EXPR and execute BODY." (declare (indent 2) - (debug (&define cl-macro-list def-form cl-declarations def-body))) + (debug (&define cl-macro-list1 def-form cl-declarations def-body))) (let* ((cl--bind-lets nil) (cl--bind-forms nil) (cl--bind-defs nil) (cl--bind-block 'cl-none) (cl--bind-enquote nil)) (cl--do-arglist (or args '(&aux)) expr) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 0e8f77e29a..dec986ae3e 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -950,7 +950,8 @@ edebug-read-vector ;;; Cursors for traversal of list and vector elements with offsets. -(defvar edebug-dotted-spec nil) +(defvar edebug-dotted-spec nil + "Set to t when matching after the dot in a dotted spec list.") (defun edebug-new-cursor (expressions offsets) ;; Return a new cursor for EXPRESSIONS with OFFSETS. @@ -1526,8 +1527,6 @@ edebug-list-form ;;; Matching of specs. -(defvar edebug-after-dotted-spec nil) - (defvar edebug-matching-depth 0) ;; initial value @@ -1588,36 +1587,48 @@ edebug-match-specs (let ((edebug-dotted-spec t));; Containing spec list was dotted. (edebug-match-specs cursor (list specs) remainder-handler))) - ;; Is the form dotted? - ((not (listp (edebug-cursor-expressions cursor)));; allow nil + ;; The reason for processing here &optional, &rest, and vectors + ;; which might contain them even when the form is dotted is to + ;; allow them to match nothing, so we can advance to the dotted + ;; part of the spec. + ((or (listp (edebug-cursor-expressions cursor)) + (vectorp (car specs)) + (memq (car specs) '(&optional &rest))) ; Process normally. + ;; (message "%scursor=%s specs=%s" + ;; (make-string edebug-matching-depth ?|) cursor (car specs)) + (let* ((spec (car specs)) + (rest) + (first-char (and (symbolp spec) (aref (symbol-name spec) 0))) + (match (cond + ((eq ?& first-char);; "&" symbols take all following specs. + (funcall (get-edebug-spec spec) cursor (cdr specs))) + ((eq ?: first-char);; ":" symbols take one following spec. + (setq rest (cdr (cdr specs))) + (funcall (get-edebug-spec spec) cursor (car (cdr specs)))) + (t;; Any other normal spec. + (setq rest (cdr specs)) + (edebug-match-one-spec cursor spec))))) + ;; The first match result may not be a list, which can happen + ;; when matching the tail of a dotted list. In that case + ;; there is no remainder. + (if (listp match) + (nconc match + (funcall remainder-handler cursor rest remainder-handler)) + match))) + + ;; Must be a dotted form, with no remaining &rest or &optional specs to + ;; match. + (t (if (not edebug-dotted-spec) (edebug-no-match cursor "Dotted spec required.")) ;; Cancel dotted spec and dotted form. (let ((edebug-dotted-spec) - (this-form (edebug-cursor-expressions cursor)) - (this-offset (edebug-cursor-offsets cursor))) - ;; Wrap the form in a list, (by changing the cursor??)... + (this-form (edebug-cursor-expressions cursor)) + (this-offset (edebug-cursor-offsets cursor))) + ;; Wrap the form in a list, by changing the cursor. (edebug-set-cursor cursor (list this-form) this-offset) - ;; and process normally, then unwrap the result. - (car (edebug-match-specs cursor specs remainder-handler)))) - - (t;; Process normally. - (let* ((spec (car specs)) - (rest) - (first-char (and (symbolp spec) (aref (symbol-name spec) 0)))) - ;;(message "spec = %s first char = %s" spec first-char) (sit-for 1) - (nconc - (cond - ((eq ?& first-char);; "&" symbols take all following specs. - (funcall (get-edebug-spec spec) cursor (cdr specs))) - ((eq ?: first-char);; ":" symbols take one following spec. - (setq rest (cdr (cdr specs))) - (funcall (get-edebug-spec spec) cursor (car (cdr specs)))) - (t;; Any other normal spec. - (setq rest (cdr specs)) - (edebug-match-one-spec cursor spec))) - (funcall remainder-handler cursor rest remainder-handler))))))) - + ;; Process normally, then unwrap the result. + (car (edebug-match-specs cursor specs remainder-handler))))))) ;; Define specs for all the symbol specs with functions used to process them. ;; Perhaps we shouldn't be doing this with edebug-form-specs since the diff --git a/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el b/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el index f52a2b1896..ca49dcd213 100644 --- a/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el +++ b/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el @@ -126,5 +126,9 @@ edebug-test-code-current-buffer !start!(with-current-buffer (get-buffer-create "*edebug-test-code-buffer*") !body!(format "current-buffer: %s" (current-buffer)))) +(defun edebug-test-code-use-destructuring-bind () + (let ((two 2) (three 3)) + (cl-destructuring-bind (x . y) (cons two three) (+ x!x! y!y!)))) + (provide 'edebug-test-code) ;;; edebug-test-code.el ends here diff --git a/test/lisp/emacs-lisp/edebug-tests.el b/test/lisp/emacs-lisp/edebug-tests.el index 02f4d1c5ab..f6c016cdf8 100644 --- a/test/lisp/emacs-lisp/edebug-tests.el +++ b/test/lisp/emacs-lisp/edebug-tests.el @@ -899,5 +899,19 @@ edebug-tests-setup-code-file "@g" (should (equal edebug-tests-@-result '(#("abcd" 1 3 (face italic)) 511)))))) +(ert-deftest edebug-tests-dotted-forms () + "Edebug can instrument code matching the tail of a dotted spec (Bug#6415)." + (edebug-tests-with-normal-env + (edebug-tests-setup-@ "use-destructuring-bind" nil t) + (edebug-tests-run-kbd-macro + "@ SPC SPC SPC SPC SPC SPC" + (edebug-tests-should-be-at "use-destructuring-bind" "x") + (edebug-tests-should-match-result-in-messages "2 (#o2, #x2, ?\\C-b)") + "SPC" + (edebug-tests-should-be-at "use-destructuring-bind" "y") + (edebug-tests-should-match-result-in-messages "3 (#o3, #x3, ?\\C-c)") + "g" + (should (equal edebug-tests-@-result 5))))) + (provide 'edebug-tests) ;;; edebug-tests.el ends here -- 2.14.3 --=-=-= Content-Type: text/plain Stefan Monnier writes: > This edebug-dotted-spec business is really ugly, I wonder if/how we > could just get rid of this variable. Or at least document clearly what > it is supposed to mean. I agree. After far too many hours of looking at this, I think the way to get rid of the variable is to make Edebug's internal representation of its specs into a cl-defstruct so there is room for a "dotted" flag, and then change all the edebug match code so that whenever it makes a new spec or modifies the one it is working with, it inherits the dotted flag. I have a branch with this partially done and am confident that it will work and not cause a performance problem, but it seems like a lot of work and a lot of changes to stable code to make it work exactly the same. So I added a docstring. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 26 18:02:47 2017 Received: (at 6415-done) by debbugs.gnu.org; 26 Nov 2017 23:02:47 +0000 Received: from localhost ([127.0.0.1]:59743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJ5wl-0000Eo-Ed for submit@debbugs.gnu.org; Sun, 26 Nov 2017 18:02:47 -0500 Received: from aibo.runbox.com ([91.220.196.211]:59680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJ5wj-0000Ef-Ak for 6415-done@debbugs.gnu.org; Sun, 26 Nov 2017 18:02:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=rbselector1; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From; bh=JQw9No9Q6aAsGcDye3F4EbyzrgQ1B2wwWyHks4iXYAw=; b=MhSXCJHkjnl086kkdKZcAq9AOM pgTVyeCu9HTRfwJ1ffilfcExGZBPzCHRrM/c3d/jGhAtAWneXb3w6KFKMgGdIdWVQFvy+1ErT/mh0 mWDfh39/HR7BgdnGtvnLE3r1rUOTrLaYnwP066zqP9DFNH9i/Vcp1X+bJRkmEChgevd0rE22mdiqE NsVoi82Aalumn+yco6ihhnBY714/XJGRW/iz1fhw0cKwVPdAf2i5e6xniFUC8tTqwwfOXQ9tYPj7I MPgnc5COLumKgeHtbggoHE/fhvM5Yl6cYitxLNSRO5xYdhRoipkSkAZrK7HQVO72h/EfWmvFoBLli PhqBZBLw==; Received: from [10.9.9.212] (helo=mailfront12.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1eJ5wg-0000Ws-2c; Mon, 27 Nov 2017 00:02:42 +0100 Received: from c-24-22-244-161.hsd1.wa.comcast.net ([24.22.244.161] helo=chinook) by mailfront12.runbox.com with esmtpsa (uid:179284 ) (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1eJ5wT-0001GC-Sp; Mon, 27 Nov 2017 00:02:30 +0100 From: Gemini Lasswell To: Stefan Monnier Subject: Re: bug#6415: [PATCH] fix edebug instrumentation of dotted pairs in macros References: <87tvy8h026.fsf@runbox.com> Date: Sun, 26 Nov 2017 15:02:27 -0800 In-Reply-To: <87tvy8h026.fsf@runbox.com> (Gemini Lasswell's message of "Sun, 05 Nov 2017 13:45:21 -0800") Message-ID: <871skkr6d8.fsf@runbox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 6415-done Cc: 6415-done@debbugs.gnu.org, Steve Yegge 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.7 (/) Gemini Lasswell writes: > Here's a new patch for this bug, based on the ideas in Steve's patch. I've pushed this patch to emacs-26. From unknown Mon Jun 23 13:08:04 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 25 Dec 2017 12:24:04 +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