bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#40766: 27.0.91; Cannot edebug cl-lambda-list edebug spec


From: Alan Mackenzie
Subject: bug#40766: 27.0.91; Cannot edebug cl-lambda-list edebug spec
Date: 23 Apr 2020 06:41:28 -0000
User-agent: tin/2.4.4-20191224 ("Millburn") (FreeBSD/11.3-RELEASE-p3 (amd64))

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).






reply via email to

[Prev in Thread] Current Thread [Next in Thread]