emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/zig-mode 0182024e2d 1/2: colorize-compilation-buffer: Use


From: ELPA Syncer
Subject: [nongnu] elpa/zig-mode 0182024e2d 1/2: colorize-compilation-buffer: Use inhibit-read-only
Date: Sat, 21 May 2022 07:58:48 -0400 (EDT)

branch: elpa/zig-mode
commit 0182024e2dc8cedf1d226a2faebae466cfadff91
Author: Erik Arvstedt <erik.arvstedt@gmail.com>
Commit: Joachim Schmidt <joachim.schmidt557@outlook.com>

    colorize-compilation-buffer: Use inhibit-read-only
    
    This is the idiomatic way to modify a read-only buffer.
---
 zig-mode.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/zig-mode.el b/zig-mode.el
index 3baee90932..4fe1e65768 100644
--- a/zig-mode.el
+++ b/zig-mode.el
@@ -552,9 +552,8 @@ This is written mainly to be used as 
`end-of-defun-function' for Zig."
        (zig-format-buffer)))
 
 (defun colorize-compilation-buffer ()
-  (read-only-mode 0)
-  (ansi-color-apply-on-region compilation-filter-start (point))
-  (read-only-mode 1))
+  (let ((inhibit-read-only t))
+    (ansi-color-apply-on-region compilation-filter-start (point))))
 
 ;;;###autoload
 (add-to-list 'auto-mode-alist '("\\.zig\\'" . zig-mode))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]