From 442bad66a4e7c162098badd5cd2c350294f2dc85 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Tue, 11 Feb 2020 16:05:22 -0500 Subject: [PATCH] Add ansi-color function --- emacs/init.org | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/emacs/init.org b/emacs/init.org index 2a556d7..f708558 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -581,6 +581,16 @@ Convenience macro to run some code in a particular default-directory: (concat result (substring alnum i (1+ i)))))))) #+END_SRC +A handy function to colorize a buffer with ANSI escape characters in it: +#+BEGIN_SRC emacs-lisp + (defun ansi-color (&optional begin end) + (interactive) + (let ((begin (or begin (point-min))) + (end (or end (point-max))) + (inhibit-read-only t)) + (ansi-color-apply-on-region begin end))) +#+END_SRC + ** Persisting variables between session The idea behind this is pretty simple - variables get persisted in ~/.emacs.d/ as a plist of (variable-name variable-value).