comparison lisp/emacs-lisp/edebug.el @ 33709:bfee926318b1

(edebug-form-spec prop): use dolist. (define-derived-mode, define-minor-mode): Add specs.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 21 Nov 2000 21:47:25 +0000
parents d22ae991ac5f
children 8c1e62157545
comparison
equal deleted inserted replaced
33708:7c2b5397acbc 33709:bfee926318b1
1622 ;; Define specs for all the symbol specs with functions used to process them. 1622 ;; Define specs for all the symbol specs with functions used to process them.
1623 ;; Perhaps we shouldn't be doing this with edebug-form-specs since the 1623 ;; Perhaps we shouldn't be doing this with edebug-form-specs since the
1624 ;; user may want to define macros or functions with the same names. 1624 ;; user may want to define macros or functions with the same names.
1625 ;; We could use an internal obarray for these primitive specs. 1625 ;; We could use an internal obarray for these primitive specs.
1626 1626
1627 (mapcar 1627 (dolist (pair '((&optional . edebug-match-&optional)
1628 (function (lambda (pair) 1628 (&rest . edebug-match-&rest)
1629 (put (car pair) 'edebug-form-spec (cdr pair)))) 1629 (&or . edebug-match-&or)
1630 '((&optional . edebug-match-&optional) 1630 (form . edebug-match-form)
1631 (&rest . edebug-match-&rest) 1631 (sexp . edebug-match-sexp)
1632 (&or . edebug-match-&or) 1632 (body . edebug-match-body)
1633 (form . edebug-match-form) 1633 (&define . edebug-match-&define)
1634 (sexp . edebug-match-sexp) 1634 (name . edebug-match-name)
1635 (body . edebug-match-body) 1635 (:name . edebug-match-colon-name)
1636 (&define . edebug-match-&define) 1636 (arg . edebug-match-arg)
1637 (name . edebug-match-name) 1637 (def-body . edebug-match-def-body)
1638 (:name . edebug-match-colon-name) 1638 (def-form . edebug-match-def-form)
1639 (arg . edebug-match-arg) 1639 ;; Less frequently used:
1640 (def-body . edebug-match-def-body) 1640 ;; (function . edebug-match-function)
1641 (def-form . edebug-match-def-form) 1641 (lambda-expr . edebug-match-lambda-expr)
1642 ;; Less frequently used: 1642 (&not . edebug-match-&not)
1643 ;; (function . edebug-match-function) 1643 (&key . edebug-match-&key)
1644 (lambda-expr . edebug-match-lambda-expr) 1644 (place . edebug-match-place)
1645 (&not . edebug-match-&not) 1645 (gate . edebug-match-gate)
1646 (&key . edebug-match-&key) 1646 ;; (nil . edebug-match-nil) not this one - special case it.
1647 (place . edebug-match-place) 1647 ))
1648 (gate . edebug-match-gate) 1648 (put (car pair) 'edebug-form-spec (cdr pair)))
1649 ;; (nil . edebug-match-nil) not this one - special case it.
1650 ))
1651 1649
1652 (defun edebug-match-symbol (cursor symbol) 1650 (defun edebug-match-symbol (cursor symbol)
1653 ;; Match a symbol spec. 1651 ;; Match a symbol spec.
1654 (let* ((spec (get-edebug-spec symbol))) 1652 (let* ((spec (get-edebug-spec symbol)))
1655 (cond 1653 (cond
1970 (and (symbolp object) 1968 (and (symbolp object)
1971 (get object 'edebug-form-spec))) 1969 (get object 'edebug-form-spec)))
1972 1970
1973 (def-edebug-spec def-edebug-spec 1971 (def-edebug-spec def-edebug-spec
1974 ;; Top level is different from lower levels. 1972 ;; Top level is different from lower levels.
1975 (&define :name edebug-spec name 1973 (&define :name edebug-spec name
1976 &or "nil" edebug-spec-p "t" "0" (&rest edebug-spec))) 1974 &or "nil" edebug-spec-p "t" "0" (&rest edebug-spec)))
1977 1975
1978 (def-edebug-spec edebug-spec-list 1976 (def-edebug-spec edebug-spec-list
1979 ;; A list must have something in it, or it is nil, a symbolp 1977 ;; A list must have something in it, or it is nil, a symbolp
1980 ((edebug-spec . [&or nil edebug-spec]))) 1978 ((edebug-spec . [&or nil edebug-spec])))
2007 [&optional stringp] 2005 [&optional stringp]
2008 [&optional ("interactive" interactive)] 2006 [&optional ("interactive" interactive)]
2009 def-body)) 2007 def-body))
2010 (def-edebug-spec defmacro 2008 (def-edebug-spec defmacro
2011 (&define name lambda-list def-body)) 2009 (&define name lambda-list def-body))
2010 (def-edebug-spec define-derived-mode
2011 (&define name name stringp [&optional stringp] def-body))
2012 (def-edebug-spec define-minor-mode
2013 (&define name stringp def-body))
2014 ;; This plain doesn't work ;-( -sm
2015 ;; (def-edebug-spec define-skeleton
2016 ;; (&define name stringp def-body))
2012 2017
2013 (def-edebug-spec arglist lambda-list) ;; deprecated - use lambda-list. 2018 (def-edebug-spec arglist lambda-list) ;; deprecated - use lambda-list.
2014 2019
2015 (def-edebug-spec lambda-list 2020 (def-edebug-spec lambda-list
2016 (([&rest arg] 2021 (([&rest arg]