summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/elint.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2009-09-12 22:32:52 +0000
committerGlenn Morris <rgm@gnu.org>2009-09-12 22:32:52 +0000
commitafdceaec7decebe70be60baf5c6515ec3e7d6b1a (patch)
tree6fe5533b91fbf311fe37bce01ba2f79d0ade5b34 /lisp/emacs-lisp/elint.el
parentfd40bad45a28b7255adcef1bdc3011c6213a91ef (diff)
downloademacs-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.el13
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))))