>From 014240765570257fd5c8499d78d1eae8149df756 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Tue, 5 Feb 2013 18:48:28 +0800 Subject: [PATCH 2/2] Display current error rank/total --- lisp/progmodes/compile.el | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 8b5e3a81..0c3265ce 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -136,7 +136,7 @@ (defvar compilation-error "error" (defvar compilation-arguments nil "Arguments that were given to `compilation-start'.") -(defvar compilation-num-errors-found) +(defvar compilation-num-errors-found 0) ;; If you make any changes to `compilation-error-regexp-alist-alist', ;; be sure to run the ERT test in test/automated/compile-tests.el. @@ -895,9 +895,9 @@ (cl-defstruct (compilation--message (:constructor nil) (:copier nil) ;; (:type list) ;Old representation. - (:constructor compilation--make-message (loc type end-loc)) + (:constructor compilation--make-message (loc type end-loc &optional rank)) (:conc-name compilation--message->)) - loc type end-loc) + loc type end-loc rank) (defvar compilation--previous-directory-cache nil "A pair (POS . RES) caching the result of previous directory search. @@ -1181,8 +1181,11 @@ (defun compilation-internal-error-properties (file line end-line col end-col typ end-marker)))) ;; Must start with face + (setq-local compilation-num-errors-found + (1+ compilation-num-errors-found)) `(font-lock-face ,compilation-message-face - compilation-message ,(compilation--make-message loc type end-loc) + compilation-message ,(compilation--make-message + loc type end-loc compilation-num-errors-found) help-echo ,(if col "mouse-2: visit this file, line and column" (if line @@ -2281,8 +2284,12 @@ (defun compilation-next-error (n &optional different-file pt) (compilation-loop < previous-single-property-change 1+ "Moved back before first %s" (point-min)))) (goto-char pt) - (or msg - (error "No %s here" compilation-error)))) + (when msg + (message "%s: %s of %s" + (capitalize compilation-error) + (compilation--message->rank msg) + compilation-num-errors-found)) + (or msg (error "No %s here" compilation-error)))) (defun compilation-previous-error (n) "Move point to the previous error in the compilation buffer. -- 1.8.1.1