unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: acm@muc.de, 40766@debbugs.gnu.org
Subject: bug#40766: 27.0.91; Cannot edebug cl-lambda-list edebug spec
Date: 23 Apr 2020 06:41:28 -0000	[thread overview]
Message-ID: <20200423064128.95594.qmail@mail.muc.de> (raw)
In-Reply-To: <mailman.944.1587560406.3066.bug-gnu-emacs@gnu.org>

Hello, Philipp.

In article <mailman.944.1587560406.3066.bug-gnu-emacs@gnu.org> you wrote:

> emacs -Q
> M-x find-library RET cl-macs RET
> Navigate to the form `(def-edebug-spec cl-lambda-list ...)'
> Hit C-u C-M-x to edebug it.

> This results in an error with backtrace:

Yes, I get this too.  The debug-spec definition looks like this:

    (def-edebug-spec cl-lambda-list
      (([&rest cl-lambda-arg]
        [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]]
        [&optional ["&rest" cl-lambda-arg]]
        [&optional ["&key" [cl-&key-arg &rest cl-&key-arg]
                    &optional "&allow-other-keys"]]
        [&optional ["&aux" &rest
                    &or (symbolp &optional def-form) symbolp]]
        . [&or arg nil])))

After playing around with it for a few hours, it is clear that the
bug is triggered by a combination of (i) the dot on the last line; and
(ii) the presence of at least one [&optional ...] before it, at the same
level of nesting.  Possibly the nesting of [ ... ] structures might have
something to do with it.

The debug-spec which we are attempting to use to parse the above is that
of deb-edebug-spec itself.  Let's call this "spec 2".

There is a dynamically bound variable edebug-dotted-spec which gets bound
to t when the parser encounters a "dotted spec" in spec 2.  The criterion
for making this binding is that the current fragment of spec 2,
presumably the last cdr in a list is a non-nil atom.  A vector is also an
atom, and it might be that there is confusion about this in edebug.el.
I'm still working on it.

Just one other comment.  Doing C-u C-M-x on an edebug-spec doesn't seem
to lead to any entry into edebug, even when this bug doesn't trigger.

Thanks for an interesting bug!

> Debugger entered--Lisp error: (invalid-read-syntax "Expected one of" "nil" edebug-spec-p "t" "0" (&rest edebug-spec))
>   signal(invalid-read-syntax ("Expected one of" "nil" edebug-spec-p "t" "0" (&rest edebug-spec)))
>   edebug-syntax-error("Expected one of" "nil" edebug-spec-p "t" "0" (&rest edebug-spec))
>   apply(edebug-syntax-error ("Expected one of" "nil" edebug-spec-p "t" "0" (&rest edebug-spec)))
>   edebug-no-match((((([&rest cl-lambda-arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] [&optional ["&rest" cl-lambda-arg]] [&optional ["&key" [cl-&key-arg &rest cl-&key-arg] &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or (symbolp &optional def-form) symbolp]] . [&or arg nil]))) (6597 (6598 (6599 (6600 . 6605) (6606 . 6619) . 6620) (6625 (6626 . 6635) (6636 (6637 . 6648) (6649 . 6665) (6666 . 6671) (6672 . 6688) . 6689) . 6690) (6695 (6696 . 6705) (6706 (6707 . 6714) (6715 . 6728) . 6729) . 6730) (6735 (6736 . 6745) (6746 (6747 . 6753) (6754 (6755 . 6766) (6767 . 6772) (6773 . 6784) . 6785) (6788 . 6797) (6798 . 6817) . 6818) . 6819) (6824 (6825 . 6834) (6835 (6836 . 6842) (6843 . 6848) (6851 . 6854) (6855 (6856 . 6863) (6864 . 6873) (6874 . 6882) . 6883) (6884 . 6891) . 6892) . 6893) (6899 (6901 . 6904) (6905 . 6908) (6909 . 6912) . 6913) . 6914) . 6915) . 6916) "Expected one of" "nil" edebug-spec-p "t" "0" (&rest edebug-spec))
>   apply(edebug-no-match (((([&rest cl-lambda-arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] [&optional ["&rest" cl-lambda-arg]] [&optional ["&key" [cl-&key-arg &rest cl-&key-arg] &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or (symbolp &optional def-form) symbolp]] . [&or arg nil]))) (6597 (6598 (6599 (6600 . 6605) (6606 . 6619) . 6620) (6625 (6626 . 6635) (6636 (6637 . 6648) (6649 . 6665) (6666 . 6671) (6672 . 6688) . 6689) . 6690) (6695 (6696 . 6705) (6706 (6707 . 6714) (6715 . 6728) . 6729) . 6730) (6735 (6736 . 6745) (6746 (6747 . 6753) (6754 (6755 . 6766) (6767 . 6772) (6773 . 6784) . 6785) (6788 . 6797) (6798 . 6817) . 6818) . 6819) (6824 (6825 . 6834) (6835 (6836 . 6842) (6843 . 6848) (6851 . 6854) (6855 (6856 . 6863) (6864 . 6873) (6874 . 6882) . 6883) (6884 . 6891) . 6892) . 6893) (6899 (6901 . 6904) (6905 . 6908) (6909 . 6912) . 6913) . 6914) . 6915) . 6916) "Expected one of" ("nil" edebug-spec-p "t" "0" (&rest edebug-spec)))
>   edebug-match-&or((((([&rest cl-lambda-arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] [&optional ["&rest" cl-lambda-arg]] [&optional ["&key" [cl-&key-arg &rest cl-&key-arg] &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or (symbolp &optional def-form) symbolp]] . [&or arg nil]))) (6597 (6598 (6599 (6600 . 6605) (6606 . 6619) . 6620) (6625 (6626 . 6635) (6636 (6637 . 6648) (6649 . 6665) (6666 . 6671) (6672 . 6688) . 6689) . 6690) (6695 (6696 . 6705) (6706 (6707 . 6714) (6715 . 6728) . 6729) . 6730) (6735 (6736 . 6745) (6746 (6747 . 6753) (6754 (6755 . 6766) (6767 . 6772) (6773 . 6784) . 6785) (6788 . 6797) (6798 . 6817) . 6818) . 6819) (6824 (6825 . 6834) (6835 (6836 . 6842) (6843 . 6848) (6851 . 6854) (6855 (6856 . 6863) (6864 . 6873) (6874 . 6882) . 6883) (6884 . 6891) . 6892) . 6893) (6899 (6901 . 6904) (6905 . 6908) (6909 . 6912) . 6913) . 6914) . 6915) . 6916) ("nil" edebug-spec-p "t" "0" (&rest edebug-spec)))
>   edebug-match-specs((((([&rest cl-lambda-arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] [&optional ["&rest" cl-lambda-arg]] [&optional ["&key" [cl-&key-arg &rest cl-&key-arg] &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or (symbolp &optional def-form) symbolp]] . [&or arg nil]))) (6597 (6598 (6599 (6600 . 6605) (6606 . 6619) . 6620) (6625 (6626 . 6635) (6636 (6637 . 6648) (6649 . 6665) (6666 . 6671) (6672 . 6688) . 6689) . 6690) (6695 (6696 . 6705) (6706 (6707 . 6714) (6715 . 6728) . 6729) . 6730) (6735 (6736 . 6745) (6746 (6747 . 6753) (6754 (6755 . 6766) (6767 . 6772) (6773 . 6784) . 6785) (6788 . 6797) (6798 . 6817) . 6818) . 6819) (6824 (6825 . 6834) (6835 (6836 . 6842) (6843 . 6848) (6851 . 6854) (6855 (6856 . 6863) (6864 . 6873) (6874 . 6882) . 6883) (6884 . 6891) . 6892) . 6893) (6899 (6901 . 6904) (6905 . 6908) (6909 . 6912) . 6913) . 6914) . 6915) . 6916) (&or "nil" edebug-spec-p "t" "0" (&rest edebug-spec)) edebug-match-specs)
>   edebug-match-specs((((([&rest cl-lambda-arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] [&optional ["&rest" cl-lambda-arg]] [&optional ["&key" [cl-&key-arg &rest cl-&key-arg] &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or (symbolp &optional def-form) symbolp]] . [&or arg nil]))) (6597 (6598 (6599 (6600 . 6605) (6606 . 6619) . 6620) (6625 (6626 . 6635) (6636 (6637 . 6648) (6649 . 6665) (6666 . 6671) (6672 . 6688) . 6689) . 6690) (6695 (6696 . 6705) (6706 (6707 . 6714) (6715 . 6728) . 6729) . 6730) (6735 (6736 . 6745) (6746 (6747 . 6753) (6754 (6755 . 6766) (6767 . 6772) (6773 . 6784) . 6785) (6788 . 6797) (6798 . 6817) . 6818) . 6819) (6824 (6825 . 6834) (6835 (6836 . 6842) (6843 . 6848) (6851 . 6854) (6855 (6856 . 6863) (6864 . 6873) (6874 . 6882) . 6883) (6884 . 6891) . 6892) . 6893) (6899 (6901 . 6904) (6905 . 6908) (6909 . 6912) . 6913) . 6914) . 6915) . 6916) (name &or "nil" edebug-spec-p "t" "0" (&rest edebug-spec)) edebug-match-specs)
>   edebug-match-specs((((([&rest cl-lambda-arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] [&optional ["&rest" cl-lambda-arg]] [&optional ["&key" [cl-&key-arg &rest cl-&key-arg] &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or (symbolp &optional def-form) symbolp]] . [&or arg nil]))) (6597 (6598 (6599 (6600 . 6605) (6606 . 6619) . 6620) (6625 (6626 . 6635) (6636 (6637 . 6648) (6649 . 6665) (6666 . 6671) (6672 . 6688) . 6689) . 6690) (6695 (6696 . 6705) (6706 (6707 . 6714) (6715 . 6728) . 6729) . 6730) (6735 (6736 . 6745) (6746 (6747 . 6753) (6754 (6755 . 6766) (6767 . 6772) (6773 . 6784) . 6785) (6788 . 6797) (6798 . 6817) . 6818) . 6819) (6824 (6825 . 6834) (6835 (6836 . 6842) (6843 . 6848) (6851 . 6854) (6855 (6856 . 6863) (6864 . 6873) (6874 . 6882) . 6883) (6884 . 6891) . 6892) . 6893) (6899 (6901 . 6904) (6905 . 6908) (6909 . 6912) . 6913) . 6914) . 6915) . 6916) (:name edebug-spec name &or "nil" edebug-spec-p "t" "0" (&rest edebug-spec)) edebug-match-specs)
>   edebug-match-specs((((([&rest cl-lambda-arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] [&optional ["&rest" cl-lambda-arg]] [&optional ["&key" [cl-&key-arg &rest cl-&key-arg] &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or (symbolp &optional def-form) symbolp]] . [&or arg nil]))) (6597 (6598 (6599 (6600 . 6605) (6606 . 6619) . 6620) (6625 (6626 . 6635) (6636 (6637 . 6648) (6649 . 6665) (6666 . 6671) (6672 . 6688) . 6689) . 6690) (6695 (6696 . 6705) (6706 (6707 . 6714) (6715 . 6728) . 6729) . 6730) (6735 (6736 . 6745) (6746 (6747 . 6753) (6754 (6755 . 6766) (6767 . 6772) (6773 . 6784) . 6785) (6788 . 6797) (6798 . 6817) . 6818) . 6819) (6824 (6825 . 6834) (6835 (6836 . 6842) (6843 . 6848) (6851 . 6854) (6855 (6856 . 6863) (6864 . 6873) (6874 . 6882) . 6883) (6884 . 6891) . 6892) . 6893) (6899 (6901 . 6904) (6905 . 6908) (6909 . 6912) . 6913) . 6914) . 6915) . 6916) ("def-edebug-spec" :name edebug-spec name &or "nil" edebug-spec-p "t" "0" (&rest edebug-spec)) edebug-match-specs)
>   edebug-match-sublist((((([&rest cl-lambda-arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] [&optional ["&rest" cl-lambda-arg]] [&optional ["&key" [cl-&key-arg &rest cl-&key-arg] &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or (symbolp &optional def-form) symbolp]] . [&or arg nil]))) (6597 (6598 (6599 (6600 . 6605) (6606 . 6619) . 6620) (6625 (6626 . 6635) (6636 (6637 . 6648) (6649 . 6665) (6666 . 6671) (6672 . 6688) . 6689) . 6690) (6695 (6696 . 6705) (6706 (6707 . 6714) (6715 . 6728) . 6729) . 6730) (6735 (6736 . 6745) (6746 (6747 . 6753) (6754 (6755 . 6766) (6767 . 6772) (6773 . 6784) . 6785) (6788 . 6797) (6798 . 6817) . 6818) . 6819) (6824 (6825 . 6834) (6835 (6836 . 6842) (6843 . 6848) (6851 . 6854) (6855 (6856 . 6863) (6864 . 6873) (6874 . 6882) . 6883) (6884 . 6891) . 6892) . 6893) (6899 (6901 . 6904) (6905 . 6908) (6909 . 6912) . 6913) . 6914) . 6915) . 6916) ("def-edebug-spec" :name edebug-spec name &or "nil" edebug-spec-p "t" "0" (&rest edebug-spec)))
>   edebug-match-list((((def-edebug-spec cl-lambda-list (([&rest cl-lambda-arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] [&optional ["&rest" cl-lambda-arg]] [&optional ["&key" ... &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or ... symbolp]] . [&or arg nil])))) (6563 (6564 . 6579) (6580 . 6594) (6597 (6598 (6599 (6600 . 6605) (6606 . 6619) . 6620) (6625 (6626 . 6635) (6636 (6637 . 6648) (6649 . 6665) (6666 . 6671) (6672 . 6688) . 6689) . 6690) (6695 (6696 . 6705) (6706 (6707 . 6714) (6715 . 6728) . 6729) . 6730) (6735 (6736 . 6745) (6746 (6747 . 6753) (6754 ... ... ... . 6785) (6788 . 6797) (6798 . 6817) . 6818) . 6819) (6824 (6825 . 6834) (6835 (6836 . 6842) (6843 . 6848) (6851 . 6854) (6855 ... ... ... . 6883) (6884 . 6891) . 6892) . 6893) (6899 (6901 . 6904) (6905 . 6908) (6909 . 6912) . 6913) . 6914) . 6915) . 6916)) ("def-edebug-spec" :name edebug-spec name &or "nil" edebug-spec-p "t" "0" (&rest edebug-spec)))
>   edebug-match-one-spec((((def-edebug-spec cl-lambda-list (([&rest cl-lambda-arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] [&optional ["&rest" cl-lambda-arg]] [&optional ["&key" ... &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or ... symbolp]] . [&or arg nil])))) (6563 (6564 . 6579) (6580 . 6594) (6597 (6598 (6599 (6600 . 6605) (6606 . 6619) . 6620) (6625 (6626 . 6635) (6636 (6637 . 6648) (6649 . 6665) (6666 . 6671) (6672 . 6688) . 6689) . 6690) (6695 (6696 . 6705) (6706 (6707 . 6714) (6715 . 6728) . 6729) . 6730) (6735 (6736 . 6745) (6746 (6747 . 6753) (6754 ... ... ... . 6785) (6788 . 6797) (6798 . 6817) . 6818) . 6819) (6824 (6825 . 6834) (6835 (6836 . 6842) (6843 . 6848) (6851 . 6854) (6855 ... ... ... . 6883) (6884 . 6891) . 6892) . 6893) (6899 (6901 . 6904) (6905 . 6908) (6909 . 6912) . 6913) . 6914) . 6915) . 6916)) ("def-edebug-spec" :name edebug-spec name &or "nil" edebug-spec-p "t" "0" (&rest edebug-spec)))
>   edebug-match-specs((((def-edebug-spec cl-lambda-list (([&rest cl-lambda-arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] [&optional ["&rest" cl-lambda-arg]] [&optional ["&key" ... &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or ... symbolp]] . [&or arg nil])))) (6563 (6564 . 6579) (6580 . 6594) (6597 (6598 (6599 (6600 . 6605) (6606 . 6619) . 6620) (6625 (6626 . 6635) (6636 (6637 . 6648) (6649 . 6665) (6666 . 6671) (6672 . 6688) . 6689) . 6690) (6695 (6696 . 6705) (6706 (6707 . 6714) (6715 . 6728) . 6729) . 6730) (6735 (6736 . 6745) (6746 (6747 . 6753) (6754 ... ... ... . 6785) (6788 . 6797) (6798 . 6817) . 6818) . 6819) (6824 (6825 . 6834) (6835 (6836 . 6842) (6843 . 6848) (6851 . 6854) (6855 ... ... ... . 6883) (6884 . 6891) . 6892) . 6893) (6899 (6901 . 6904) (6905 . 6908) (6909 . 6912) . 6913) . 6914) . 6915) . 6916)) (("def-edebug-spec" :name edebug-spec name &or "nil" edebug-spec-p "t" "0" (&rest edebug-spec))) edebug-match-specs)
>   edebug-match((((def-edebug-spec cl-lambda-list (([&rest cl-lambda-arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] [&optional ["&rest" cl-lambda-arg]] [&optional ["&key" ... &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or ... symbolp]] . [&or arg nil])))) (6563 (6564 . 6579) (6580 . 6594) (6597 (6598 (6599 (6600 . 6605) (6606 . 6619) . 6620) (6625 (6626 . 6635) (6636 (6637 . 6648) (6649 . 6665) (6666 . 6671) (6672 . 6688) . 6689) . 6690) (6695 (6696 . 6705) (6706 (6707 . 6714) (6715 . 6728) . 6729) . 6730) (6735 (6736 . 6745) (6746 (6747 . 6753) (6754 ... ... ... . 6785) (6788 . 6797) (6798 . 6817) . 6818) . 6819) (6824 (6825 . 6834) (6835 (6836 . 6842) (6843 . 6848) (6851 . 6854) (6855 ... ... ... . 6883) (6884 . 6891) . 6892) . 6893) (6899 (6901 . 6904) (6905 . 6908) (6909 . 6912) . 6913) . 6914) . 6915) . 6916)) (("def-edebug-spec" :name edebug-spec name &or "nil" edebug-spec-p "t" "0" (&rest edebug-spec))))
>   edebug-make-form-wrapper((((def-edebug-spec cl-lambda-list (([&rest cl-lambda-arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] [&optional ["&rest" cl-lambda-arg]] [&optional ["&key" ... &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or ... symbolp]] . [&or arg nil])))) (6563 (6564 . 6579) (6580 . 6594) (6597 (6598 (6599 (6600 . 6605) (6606 . 6619) . 6620) (6625 (6626 . 6635) (6636 (6637 . 6648) (6649 . 6665) (6666 . 6671) (6672 . 6688) . 6689) . 6690) (6695 (6696 . 6705) (6706 (6707 . 6714) (6715 . 6728) . 6729) . 6730) (6735 (6736 . 6745) (6746 (6747 . 6753) (6754 ... ... ... . 6785) (6788 . 6797) (6798 . 6817) . 6818) . 6819) (6824 (6825 . 6834) (6835 (6836 . 6842) (6843 . 6848) (6851 . 6854) (6855 ... ... ... . 6883) (6884 . 6891) . 6892) . 6893) (6899 (6901 . 6904) (6905 . 6908) (6909 . 6912) . 6913) . 6914) . 6915) . 6916)) 6563 6915 (("def-edebug-spec" :name edebug-spec name &or "nil" edebug-spec-p "t" "0" (&rest edebug-spec))))
>   edebug-read-and-maybe-wrap-form1()
>   edebug-read-and-maybe-wrap-form()
>   edebug-read-top-level-form()
>   edebug-eval-defun((4))
>   apply(edebug-eval-defun (4))
>   eval-defun((4))
>   funcall-interactively(eval-defun (4))
>   call-interactively(eval-defun nil nil)
>   command-execute(eval-defun)



> In GNU Emacs 27.0.91 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.13)
>  of 2020-04-20
> Repository revision: a1040861f118881004f59866111f64cd0ae03b7a
> Repository branch: emacs-27
> Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
> System Description: Debian GNU/Linux rodete

[ .... ]

> -- 
> Google Germany GmbH
> Erika-Mann-Straße 33
> 80636 München

-- 
Alan Mackenzie (Nuremberg, Germany).






  parent reply	other threads:[~2020-04-23  6:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-22 12:58 bug#40766: 27.0.91; Cannot edebug cl-lambda-list edebug spec Philipp Stephani
     [not found] ` <mailman.944.1587560406.3066.bug-gnu-emacs@gnu.org>
2020-04-23  6:41   ` Alan Mackenzie [this message]
2020-04-23 19:23     ` Alan Mackenzie
2020-04-24 16:01     ` Alan Mackenzie
2020-04-24 16:14       ` Philipp Stephani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200423064128.95594.qmail@mail.muc.de \
    --to=acm@muc.de \
    --cc=40766@debbugs.gnu.org \
    --cc=p.stephani2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).