From bad69f61645fce3238396940cacf8b00870f9035 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 25 Oct 2016 22:12:42 -0700 Subject: [PATCH] [Emacs] Clean up colorize compilation buffers --- dotfiles/emacs.d/README.org | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 01798b2e..8646f657 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -4313,15 +4313,17 @@ Set the character used to represent spaces to ยท, and the character used for tab #+END_SRC ** Colorize Compliation Buffers - This automatically applies ansi-color interpretation of terminal escape sequences to compilation buffers +This automatically applies ansi-color interpretation of terminal escape +sequences to compilation buffers. #+BEGIN_SRC emacs-lisp (defun colorize-compilation-buffer () - (read-only-mode) - (ansi-color-apply-on-region (point-min) (point-max)) - (read-only-mode)) + (let ((was-read-only read-only-mode)) + (when was-read-only (read-only-mode -1)) + (ansi-color-apply-on-region (point-min) (point-max)) + (when was-read-only (read-only-mode +1)))) + (add-hook 'compilation-filter-hook 'colorize-compilation-buffer) #+END_SRC - ** Automatic Theme Changer Disabled for now #+BEGIN_SRC emacs-lisp