diff options
| author | Glenn Morris | 2010-11-06 12:40:33 -0700 |
|---|---|---|
| committer | Glenn Morris | 2010-11-06 12:40:33 -0700 |
| commit | 79d1dabe009ea0d18c47a39ca3c8a582f7bbea8b (patch) | |
| tree | 2828bb9a3322ce8fd5dd3b407302f88bcdee8f12 | |
| parent | c497474bdc5708de86691d9622475e8851ae7760 (diff) | |
| download | emacs-79d1dabe009ea0d18c47a39ca3c8a582f7bbea8b.tar.gz emacs-79d1dabe009ea0d18c47a39ca3c8a582f7bbea8b.zip | |
Silence elint compilation.
* lisp/emacs-lisp/elint.el (elint-init-env): Prefix dynamic local `env'.
(elint-init-form): Update for above name change.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/emacs-lisp/elint.el | 46 |
2 files changed, 26 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b7cc8d772f6..882f2235435 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2010-11-06 Glenn Morris <rgm@gnu.org> | 1 | 2010-11-06 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * emacs-lisp/elint.el (elint-init-env): Prefix dynamic local `env'. | ||
| 4 | (elint-init-form): Update for above name change. | ||
| 5 | |||
| 3 | * mail/mail-extr.el (mail-extract-address-components): Give dynamic | 6 | * mail/mail-extr.el (mail-extract-address-components): Give dynamic |
| 4 | local variables `cbeg' and `cend' a prefix. | 7 | local variables `cbeg' and `cend' a prefix. |
| 5 | (mail-extr-voodoo): Update for above name change. | 8 | (mail-extr-voodoo): Update for above name change. |
diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el index b9aa29decd0..39c45e82309 100644 --- a/lisp/emacs-lisp/elint.el +++ b/lisp/emacs-lisp/elint.el | |||
| @@ -394,40 +394,41 @@ Return nil if there are no more forms, t otherwise." | |||
| 394 | (parse-partial-sexp (point) (point-max) nil t) | 394 | (parse-partial-sexp (point) (point-max) nil t) |
| 395 | (not (eobp))) | 395 | (not (eobp))) |
| 396 | 396 | ||
| 397 | (defvar env) ; from elint-init-env | 397 | (defvar elint-env) ; from elint-init-env |
| 398 | 398 | ||
| 399 | (defun elint-init-form (form) | 399 | (defun elint-init-form (form) |
| 400 | "Process FORM, adding to ENV if recognized." | 400 | "Process FORM, adding to ELINT-ENV if recognized." |
| 401 | (cond | 401 | (cond |
| 402 | ;; Eg nnmaildir seems to use [] as a form of comment syntax. | 402 | ;; Eg nnmaildir seems to use [] as a form of comment syntax. |
| 403 | ((not (listp form)) | 403 | ((not (listp form)) |
| 404 | (elint-warning "Skipping non-list form `%s'" form)) | 404 | (elint-warning "Skipping non-list form `%s'" form)) |
| 405 | ;; Add defined variable | 405 | ;; Add defined variable |
| 406 | ((memq (car form) '(defvar defconst defcustom)) | 406 | ((memq (car form) '(defvar defconst defcustom)) |
| 407 | (setq env (elint-env-add-var env (cadr form)))) | 407 | (setq elint-env (elint-env-add-var elint-env (cadr form)))) |
| 408 | ;; Add function | 408 | ;; Add function |
| 409 | ((memq (car form) '(defun defsubst)) | 409 | ((memq (car form) '(defun defsubst)) |
| 410 | (setq env (elint-env-add-func env (cadr form) (nth 2 form)))) | 410 | (setq elint-env (elint-env-add-func elint-env (cadr form) (nth 2 form)))) |
| 411 | ;; FIXME needs a handler to say second arg is not a variable when we come | 411 | ;; FIXME needs a handler to say second arg is not a variable when we come |
| 412 | ;; to scan the form. | 412 | ;; to scan the form. |
| 413 | ((eq (car form) 'define-derived-mode) | 413 | ((eq (car form) 'define-derived-mode) |
| 414 | (setq env (elint-env-add-func env (cadr form) ()) | 414 | (setq elint-env (elint-env-add-func elint-env (cadr form) ()) |
| 415 | env (elint-env-add-var env (cadr form)) | 415 | elint-env (elint-env-add-var elint-env (cadr form)) |
| 416 | env (elint-env-add-var env (intern (format "%s-map" (cadr form)))))) | 416 | elint-env (elint-env-add-var elint-env |
| 417 | (intern (format "%s-map" (cadr form)))))) | ||
| 417 | ((eq (car form) 'define-minor-mode) | 418 | ((eq (car form) 'define-minor-mode) |
| 418 | (setq env (elint-env-add-func env (cadr form) '(&optional arg)) | 419 | (setq elint-env (elint-env-add-func elint-env (cadr form) '(&optional arg)) |
| 419 | ;; FIXME mode map? | 420 | ;; FIXME mode map? |
| 420 | env (elint-env-add-var env (cadr form)))) | 421 | elint-env (elint-env-add-var elint-env (cadr form)))) |
| 421 | ((and (eq (car form) 'easy-menu-define) | 422 | ((and (eq (car form) 'easy-menu-define) |
| 422 | (cadr form)) | 423 | (cadr form)) |
| 423 | (setq env (elint-env-add-func env (cadr form) '(event)) | 424 | (setq elint-env (elint-env-add-func elint-env (cadr form) '(event)) |
| 424 | env (elint-env-add-var env (cadr form)))) | 425 | elint-env (elint-env-add-var elint-env (cadr form)))) |
| 425 | ;; FIXME it would be nice to check the autoloads are correct. | 426 | ;; FIXME it would be nice to check the autoloads are correct. |
| 426 | ((eq (car form) 'autoload) | 427 | ((eq (car form) 'autoload) |
| 427 | (setq env (elint-env-add-func env (cadr (cadr form)) 'unknown))) | 428 | (setq elint-env (elint-env-add-func elint-env (cadr (cadr form)) 'unknown))) |
| 428 | ((eq (car form) 'declare-function) | 429 | ((eq (car form) 'declare-function) |
| 429 | (setq env (elint-env-add-func | 430 | (setq elint-env (elint-env-add-func |
| 430 | env (cadr form) | 431 | elint-env (cadr form) |
| 431 | (if (or (< (length form) 4) | 432 | (if (or (< (length form) 4) |
| 432 | (eq (nth 3 form) t) | 433 | (eq (nth 3 form) t) |
| 433 | (unless (stringp (nth 2 form)) | 434 | (unless (stringp (nth 2 form)) |
| @@ -440,14 +441,14 @@ Return nil if there are no more forms, t otherwise." | |||
| 440 | ;; If the alias points to something already in the environment, | 441 | ;; If the alias points to something already in the environment, |
| 441 | ;; add the alias to the environment with the same arguments. | 442 | ;; add the alias to the environment with the same arguments. |
| 442 | ;; FIXME symbol-function, eg backquote.el? | 443 | ;; FIXME symbol-function, eg backquote.el? |
| 443 | (let ((def (elint-env-find-func env (cadr (nth 2 form))))) | 444 | (let ((def (elint-env-find-func elint-env (cadr (nth 2 form))))) |
| 444 | (setq env (elint-env-add-func env (cadr (cadr form)) | 445 | (setq elint-env (elint-env-add-func elint-env (cadr (cadr form)) |
| 445 | (if def (cadr def) 'unknown))))) | 446 | (if def (cadr def) 'unknown))))) |
| 446 | ;; Add macro, both as a macro and as a function | 447 | ;; Add macro, both as a macro and as a function |
| 447 | ((eq (car form) 'defmacro) | 448 | ((eq (car form) 'defmacro) |
| 448 | (setq env (elint-env-add-macro env (cadr form) | 449 | (setq elint-env (elint-env-add-macro elint-env (cadr form) |
| 449 | (cons 'lambda (cddr form))) | 450 | (cons 'lambda (cddr form))) |
| 450 | env (elint-env-add-func env (cadr form) (nth 2 form)))) | 451 | elint-env (elint-env-add-func elint-env (cadr form) (nth 2 form)))) |
| 451 | ((and (eq (car form) 'put) | 452 | ((and (eq (car form) 'put) |
| 452 | (= 4 (length form)) | 453 | (= 4 (length form)) |
| 453 | (eq (car-safe (cadr form)) 'quote) | 454 | (eq (car-safe (cadr form)) 'quote) |
| @@ -471,12 +472,12 @@ Return nil if there are no more forms, t otherwise." | |||
| 471 | (setq name 'cl-macs | 472 | (setq name 'cl-macs |
| 472 | file nil | 473 | file nil |
| 473 | elint-doing-cl t)) ; blech | 474 | elint-doing-cl t)) ; blech |
| 474 | (setq env (elint-add-required-env env name file)))))) | 475 | (setq elint-env (elint-add-required-env elint-env name file)))))) |
| 475 | env) | 476 | elint-env) |
| 476 | 477 | ||
| 477 | (defun elint-init-env (forms) | 478 | (defun elint-init-env (forms) |
| 478 | "Initialize the environment from FORMS." | 479 | "Initialize the environment from FORMS." |
| 479 | (let ((env (elint-make-env)) | 480 | (let ((elint-env (elint-make-env)) |
| 480 | form) | 481 | form) |
| 481 | (while forms | 482 | (while forms |
| 482 | (setq form (elint-top-form-form (car forms)) | 483 | (setq form (elint-top-form-form (car forms)) |
| @@ -489,7 +490,7 @@ Return nil if there are no more forms, t otherwise." | |||
| 489 | with-no-warnings)) | 490 | with-no-warnings)) |
| 490 | (mapc 'elint-init-form (cdr form)) | 491 | (mapc 'elint-init-form (cdr form)) |
| 491 | (elint-init-form form))) | 492 | (elint-init-form form))) |
| 492 | env)) | 493 | elint-env)) |
| 493 | 494 | ||
| 494 | (defun elint-add-required-env (env name file) | 495 | (defun elint-add-required-env (env name file) |
| 495 | "Augment ENV with the variables defined by feature NAME in FILE." | 496 | "Augment ENV with the variables defined by feature NAME in FILE." |
| @@ -1171,5 +1172,4 @@ If no documentation could be found args will be `unknown'." | |||
| 1171 | 1172 | ||
| 1172 | (provide 'elint) | 1173 | (provide 'elint) |
| 1173 | 1174 | ||
| 1174 | ;; arch-tag: b2f061e2-af84-4ddc-8e39-f5e969ac228f | ||
| 1175 | ;;; elint.el ends here | 1175 | ;;; elint.el ends here |