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).