Colorize compilation buffers out-of-the-box

This commit is contained in:
Bozhidar Batsov 2014-04-19 10:29:14 +03:00
parent 53409cc355
commit b51eeff933

View file

@ -374,6 +374,28 @@ indent yanked text (with prefix arg don't indent)."
(setq semanticdb-default-save-directory (setq semanticdb-default-save-directory
(expand-file-name "semanticdb" prelude-savefile-dir)) (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 ;; enable Prelude's keybindings
(prelude-global-mode t) (prelude-global-mode t)