diff options
| author | Mark Oteiza | 2017-02-17 18:52:12 -0500 |
|---|---|---|
| committer | Mark Oteiza | 2017-02-17 18:52:12 -0500 |
| commit | edadd31bf4b5516acf3d041f79cf7164c584e052 (patch) | |
| tree | 106c829eec6d2a1748f2dc8d059cbfd5d16ee158 | |
| parent | 5401820672c650f47bf055ebbf3cc590f90cb05a (diff) | |
| download | emacs-edadd31bf4b5516acf3d041f79cf7164c584e052.tar.gz emacs-edadd31bf4b5516acf3d041f79cf7164c584e052.zip | |
Turn on lexical-binding in elint.el
* lisp/emacs-lisp/elint.el: Quote entry point commands in commentary.
(elint-running, elint-current-pos): Move these dynamic vars to toward
the top of the file.
(elint-check-quote-form): Ignore unused argument.
(elint-check-conditional-form): Remove unused binding.
| -rw-r--r-- | lisp/emacs-lisp/elint.el | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el index f5e10a24d37..a14bd0d7643 100644 --- a/lisp/emacs-lisp/elint.el +++ b/lisp/emacs-lisp/elint.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; elint.el --- Lint Emacs Lisp | 1 | ;;; elint.el --- Lint Emacs Lisp -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1997, 2001-2017 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1997, 2001-2017 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -27,7 +27,7 @@ | |||
| 27 | ;; misspellings and undefined variables, although it can also catch | 27 | ;; misspellings and undefined variables, although it can also catch |
| 28 | ;; function calls with the wrong number of arguments. | 28 | ;; function calls with the wrong number of arguments. |
| 29 | 29 | ||
| 30 | ;; To use, call elint-current-buffer or elint-defun to lint a buffer | 30 | ;; To use, call `elint-current-buffer' or `elint-defun' to lint a buffer |
| 31 | ;; or defun. The first call runs `elint-initialize' to set up some | 31 | ;; or defun. The first call runs `elint-initialize' to set up some |
| 32 | ;; argument data, which may take a while. | 32 | ;; argument data, which may take a while. |
| 33 | 33 | ||
| @@ -154,6 +154,9 @@ Set by `elint-initialize', if `elint-scan-preloaded' is non-nil.") | |||
| 154 | "Regexp matching elements of `preloaded-file-list' to ignore. | 154 | "Regexp matching elements of `preloaded-file-list' to ignore. |
| 155 | We ignore them because they contain no definitions of use to Elint.") | 155 | We ignore them because they contain no definitions of use to Elint.") |
| 156 | 156 | ||
| 157 | (defvar elint-running) | ||
| 158 | (defvar elint-current-pos) ; dynamically bound in elint-top-form | ||
| 159 | |||
| 157 | ;;; | 160 | ;;; |
| 158 | ;;; ADT: top-form | 161 | ;;; ADT: top-form |
| 159 | ;;; | 162 | ;;; |
| @@ -862,7 +865,7 @@ CODE can be a lambda expression, a macro, or byte-compiled code." | |||
| 862 | (t (elint-error "Not a function object: %s" form) | 865 | (t (elint-error "Not a function object: %s" form) |
| 863 | env)))) | 866 | env)))) |
| 864 | 867 | ||
| 865 | (defun elint-check-quote-form (form env) | 868 | (defun elint-check-quote-form (_form env) |
| 866 | "Lint the quote FORM in ENV." | 869 | "Lint the quote FORM in ENV." |
| 867 | env) | 870 | env) |
| 868 | 871 | ||
| @@ -903,8 +906,7 @@ CODE can be a lambda expression, a macro, or byte-compiled code." | |||
| 903 | "Check the when/unless/and/or FORM in ENV. | 906 | "Check the when/unless/and/or FORM in ENV. |
| 904 | Does basic handling of `featurep' tests." | 907 | Does basic handling of `featurep' tests." |
| 905 | (let ((func (car form)) | 908 | (let ((func (car form)) |
| 906 | (test (cadr form)) | 909 | (test (cadr form))) |
| 907 | sym) | ||
| 908 | ;; Misses things like (and t (featurep 'xemacs)) | 910 | ;; Misses things like (and t (featurep 'xemacs)) |
| 909 | ;; Check byte-compile-maybe-guarded. | 911 | ;; Check byte-compile-maybe-guarded. |
| 910 | (cond ((and (memq func '(when and)) | 912 | (cond ((and (memq func '(when and)) |
| @@ -967,8 +969,6 @@ Does basic handling of `featurep' tests." | |||
| 967 | ;;; Message functions | 969 | ;;; Message functions |
| 968 | ;;; | 970 | ;;; |
| 969 | 971 | ||
| 970 | (defvar elint-current-pos) ; dynamically bound in elint-top-form | ||
| 971 | |||
| 972 | (defun elint-log (type string args) | 972 | (defun elint-log (type string args) |
| 973 | (elint-log-message (format "%s:%d:%s: %s" | 973 | (elint-log-message (format "%s:%d:%s: %s" |
| 974 | (let ((f (buffer-file-name))) | 974 | (let ((f (buffer-file-name))) |
| @@ -1038,8 +1038,6 @@ Insert HEADER followed by a blank line if non-nil." | |||
| 1038 | (display-buffer (elint-get-log-buffer)) | 1038 | (display-buffer (elint-get-log-buffer)) |
| 1039 | (sit-for 0))) | 1039 | (sit-for 0))) |
| 1040 | 1040 | ||
| 1041 | (defvar elint-running) | ||
| 1042 | |||
| 1043 | (defun elint-set-mode-line (&optional on) | 1041 | (defun elint-set-mode-line (&optional on) |
| 1044 | "Set the mode-line-process of the Elint log buffer." | 1042 | "Set the mode-line-process of the Elint log buffer." |
| 1045 | (with-current-buffer (elint-get-log-buffer) | 1043 | (with-current-buffer (elint-get-log-buffer) |