Commit edadd31b authored by Mark Oteiza's avatar Mark Oteiza
Browse files

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.
parent 54018206
;;; elint.el --- Lint Emacs Lisp
;;; elint.el --- Lint Emacs Lisp -*- lexical-binding: t -*-
;; Copyright (C) 1997, 2001-2017 Free Software Foundation, Inc.
......@@ -27,7 +27,7 @@
;; misspellings and undefined variables, although it can also catch
;; function calls with the wrong number of arguments.
;; To use, call elint-current-buffer or elint-defun to lint a buffer
;; To use, call `elint-current-buffer' or `elint-defun' to lint a buffer
;; or defun. The first call runs `elint-initialize' to set up some
;; argument data, which may take a while.
......@@ -154,6 +154,9 @@ Set by `elint-initialize', if `elint-scan-preloaded' is non-nil.")
"Regexp matching elements of `preloaded-file-list' to ignore.
We ignore them because they contain no definitions of use to Elint.")
(defvar elint-running)
(defvar elint-current-pos) ; dynamically bound in elint-top-form
;;;
;;; ADT: top-form
;;;
......@@ -862,7 +865,7 @@ CODE can be a lambda expression, a macro, or byte-compiled code."
(t (elint-error "Not a function object: %s" form)
env))))
(defun elint-check-quote-form (form env)
(defun elint-check-quote-form (_form env)
"Lint the quote FORM in ENV."
env)
......@@ -903,8 +906,7 @@ CODE can be a lambda expression, a macro, or byte-compiled code."
"Check the when/unless/and/or FORM in ENV.
Does basic handling of `featurep' tests."
(let ((func (car form))
(test (cadr form))
sym)
(test (cadr form)))
;; Misses things like (and t (featurep 'xemacs))
;; Check byte-compile-maybe-guarded.
(cond ((and (memq func '(when and))
......@@ -967,8 +969,6 @@ Does basic handling of `featurep' tests."
;;; Message functions
;;;
(defvar elint-current-pos) ; dynamically bound in elint-top-form
(defun elint-log (type string args)
(elint-log-message (format "%s:%d:%s: %s"
(let ((f (buffer-file-name)))
......@@ -1038,8 +1038,6 @@ Insert HEADER followed by a blank line if non-nil."
(display-buffer (elint-get-log-buffer))
(sit-for 0)))
(defvar elint-running)
(defun elint-set-mode-line (&optional on)
"Set the mode-line-process of the Elint log buffer."
(with-current-buffer (elint-get-log-buffer)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment