diff options
| author | Glenn Morris | 2009-09-12 22:32:52 +0000 |
|---|---|---|
| committer | Glenn Morris | 2009-09-12 22:32:52 +0000 |
| commit | afdceaec7decebe70be60baf5c6515ec3e7d6b1a (patch) | |
| tree | 6fe5533b91fbf311fe37bce01ba2f79d0ade5b34 | |
| parent | fd40bad45a28b7255adcef1bdc3011c6213a91ef (diff) | |
| download | emacs-afdceaec7decebe70be60baf5c6515ec3e7d6b1a.tar.gz emacs-afdceaec7decebe70be60baf5c6515ec3e7d6b1a.zip | |
(elint-init-env): Skip non-list forms.
(elint-log): Handle unknown file positions.
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/elint.el | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 11787f8a7d3..22207eec8f9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -18,6 +18,8 @@ | |||
| 18 | 1000. | 18 | 1000. |
| 19 | (elint-add-required-env): Don't beep on error. | 19 | (elint-add-required-env): Don't beep on error. |
| 20 | (elint-forms): In case of error, return ENV unchanged. | 20 | (elint-forms): In case of error, return ENV unchanged. |
| 21 | (elint-init-env): Skip non-list forms. | ||
| 22 | (elint-log): Handle unknown file positions. | ||
| 21 | 23 | ||
| 22 | 2009-09-12 Daiki Ueno <ueno@unixuser.org> | 24 | 2009-09-12 Daiki Ueno <ueno@unixuser.org> |
| 23 | 25 | ||
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." | |||
| 298 | (setq form (elint-top-form-form (car forms)) | 298 | (setq form (elint-top-form-form (car forms)) |
| 299 | forms (cdr forms)) | 299 | forms (cdr forms)) |
| 300 | (cond | 300 | (cond |
| 301 | ;; Eg nnmaildir seems to use [] as a form of comment syntax. | ||
| 302 | ((not (listp form)) | ||
| 303 | (elint-error "Skipping non-list form `%s'" form)) | ||
| 301 | ;; Add defined variable | 304 | ;; Add defined variable |
| 302 | ((memq (car form) '(defvar defconst defcustom)) | 305 | ((memq (car form) '(defvar defconst defcustom)) |
| 303 | (setq env (elint-env-add-var env (cadr form)))) | 306 | (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." | |||
| 686 | (if f | 689 | (if f |
| 687 | (file-name-nondirectory f) | 690 | (file-name-nondirectory f) |
| 688 | (buffer-name))) | 691 | (buffer-name))) |
| 689 | (save-excursion | 692 | (if (boundp 'elint-current-pos) |
| 690 | (goto-char elint-current-pos) | 693 | (save-excursion |
| 691 | (1+ (count-lines (point-min) | 694 | (goto-char elint-current-pos) |
| 692 | (line-beginning-position)))) | 695 | (1+ (count-lines (point-min) |
| 696 | (line-beginning-position)))) | ||
| 697 | 0) ; unknown position | ||
| 693 | type | 698 | type |
| 694 | (apply 'format string args)))) | 699 | (apply 'format string args)))) |
| 695 | 700 | ||