mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-18 18:00:11 +00:00
(elint-check-defcustom-form): New function.
(elint-special-forms): Use it.
This commit is contained in:
parent
cafba8996c
commit
7f0feddae2
1 changed files with 23 additions and 14 deletions
|
@ -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))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue