summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleh Krehel <ohwoeowho@gmail.com>2015-02-18 09:58:14 +0100
committerOleh Krehel <ohwoeowho@gmail.com>2015-02-18 09:58:48 +0100
commit43f30a3a89561bf076c32fe7896dccafc443c4ec (patch)
tree668709ad3d5ccb34d6aaaffeeff59c6a4ac094b5
parented9b01809687a2906dad41d63e2ab7e25acd55de (diff)
downloademacs-scratch/check-declare.tar.gz
check-declare.el (check-declare-files): Fix orderscratch/check-declare
* lisp/emacs-lisp/check-declare.el (check-declare-files): Make the order of the errors that same as in the file. Add code to ensure that `first-error' will work properly.
-rw-r--r--lisp/emacs-lisp/check-declare.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el
index eef2e84b0f2..c2639729fa9 100644
--- a/lisp/emacs-lisp/check-declare.el
+++ b/lisp/emacs-lisp/check-declare.el
@@ -295,16 +295,20 @@ Return a list of any errors found."
(dolist (e (check-declare-sort alist))
(if (setq err (check-declare-verify (car e) (cdr e)))
(setq errlist (cons (cons (car e) err) errlist))))
+ (setq errlist (nreverse errlist))
(if (get-buffer check-declare-warning-buffer)
(kill-buffer check-declare-warning-buffer))
(with-current-buffer (get-buffer-create check-declare-warning-buffer)
(unless (derived-mode-p 'compilation-mode)
- (compilation-mode)))
+ (compilation-mode))
+ (let ((inhibit-read-only t))
+ (insert "\f\n"))
+ (compilation-forget-errors))
;; Sort back again so that errors are ordered by the files
;; containing the declare-function statements.
(dolist (e (check-declare-sort errlist))
- (dolist (f (cdr e))
- (check-declare-warn (car e) (cadr f) (car f) (nth 2 f))))
+ (dolist (f (cdr e))
+ (check-declare-warn (car e) (cadr f) (car f) (nth 2 f))))
errlist))
;;;###autoload