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

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

[nongnu] elpa/zig-mode 9cff802457: Do not modify global `compilation-fil


From: ELPA Syncer
Subject: [nongnu] elpa/zig-mode 9cff802457: Do not modify global `compilation-filter-hook` (#76)
Date: Fri, 16 Dec 2022 16:59:55 -0500 (EST)

branch: elpa/zig-mode
commit 9cff802457e8d4d5c9f480fb18238fcd472ec009
Author: Ingo Lohmar <ingo.lohmar@posteo.net>
Commit: Joachim Schmidt <joachim.schmidt557@outlook.com>

    Do not modify global `compilation-filter-hook` (#76)
---
 README.md   | 18 ++++++++++++++++++
 zig-mode.el |  7 -------
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/README.md b/README.md
index b7a12371b9..382144ca07 100644
--- a/README.md
+++ b/README.md
@@ -40,6 +40,24 @@ e.g.:
 EMACS=/usr/bin/emacs24 ./run_tests.sh
 ```
 
+## Optional Configuration
+
+`zig-mode` used to enable coloration of the compilation buffer using
+ANSI color codes, but this affected *all* compilation buffers, not just
+zig compilation output.
+If you want to restore this behavior, you can add the following snippet
+to your `init.el` or `.emacs` file:
+
+```elisp
+(if (>= emacs-major-version 28)
+    (add-hook 'compilation-filter-hook 'ansi-color-compilation-filter)
+  (progn
+    (defun colorize-compilation-buffer ()
+      (let ((inhibit-read-only t))
+        (ansi-color-apply-on-region compilation-filter-start (point))))
+    (add-hook 'compilation-filter-hook 'colorize-compilation-buffer)))
+```
+
 ## License
 
 `zig-mode` is distributed under the terms of the GNU General Public License as
diff --git a/zig-mode.el b/zig-mode.el
index 047ddc5c1d..782c80d0e8 100644
--- a/zig-mode.el
+++ b/zig-mode.el
@@ -553,13 +553,6 @@ This is written mainly to be used as 
`end-of-defun-function' for Zig."
 
 ;;;###autoload
 (add-to-list 'auto-mode-alist '("\\.zig\\'" . zig-mode))
-(if (>= emacs-major-version 28)
-    (add-hook 'compilation-filter-hook 'ansi-color-compilation-filter)
-  (progn
-    (defun colorize-compilation-buffer ()
-      (let ((inhibit-read-only t))
-        (ansi-color-apply-on-region compilation-filter-start (point))))
-    (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]