summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfpi2020-06-06 15:38:19 +0200
committerfpi2020-06-08 20:13:37 +0200
commit9e835276715b46099f08c4e7e8981bef0deff004 (patch)
tree28ebd01c90b486fa991303e8313c40d390ad094e
parentSwitch from obsolete org-pdfview to org-pdftools (diff)
Add support for ansi-colors in compilation buffer output
Diffstat (limited to '')
-rw-r--r--emacs-init.org13
1 files changed, 13 insertions, 0 deletions
diff --git a/emacs-init.org b/emacs-init.org
index 416a5ef..6f114fd 100644
--- a/emacs-init.org
+++ b/emacs-init.org
@@ -3217,6 +3217,19 @@ For now I use this bad code.
(lambda ()
(define-key gnus-summary-mode-map (kbd ";") 'bbdb-mua-edit-field)))
#+end_src
+** Compile
+Fix ansi colors in compile buffers. From [[https://endlessparentheses.com/ansi-colors-in-the-compilation-buffer-output.html][endlessparentheses]].
+#+begin_src emacs-lisp
+(use-package compile
+ :config
+ (require 'ansi-color)
+ (defun endless/colorize-compilation ()
+ "Colorize from `compilation-filter-start' to `point'."
+ (let ((inhibit-read-only t))
+ (ansi-color-apply-on-region
+ compilation-filter-start (point))))
+ :hook (compilation-filter . endless/colorize-compilation))
+#+END_src
** Context aware hydra
:PROPERTIES:
:ID: 22750e48-aaee-4f60-bdce-1d511ebe3375