Make compilation-mode use ansi-color escapes

This commit is contained in:
Adam Goldsmith 2017-09-21 03:28:13 -04:00
parent 1ec4ab9eea
commit f7a3f02ed6

View File

@ -67,6 +67,14 @@
("C-S-z" . compile)) ("C-S-z" . compile))
:config :config
(setq compilation-scroll-output 'first-error) (setq compilation-scroll-output 'first-error)
(require 'ansi-color)
(add-hook 'compilation-filter-hook
(lambda ()
(toggle-read-only 0)
(ansi-color-apply-on-region compilation-filter-start (point))
(toggle-read-only 1)))
(add-hook 'compilation-start-hook (add-hook 'compilation-start-hook
(lambda (x) (setq-local scroll-up-aggressively 0.0)))) (lambda (x) (setq-local scroll-up-aggressively 0.0))))