diff options
author | Glenn Morris <rgm@gnu.org> | 2009-09-12 22:32:52 +0000 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2009-09-12 22:32:52 +0000 |
commit | afdceaec7decebe70be60baf5c6515ec3e7d6b1a (patch) | |
tree | 6fe5533b91fbf311fe37bce01ba2f79d0ade5b34 /lisp/emacs-lisp/elint.el | |
parent | fd40bad45a28b7255adcef1bdc3011c6213a91ef (diff) | |
download | emacs-afdceaec7decebe70be60baf5c6515ec3e7d6b1a.tar.gz |
(elint-init-env): Skip non-list forms.
(elint-log): Handle unknown file positions.
Diffstat (limited to 'lisp/emacs-lisp/elint.el')
-rw-r--r-- | lisp/emacs-lisp/elint.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el index dcfc05ddd94..d2e950ae908 100644 --- a/lisp/emacs-lisp/elint.el +++ b/lisp/emacs-lisp/elint.el @@ -298,6 +298,9 @@ Return nil if there are no more forms, t otherwise." (setq form (elint-top-form-form (car forms)) forms (cdr forms)) (cond + ;; Eg nnmaildir seems to use [] as a form of comment syntax. + ((not (listp form)) + (elint-error "Skipping non-list form `%s'" form)) ;; Add defined variable ((memq (car form) '(defvar defconst defcustom)) (setq env (elint-env-add-var env (cadr form)))) @@ -686,10 +689,12 @@ CODE can be a lambda expression, a macro, or byte-compiled code." (if f (file-name-nondirectory f) (buffer-name))) - (save-excursion - (goto-char elint-current-pos) - (1+ (count-lines (point-min) - (line-beginning-position)))) + (if (boundp 'elint-current-pos) + (save-excursion + (goto-char elint-current-pos) + (1+ (count-lines (point-min) + (line-beginning-position)))) + 0) ; unknown position type (apply 'format string args)))) |