From 43f30a3a89561bf076c32fe7896dccafc443c4ec Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Wed, 18 Feb 2015 09:58:14 +0100 Subject: check-declare.el (check-declare-files): Fix order * 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. --- lisp/emacs-lisp/check-declare.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lisp/emacs-lisp/check-declare.el') 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 -- cgit v1.2.1