forked from colonelpanic/dotfiles
[Emacs] Fix colorize-compilation-mode read-only settings
This commit is contained in:
parent
ebad6af6ae
commit
7d71f2feb0
@ -4422,13 +4422,17 @@ Set the character used to represent spaces to ·, and the character used for tab
|
|||||||
This automatically applies ansi-color interpretation of terminal escape
|
This automatically applies ansi-color interpretation of terminal escape
|
||||||
sequences to compilation buffers.
|
sequences to compilation buffers.
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defun colorize-compilation-buffer ()
|
(defun imalison:colorize-compilation-buffer ()
|
||||||
(let ((was-read-only read-only-mode))
|
(let ((was-read-only buffer-read-only))
|
||||||
(when was-read-only (read-only-mode -1))
|
(unwind-protect
|
||||||
(ansi-color-apply-on-region (point-min) (point-max))
|
(progn
|
||||||
(when was-read-only (read-only-mode +1))))
|
(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)
|
(add-hook 'compilation-filter-hook 'imalison:colorize-compilation-buffer)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Automatic Theme Changer
|
** Automatic Theme Changer
|
||||||
Disabled for now
|
Disabled for now
|
||||||
|
Loading…
Reference in New Issue
Block a user