summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorJohan Bockgård <bojohan@gnu.org>2015-04-12 16:26:51 +0200
committerJohan Bockgård <bojohan@gnu.org>2015-04-12 16:26:51 +0200
commitb62d7956bea87eba82a86bfeba2d637c7ef4016c (patch)
tree0dfd00d42b08df45479a98f260ac814d5f424020 /lisp/emacs-lisp
parentf4dbec453dcf0586c2a7ac4b010ae12691bc215b (diff)
downloademacs-b62d7956bea87eba82a86bfeba2d637c7ef4016c.tar.gz
emacs-b62d7956bea87eba82a86bfeba2d637c7ef4016c.tar.bz2
emacs-b62d7956bea87eba82a86bfeba2d637c7ef4016c.zip
edebug.el: Disambiguate vector specifications
* lisp/emacs-lisp/edebug.el (edebug-match-list): Always treat `(vector ...)' as a vector specification, not as a sublist.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/edebug.el20
1 files changed, 11 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index d0668bbe54b..98fb7e9888c 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -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)))
)))