summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2019-09-27 16:25:11 +0200
committerAlan Pearce2019-09-27 16:25:11 +0200
commite6e57579b02658d171295b9224532309c06a2320 (patch)
tree7356ae95d4594feb0f4bbf230a14893267b9aca1
parent48dffdc2664f86f486a2c94c1051202af97e2f15 (diff)
downloaddotfiles-e6e57579b02658d171295b9224532309c06a2320.tar.lz
dotfiles-e6e57579b02658d171295b9224532309c06a2320.tar.zst
dotfiles-e6e57579b02658d171295b9224532309c06a2320.zip
Emacs: parse ANSI colour codes in compilation (e.g. tsc) buffers
-rw-r--r--emacs/.emacs.d/main.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/emacs/.emacs.d/main.el b/emacs/.emacs.d/main.el
index c7960ca..88d0d55 100644
--- a/emacs/.emacs.d/main.el
+++ b/emacs/.emacs.d/main.el
@@ -610,6 +610,10 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
 
 ;;;; typescript
 (custom-set-variables '(typescript-indent-level 2))
+(autoload 'ansi-color-apply-on-region "ansi-color")
+(defun colorise-compilation-buffer ()
+  (ansi-color-apply-on-region compilation-filter-start (point-max)))
+(add-hook 'compilation-filter-hook #'colorise-compilation-buffer)
 
 ;;;; shell
 (general-add-hook 'sh-mode-hook