Colorize compilation buffers out-of-the-box
This commit is contained in:
parent
53409cc355
commit
b51eeff933
1 changed files with 22 additions and 0 deletions
|
@ -374,6 +374,28 @@ indent yanked text (with prefix arg don't indent)."
|
|||
(setq semanticdb-default-save-directory
|
||||
(expand-file-name "semanticdb" prelude-savefile-dir))
|
||||
|
||||
;; Compilation from Emacs
|
||||
(defun prelude-colorize-compilation-buffer ()
|
||||
"Colorize a compilation mode buffer."
|
||||
(interactive)
|
||||
;; we don't want to mess with child modes such as grep-mode, ack, ag, etc
|
||||
(when (eq major-mode 'compilation-mode)
|
||||
(let ((inhibit-read-only t))
|
||||
(ansi-color-apply-on-region (point-min) (point-max)))))
|
||||
|
||||
(require 'compile)
|
||||
(setq compilation-ask-about-save nil ; Just save before compiling
|
||||
compilation-always-kill t ; Just kill old compile processes before
|
||||
; starting the new one
|
||||
compilation-scroll-output 'first-error ; Automatically scroll to first
|
||||
; error
|
||||
)
|
||||
|
||||
;; Colorize output of Compilation Mode, see
|
||||
;; http://stackoverflow.com/a/3072831/355252
|
||||
(require 'ansi-color)
|
||||
(add-hook 'compilation-filter-hook #'prelude-colorize-compilation-buffer)
|
||||
|
||||
;; enable Prelude's keybindings
|
||||
(prelude-global-mode t)
|
||||
|
||||
|
|
Loading…
Reference in a new issue