(defvar compilation-error-message "No more errors"
"Message to print when no more matches are found.")
+(defvar compilation-arguments nil
+ "Arguments that were given to `compile-internal'.")
+
(defvar compilation-num-errors-found)
(defvar compilation-error-regexp-alist
file-regexp-alist)
(set (make-local-variable 'compilation-nomessage-regexp-alist)
nomessage-regexp-alist)
+ (set (make-local-variable 'compilation-arguments)
+ (list command error-message
+ name-of-mode parser
+ error-regexp-alist name-function
+ enter-regexp-alist leave-regexp-alist
+ file-regexp-alist nomessage-regexp-alist))
(setq default-directory thisdir
compilation-directory-stack (list default-directory))
(set-window-start outwin (point-min))
(compilation-setup)
(set (make-local-variable 'font-lock-defaults)
'(compilation-mode-font-lock-keywords t))
+ (set (make-local-variable 'revert-buffer-function)
+ 'compilation-revert-buffer)
(run-hooks 'compilation-mode-hook))
+(defun compilation-revert-buffer (ignore-auto noconfirm)
+ (if (or noconfirm (yes-or-no-p (format "Restart compilation? ")))
+ (apply 'compile-internal compilation-arguments)))
+
;; Prepare the buffer for the compilation parsing commands to work.
(defun compilation-setup ()
;; Make the buffer's mode line show process state.
(setq compilation-directory-stack
(cons filename compilation-directory-stack)
default-directory filename)))
- (and (eq type 'leave
- stack
- (setq compilation-directory-stack (cdr stack))
- (setq stack (car compilation-directory-stack))
- (setq default-directory stack)))
+ (and (eq type 'leave)
+ stack
+ (setq compilation-directory-stack (cdr stack))
+ (setq stack (car compilation-directory-stack))
+ (setq default-directory stack))
(goto-char end-of-match) ; Prepare to look at next message.
(and limit-search (>= end-of-match limit-search)
;; The user wanted a specific error, and we're past it.