(elint-check-defcustom-form): New function.

(elint-special-forms): Use it.
This commit is contained in:
Karl Heuer 1997-10-02 02:47:57 +00:00
parent cafba8996c
commit 7f0feddae2

View file

@ -312,7 +312,7 @@ Returns nil if there are no more forms, T otherwise."
(defmacro . elint-check-defun-form)
(defvar . elint-check-defvar-form)
(defconst . elint-check-defvar-form)
(defcustom . elint-check-defvar-form)
(defcustom . elint-check-defcustom-form)
(macro . elint-check-macro-form)
(condition-case . elint-check-condition-case-form))
"Functions to call when some special form should be linted.")
@ -537,6 +537,15 @@ CODE can be a lambda expression, a macro, or byte-compiled code."
(elint-error "Malformed variable declaration: %s" form)
env))
(defun elint-check-defcustom-form (form env)
"Lint the defcustom FORM in ENV."
(if (and (> (length form) 3)
(evenp (length form))) ; even no. of keyword/value args
(elint-env-add-global-var (elint-form (nth 2 form) env)
(car (cdr form)))
(elint-error "Malformed variable declaration: %s" form)
env))
(defun elint-check-function-form (form env)
"Lint the function FORM in ENV."
(let ((func (car (cdr-safe form))))