From b459881bd6ac3234baf588f273062d9ad5429873 Mon Sep 17 00:00:00 2001 From: tastytea Date: Tue, 13 Oct 2020 23:37:03 +0200 Subject: [PATCH] Emacs: Interpret ANSI colors in compilation output. --- init.d/text/misc.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/init.d/text/misc.el b/init.d/text/misc.el index b02209e..72a85cb 100644 --- a/init.d/text/misc.el +++ b/init.d/text/misc.el @@ -1,6 +1,6 @@ ;;; misc.el --- Miscellaneous file formats. -*- lexical-binding: t; -*- -;; Time-stamp: <2020-10-07T18:48:40+0200> +;; Time-stamp: <2020-10-13T23:36:21+0200> ;;; Commentary: @@ -196,8 +196,9 @@ :config (defun my/display-ansi-colors () (interactive) (let ((inhibit-read-only t)) - (ansi-color-apply-on-region (point-min) (point-max)))) - :mode ("\\.log$" . my/display-ansi-colors)) + (ansi-color-apply-on-region compilation-filter-start (point)))) + :mode ("\\.log$" . my/display-ansi-colors) + :hook (compilation-filter . my/display-ansi-colors)) ;; Syntax-highlighting mode for text/gemini. (use-package gemini-mode