emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/zig-mode 4eafa60 050/104: colorize compilation buffer


From: ELPA Syncer
Subject: [nongnu] elpa/zig-mode 4eafa60 050/104: colorize compilation buffer
Date: Sun, 29 Aug 2021 11:37:01 -0400 (EDT)

branch: elpa/zig-mode
commit 4eafa60ac44451cfc4b41ce8ae65e4471ddca296
Author: Marcio Giaxa <i@mgxm.me>
Commit: Marcio Giaxa <i@mgxm.me>

    colorize compilation buffer
---
 zig-mode.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/zig-mode.el b/zig-mode.el
index 5100009..294e0da 100644
--- a/zig-mode.el
+++ b/zig-mode.el
@@ -421,8 +421,15 @@ If given a SOURCE, execute the CMD on it."
 (defun zig-before-save-hook ()
   (when zig-format-on-save
        (zig-format-buffer)))
+
+(defun colorize-compilation-buffer ()
+  (toggle-read-only)
+  (ansi-color-apply-on-region compilation-filter-start (point))
+  (toggle-read-only))
+
 ;;;###autoload
 (add-to-list 'auto-mode-alist '("\\.zig\\'" . zig-mode))
+(add-hook 'compilation-filter-hook 'colorize-compilation-buffer)
 
 (provide 'zig-mode)
 ;;; zig-mode.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]