]> code.delx.au - gnu-emacs/commitdiff
edebug.el: Disambiguate vector specifications
authorJohan Bockgård <bojohan@gnu.org>
Sun, 12 Apr 2015 14:26:51 +0000 (16:26 +0200)
committerJohan Bockgård <bojohan@gnu.org>
Sun, 12 Apr 2015 14:26:51 +0000 (16:26 +0200)
* lisp/emacs-lisp/edebug.el (edebug-match-list): Always treat
`(vector ...)' as a vector specification, not as a sublist.

lisp/emacs-lisp/edebug.el

index d0668bbe54bbda384ccd439928938c9ded5faa1f..98fb7e9888c7f06f446bc980398cafad2100d075 100644 (file)
@@ -1725,6 +1725,17 @@ expressions; a `progn' form will be returned enclosing these forms."
           (t
            (error "Bad spec: %s" specs)))))
 
+       ((eq 'vector spec)
+       (if (vectorp form)
+           ;; Special case: match a vector with the specs.
+           (let ((result (edebug-match-sublist
+                          (edebug-new-cursor
+                           form (cdr (edebug-top-offset cursor)))
+                          (cdr specs))))
+             (edebug-move-cursor cursor)
+             (list (apply 'vector result)))
+         (edebug-no-match cursor "Expected" specs)))
+
        ((listp form)
        (prog1
            (list (edebug-match-sublist
@@ -1734,15 +1745,6 @@ expressions; a `progn' form will be returned enclosing these forms."
                   specs))
          (edebug-move-cursor cursor)))
 
-       ((and (eq 'vector spec) (vectorp form))
-       ;; Special case: match a vector with the specs.
-       (let ((result (edebug-match-sublist
-                      (edebug-new-cursor
-                       form (cdr (edebug-top-offset cursor)))
-                      (cdr specs))))
-         (edebug-move-cursor cursor)
-         (list (apply 'vector result))))
-
        (t (edebug-no-match cursor "Expected" specs)))
       )))