summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2008-11-30 03:00:18 +0000
committerChong Yidong <cyd@stupidchicken.com>2008-11-30 03:00:18 +0000
commit15183da6713f68246465768d5d09c91446a6511f (patch)
tree47941db234cd9f930ae611fc9feeab11b2f181cd /lisp/emacs-lisp
parent5829445e82ee17bd4a7a445c751f45374fe02e87 (diff)
downloademacs-15183da6713f68246465768d5d09c91446a6511f.tar.gz
emacs-15183da6713f68246465768d5d09c91446a6511f.tar.bz2
emacs-15183da6713f68246465768d5d09c91446a6511f.zip
(macro-declaration-function): Disallow declare specs with lengths of 3
or more.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/byte-run.el21
1 files changed, 13 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 03fd5bfee3c..03908d90021 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -45,14 +45,19 @@ The return value of this function is not used."
;; Ignore the first element of `decl' (it's always `declare').
(while (setq decl (cdr decl))
(setq d (car decl))
- (cond ((and (consp d) (eq (car d) 'indent))
- (put macro 'lisp-indent-function (car (cdr d))))
- ((and (consp d) (eq (car d) 'debug))
- (put macro 'edebug-form-spec (car (cdr d))))
- ((and (consp d) (eq (car d) 'doc-string))
- (put macro 'doc-string-elt (car (cdr d))))
- (t
- (message "Unknown declaration %s" d))))))
+ (if (and (consp d)
+ (listp (cdr d))
+ (null (cdr (cdr d))))
+ (cond ((eq (car d) 'indent)
+ (put macro 'lisp-indent-function (car (cdr d))))
+ ((eq (car d) 'debug)
+ (put macro 'edebug-form-spec (car (cdr d))))
+ ((eq (car d) 'doc-string)
+ (put macro 'doc-string-elt (car (cdr d))))
+ (t
+ (message "Unknown declaration %s" d)))
+ (message "Invalid declaration %s" d)))))
+
(setq macro-declaration-function 'macro-declaration-function)