Emacs: Translate ANSI escape color codes in log files.
This commit is contained in:
parent
096d913e8b
commit
4bb50bf5cd
|
@ -1,6 +1,6 @@
|
|||
;;; misc.el --- Miscellaneous file formats. -*- lexical-binding: t; -*-
|
||||
|
||||
;; Time-stamp: <2020-05-24T22:52:15+0200>
|
||||
;; Time-stamp: <2020-05-26T02:00:55+0200>
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
|
@ -160,5 +160,13 @@
|
|||
:repo "https://anongit.gentoo.org/git/proj/ebuild-mode.git")))
|
||||
:hook (ebuild-mode . (lambda () (set-fill-column 80))))
|
||||
|
||||
;; Translate ANSI escape color codes.
|
||||
(use-package ansi-color
|
||||
:config (defun my/display-ansi-colors ()
|
||||
(interactive)
|
||||
(let ((inhibit-read-only t))
|
||||
(ansi-color-apply-on-region (point-min) (point-max))))
|
||||
:mode ("\\.log$" . my/display-ansi-colors))
|
||||
|
||||
(provide 'text/misc)
|
||||
;;; misc.el ends here
|
||||
|
|
Loading…
Reference in New Issue
Block a user