diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index ed3223a..e3d0ec4 100755 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -6481,9 +6481,14 @@ A package that bundles together common code beautifying tools for many languages Enable ANSI colors in compile buffers: #+BEGIN_SRC emacs-lisp (autoload 'ansi-color-apply-on-region "ansi-color") - (defun colorize-compilation-buffer () - (ansi-color-apply-on-region compilation-filter-start (point-max))) - (add-hook 'compilation-filter-hook #'colorize-compilation-buffer) + + (defun local/postprocess-compilation-buffer () + (goto-char compilation-filter-start) + (when (looking-at "\033c") + (delete-region (point-min) (match-end 0))) + (ansi-color-apply-on-region (point) (point-max))) + + (add-hook 'compilation-filter-hook 'local/postprocess-compilation-buffer) #+END_SRC Set up some keybindings for Comint-mode compilation buffers: