Subject: bug#24717: closed (Re: bug#24717: 26.0.50; invalid-read-syntax error using Edebug on lisp/emacs-lisp/pcase.el)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 04 Feb 2017 11:23:01 +0000

Your bug report

#24717: 26.0.50; invalid-read-syntax error using Edebug on lisp/emacs-lisp/pcase.el

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
24717: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24717
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#24717: 26.0.50; invalid-read-syntax error using Edebug on lisp/emacs-lisp/pcase.el
From: Eli Zaretskii <[email-masked]>
To: Gemini Lasswell <[email-masked]>
Cc: [email-masked]
Date: Sat, 04 Feb 2017 13:22:32 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Gemini Lasswell <[email-masked]>
> Date: Mon, 17 Oct 2016 08:44:58 -0700
> 
> To reproduce, start at the top of your Emacs source tree and:
> 1. emacs -Q
> 2. M-x edebug-all-defs RET
> 3. C-x C-f lisp/emacs-lisp/pcase.el
> 4. M-x eval-buffer RET
> 
> The reason this is happening is that in this line:
> 
> (def-edebug-spec pcase-MACRO pcase--edebug-match-macro)
> 
> pcase--edebug-match-macro does not have an Edebug specification, so the
> Edebug specification for def-edebug-spec fails to match.
> 
> But when you aren't trying to debug pcase.el and are instead trying to
> debug something that uses pcase, this Edebug specification works,
> because internally to Edebug when it is trying to match an Edebug
> specification, if it finds a symbol without a specification it assumes
> it is one of Edebug's match functions and calls it. This is how Edebug
> implements the behavior for the symbols used in Edebug specifications.
> And pcase--edebug-match-macro works like one of Edebug's match
> functions.
> 
> I think it's a rather poor idea for pcase.el to depend on internal
> implementation details of Edebug. But since it does, replacing the line
> of code above with:
> 
> (put 'pcase-MACRO 'edebug-form-spec 'pcase--edebug-match-macro)
> 
> would make it more obvious that it's using internal implementation
> details of Edebug, as well as fixing the syntax error.

Thanks, I've pushed such a change.

Subject: 26.0.50; invalid-read-syntax error using Edebug on lisp/emacs-lisp/pcase.el
From: Gemini Lasswell <[email-masked]>
To: [email-masked]
Date: Mon, 17 Oct 2016 08:44:58 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

To reproduce, start at the top of your Emacs source tree and:
1. emacs -Q
2. M-x edebug-all-defs RET
3. C-x C-f lisp/emacs-lisp/pcase.el
4. M-x eval-buffer RET

The reason this is happening is that in this line:

(def-edebug-spec pcase-MACRO pcase--edebug-match-macro)

pcase--edebug-match-macro does not have an Edebug specification, so the
Edebug specification for def-edebug-spec fails to match.

But when you aren't trying to debug pcase.el and are instead trying to
debug something that uses pcase, this Edebug specification works,
because internally to Edebug when it is trying to match an Edebug
specification, if it finds a symbol without a specification it assumes
it is one of Edebug's match functions and calls it. This is how Edebug
implements the behavior for the symbols used in Edebug specifications.
And pcase--edebug-match-macro works like one of Edebug's match
functions.

I think it's a rather poor idea for pcase.el to depend on internal
implementation details of Edebug. But since it does, replacing the line
of code above with:

(put 'pcase-MACRO 'edebug-form-spec 'pcase--edebug-match-macro)

would make it more obvious that it's using internal implementation
details of Edebug, as well as fixing the syntax error.