From c3ab73476702c4060b5847fb911fd3ab5999f220 Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 14 Oct 2020 00:20:58 +0200 Subject: [PATCH] Emacs: Allow my/apply-ansi-colors-on-buffer in read-only buffers. --- init.d/text/misc.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.d/text/misc.el b/init.d/text/misc.el index 5cd32e6..9a14e4b 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-14T00:01:20+0200> +;; Time-stamp: <2020-10-14T00:08:06+0200> ;;; Commentary: @@ -197,7 +197,8 @@ (defun my/apply-ansi-colors-on-buffer () "Apply ANSI colors in the current buffer." (interactive) - (ansi-color-apply-on-region (point-min) (point-max))) + (let ((inhibit-read-only t)) + (ansi-color-apply-on-region (point-min) (point-max)))) (defun my/apply-ansi-colors-compilation () "Apply ANSI colors in the compilation window." (let ((inhibit-read-only t))