;;; elint.el --- Lint Emacs Lisp
-;; Copyright (C) 1997, 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2016 Free Software Foundation, Inc.
;; Author: Peter Liljenberg <petli@lysator.liu.se>
;; Created: May 1997
;;; Code:
-(require 'help-fns)
-
(defgroup elint nil
"Linting for Emacs Lisp."
:prefix "elint-"
(elint-set-mode-line t)
(with-current-buffer elint-log-buffer
(unless (string-equal default-directory dir)
- (elint-log-message (format "\f\nLeaving directory `%s'"
- default-directory) t)
- (elint-log-message (format "Entering directory `%s'" dir) t)
+ (elint-log-message (format-message "\f\nLeaving directory `%s'"
+ default-directory) t)
+ (elint-log-message (format-message "Entering directory `%s'" dir) t)
(setq default-directory dir))))
(let ((str (format "Linting file %s" file)))
(message "%s..." str)
(let ((elint-current-pos (point)))
;; non-list check could be here too. errors may be out of seq.
;; quoted check cannot be elsewhere, since quotes skipped.
- (if (looking-back "'")
+ (if (looking-back "'" (1- (point)))
;; Eg cust-print.el uses ' as a comment syntax.
- (elint-warning "Skipping quoted form `'%.20s...'"
+ (elint-warning "Skipping quoted form `%c%.20s...'" ?\'
(read (current-buffer)))
(condition-case nil
(setq tops (cons
tops))
(end-of-file
(goto-char elint-current-pos)
- (error "Missing ')' in top form: %s"
+ (error "Missing `)' in top form: %s"
(buffer-substring elint-current-pos
(line-end-position))))))))
(nreverse tops))))
;;; (with-syntax-table emacs-lisp-mode-syntax-table
;;; (elint-update-env))
;;; (setq env (elint-env-add-env env elint-buffer-env))))
- ;;(message "Elint processed (require '%s)" name))
+ ;;(message "%s" (format "Elint processed (require '%s)" name))
(error "%s.el not found in load-path" libname)))
(error
(message "Can't get variables from require'd library %s: %s"
(line-beginning-position))))
0) ; unknown position
type
- (apply 'format string args))))
+ (apply #'format-message string args))))
(defun elint-error (string &rest args)
"Report a linting error.