;;;###autoload
(defcustom compilation-mode-hook nil
- "List of hook functions run by `compilation-mode' (see `run-mode-hooks')."
+ "List of hook functions run by `compilation-mode'."
:type 'hook
:group 'compilation)
;;;###autoload
(defcustom compilation-start-hook nil
- "List of hook functions run by `compilation-start' on the compilation process.
-\(See `run-hook-with-args').
-If you use \"omake -P\" and do not want \\[save-buffers-kill-terminal] to ask whether you want
-the compilation to be killed, you can use this hook:
- (add-hook 'compilation-start-hook
- (lambda (process) (set-process-query-on-exit-flag process nil)) nil t)"
+ "Hook run after starting a new compilation process.
+The hook is run with one argument, the new process."
:type 'hook
:group 'compilation)
;;;###autoload
(defcustom compilation-window-height nil
- "Number of lines in a compilation window. If nil, use Emacs default."
+ "Number of lines in a compilation window.
+If nil, use Emacs default."
:type '(choice (const :tag "Default" nil)
integer)
:group 'compilation)
(let ((win (get-buffer-window buffer 0)))
(if win (set-window-point win pos)))
(if compilation-auto-jump-to-first-error
- (compile-goto-error))))
+ (compile-goto-error nil t))))
;; This function is the central driver, called when font-locking to gather
;; all information needed to later jump to corresponding source code.
(define-key map [follow-link] 'mouse-face)
(define-key map "\C-c\C-c" 'compile-goto-error)
(define-key map "\C-m" 'compile-goto-error)
+ (define-key map "\C-o" 'compilation-display-error)
(define-key map "\C-c\C-k" 'kill-compilation)
(define-key map "\M-n" 'compilation-next-error)
(define-key map "\M-p" 'compilation-previous-error)
(define-key map [follow-link] 'mouse-face)
(define-key map "\C-c\C-c" 'compile-goto-error)
(define-key map "\C-m" 'compile-goto-error)
+ (define-key map "\C-o" 'compilation-display-error)
(define-key map "\C-c\C-k" 'kill-compilation)
(define-key map "\M-n" 'compilation-next-error)
(define-key map "\M-p" 'compilation-previous-error)
"This is like `define-derived-mode' without the PARENT argument.
The parent is always `compilation-mode' and the customizable `compilation-...'
variables are also set from the name of the mode you have chosen,
-by replacing the first word, e.g `compilation-scroll-output' from
+by replacing the first word, e.g., `compilation-scroll-output' from
`grep-scroll-output' if that variable exists."
(let ((mode-name (replace-regexp-in-string "-mode\\'" "" (symbol-name mode))))
`(define-derived-mode ,mode compilation-mode ,name
(interactive "p")
(compilation-next-file (- n)))
+(defun compilation-display-error ()
+ "Display the source for current error in another window."
+ (interactive)
+ (setq compilation-current-error (point))
+ (next-error-no-select 0))
+
(defun kill-compilation ()
"Kill the process made by the \\[compile] or \\[grep] commands."
(interactive)
(defalias 'compile-mouse-goto-error 'compile-goto-error)
-(defun compile-goto-error (&optional event)
+(defun compile-goto-error (&optional event nomsg)
"Visit the source for the error message at point.
Use this command in a compilation log buffer. Sets the mark at point there."
(interactive (list last-input-event))
(if (get-text-property (point) 'compilation-directory)
(dired-other-window
(car (get-text-property (point) 'compilation-directory)))
- (push-mark)
+ (push-mark nil nomsg)
(setq compilation-current-error (point))
(next-error-internal)))
;; (setq timestamp compilation-buffer-modtime)))
)
(with-current-buffer
- (compilation-find-file
- marker
- (caar (compilation--loc->file-struct loc))
- (cadr (car (compilation--loc->file-struct loc))))
+ (apply #'compilation-find-file
+ marker
+ (caar (compilation--loc->file-struct loc))
+ (cadr (car (compilation--loc->file-struct loc)))
+ (compilation--file-struct->formats
+ (compilation--loc->file-struct loc)))
(let ((screen-columns
;; Obey the compilation-error-screen-columns of the target
;; buffer if its major mode set it buffer-locally.