Mercurial > emacs
changeset 100064:b42d22c5897f
(macro-declaration-function): Disallow declare specs with lengths of 3
or more.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sun, 30 Nov 2008 03:00:18 +0000 |
parents | cb2c537a8fea |
children | ff059e39686f |
files | lisp/emacs-lisp/byte-run.el |
diffstat | 1 files changed, 13 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/emacs-lisp/byte-run.el Sun Nov 30 02:59:18 2008 +0000 +++ b/lisp/emacs-lisp/byte-run.el Sun Nov 30 03:00:18 2008 +0000 @@ -45,14 +45,19 @@ ;; 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)