]> git.eshelyaron.com Git - emacs.git/commitdiff
(edebug-basic-spec): New function for vetting file-local form specs.
authorEli Zaretskii <eliz@gnu.org>
Thu, 13 Apr 2006 10:51:17 +0000 (10:51 +0000)
committerEli Zaretskii <eliz@gnu.org>
Thu, 13 Apr 2006 10:51:17 +0000 (10:51 +0000)
lisp/emacs-lisp/edebug.el

index 444c310920d75d7ddafd8f80f45e0e65213b703d..d0be3a02f65286cf83e8eb643219731dc46b53ea 100644 (file)
@@ -258,6 +258,20 @@ Both SYMBOL and SPEC are unevaluated. The SPEC can be 0, t, a symbol
     edebug-form-spec
     ))
 
+;;;###autoload
+(defun edebug-basic-spec (spec)
+  "Return t if SPEC uses only extant spec symbols.
+An extant spec symbol is a symbol that is not a function and has a
+`edebug-form-spec' property."
+  (cond ((listp spec)
+        (catch 'basic
+          (while spec
+            (unless (edebug-basic-spec (car spec)) (throw 'basic nil))
+            (setq spec (cdr spec)))
+          t))
+       ((symbolp spec)
+        (unless (functionp spec) (get spec 'edebug-form-spec)))))
+
 ;;; Utilities
 
 ;; Define edebug-gensym - from old cl.el