fix: use ansi-color-compilation-filter on emacs28+

I'm using Emacs30 and on my version,
doom-apply-ansi-color-to-compilation-buffer-h does not colorize all the
escape sequences. Using ansi-color-compilation-filter instead fixes this
for me.
This commit is contained in:
StrawberryTea 2023-09-27 18:58:08 -05:00 committed by Henrik Lissner
parent 1e1e6150d8
commit f5be3ec1e5

View file

@ -316,9 +316,10 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
(setq compilation-always-kill t ; kill compilation process before starting another (setq compilation-always-kill t ; kill compilation process before starting another
compilation-ask-about-save nil ; save all buffers on `compile' compilation-ask-about-save nil ; save all buffers on `compile'
compilation-scroll-output 'first-error) compilation-scroll-output 'first-error)
;; Handle ansi codes in compilation buffer (add-hook 'compilation-filter-hook
;; DEPRECATED Use `ansi-color-compilation-filter' when dropping 27.x support (if (< emacs-major-version 28)
(add-hook 'compilation-filter-hook #'doom-apply-ansi-color-to-compilation-buffer-h) #'doom-apply-ansi-color-to-compilation-buffer-h
#'ansi-color-compilation-filter))
;; Automatically truncate compilation buffers so they don't accumulate too ;; Automatically truncate compilation buffers so they don't accumulate too
;; much data and bog down the rest of Emacs. ;; much data and bog down the rest of Emacs.
(autoload 'comint-truncate-buffer "comint" nil t) (autoload 'comint-truncate-buffer "comint" nil t)