about summary refs log tree commit diff stats
path: root/.emacs.d/lisp/init-compile.el
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2021-08-17 12:49:19 +0100
committerDavid Morgan <djm_uk@protonmail.com>2021-08-17 12:49:19 +0100
commitd0db5660caa836755ea8c99471d816484ea9e837 (patch)
treec7d0456a58e450abaf34b489b0b31c58ddbc8557 /.emacs.d/lisp/init-compile.el
parentc92b18514728245850d31531ce224a74eddfc5a6 (diff)
downloaddotfiles-d0db5660caa836755ea8c99471d816484ea9e837.tar.gz
Add new .emacs.d
Diffstat (limited to '.emacs.d/lisp/init-compile.el')
-rw-r--r--.emacs.d/lisp/init-compile.el22
1 files changed, 22 insertions, 0 deletions
diff --git a/.emacs.d/lisp/init-compile.el b/.emacs.d/lisp/init-compile.el
new file mode 100644
index 0000000..dd38510
--- /dev/null
+++ b/.emacs.d/lisp/init-compile.el
@@ -0,0 +1,22 @@
+;;; init-compile.el --- Compilation Configuration File -*- lexical-binding: t -*-
+;;; Commentary:
+;; Based on code from prelude-editor.el
+;;; Code:
+
+(use-package compile
+  :ensure nil
+  :custom
+  (compilation-ask-about-save nil)
+  (compilation-always-kill t)
+  (compilation-scroll-output 'first-error))
+
+;; http://stackoverflow.com/a/3072831/355252
+(use-package ansi-color
+  :hook
+  (compilation-filter . (lambda ()
+                          (when (eq major-mode 'compilation-mode)
+                            (let ((inhibit-read-only t))
+                              (ansi-color-apply-on-region (point-min) (point-max)))))))
+
+(provide 'init-compile)
+;;; init-compile.el ends here