>From a9a1b1ef7c272a188745d367745f9ef4fc155be9 Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Thu, 29 Oct 2015 20:48:53 +0300 Subject: [PATCH 2/2] emacs: Enable 'guix-build-log-mode' for build log files. * emacs/guix-build-log.el (auto-mode-alist): Add 'guix-build-log-mode' to 'auto-mode-alist'. --- emacs/guix-build-log.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/emacs/guix-build-log.el b/emacs/guix-build-log.el index c209100..ae2631e 100644 --- a/emacs/guix-build-log.el +++ b/emacs/guix-build-log.el @@ -24,6 +24,8 @@ ;;; Code: +(require 'guix-utils) + (defgroup guix-build-log nil "Settings for `guix-build-log-mode'." :group 'guix) @@ -346,6 +348,18 @@ programmatically using hooks: (when font-lock-mode (font-lock-fontify-buffer))) +;;;###autoload +(add-to-list 'auto-mode-alist + ;; Regexp for log files (usually placed in /var/log/guix/...) + (cons (rx-to-string + `(and "guix/drvs/" + (= 2 (regexp ,guix-hash-char-regexp)) "/" + (= 30 (regexp ,guix-hash-char-regexp)) + "-" (+ (any alnum "-+.")) + ".drv" (? ".bz2") string-end) + t) + 'guix-build-log-mode)) + (provide 'guix-build-log) ;;; guix-build-log.el ends here -- 2.5.0