Subject: Re: bug#53068: 28.0.90; Emacs 28 regression: Can't edebug inline functions

From: Philipp Stephani <[email-masked]>
Date: Thu, 13 Jan 2022 12:57:34 +0100

Am Mi., 12. Jan. 2022 um 22:16 Uhr schrieb Philipp Stephani
<[email-masked]>:
>
> Am So., 9. Jan. 2022 um 21:49 Uhr schrieb Michael Heerdegen
> <[email-masked]>:
> >
> > Michael Heerdegen <[email-masked]> writes:
> >
> > > Philipp Stephani <[email-masked]> writes:
> > >
> > > > Visit the file lisp/json.el, navigate to the `json-advance' inline
> > > > function, and hit C-u C-M-x.  This fails [...]
> > >
> > > The culprit seems to be the edebug spec of `inline-quote' (that macro is
> > > called by `json-advance')
> >
> > Should the edebug-spec of `inline-quote' be (backquote-form) instead of
> > backquote-form?
>
> I guess so.

Any objections to installing the following patch on the emacs-28 branch?
From ec1ce1dbddd6196bbffdfb32d63d4bb1a13010ea Mon Sep 17 00:00:00 2001
From: Philipp Stephani <[email-masked]>
Date: Thu, 13 Jan 2022 12:55:06 +0100
Subject: [PATCH] Fix Edebug specification for inline functions (Bug#53068).

* lisp/emacs-lisp/inline.el (inline-quote): Fix Edebug specification.

* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-inline): New unit
test.
---
 lisp/emacs-lisp/inline.el            |  2 +-
 test/lisp/emacs-lisp/edebug-tests.el | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/inline.el b/lisp/emacs-lisp/inline.el
index 963e117ff3..de0112db63 100644
--- a/lisp/emacs-lisp/inline.el
+++ b/lisp/emacs-lisp/inline.el
@@ -71,7 +71,7 @@
 
 (defmacro inline-quote (_exp)
   "Similar to backquote, but quotes code and only accepts , and not ,@."
-  (declare (debug backquote-form))
+  (declare (debug (backquote-form)))
   (error "inline-quote can only be used within define-inline"))
 
 (defmacro inline-const-p (_exp)
diff --git a/test/lisp/emacs-lisp/edebug-tests.el b/test/lisp/emacs-lisp/edebug-tests.el
index 92f63ec788..4aae2870a3 100644
--- a/test/lisp/emacs-lisp/edebug-tests.el
+++ b/test/lisp/emacs-lisp/edebug-tests.el
@@ -1093,5 +1093,15 @@ edebug-tests-duplicate-&define
               (edebug-new-definition name))))
       (should-error (eval-buffer) :type 'invalid-read-syntax))))
 
+(ert-deftest edebug-tests-inline ()
+  "Check that Edebug can instrument inline functions (Bug#53068)."
+  (with-temp-buffer
+    (print '(define-inline edebug-tests-inline (arg)
+              (inline-quote ,arg))
+           (current-buffer))
+    (let ((edebug-all-defs t)
+          (edebug-initial-mode 'Go-nonstop))
+      (eval-buffer))))
+
 (provide 'edebug-tests)
 ;;; edebug-tests.el ends here
-- 
2.34.1.703.g22d0c6ccf7-goog