From f4044b586d04c197325dec36eb35e77fe05028c7 Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Sat, 31 Oct 2015 22:01:45 +0300 Subject: emacs: Enable 'guix-build-log-minor-mode' in shell buffers. * emacs/guix-build-log.el (guix-build-log-minor-mode-activate): New variable. (guix-build-log-minor-mode-activate-maybe): New function. * emacs/guix-init.el: Add it to 'shell-mode-hook'. * doc/emacs.texi (Emacs Build Log): Mention it. --- emacs/guix-build-log.el | 13 +++++++++++++ emacs/guix-init.el | 1 + 2 files changed, 14 insertions(+) (limited to 'emacs') diff --git a/emacs/guix-build-log.el b/emacs/guix-build-log.el index c64946846e..3f78121a90 100644 --- a/emacs/guix-build-log.el +++ b/emacs/guix-build-log.el @@ -102,6 +102,12 @@ "Face for the number of seconds for a phase." :group 'guix-build-log-faces) +(defcustom guix-build-log-minor-mode-activate t + "If non-nil, then `guix-build-log-minor-mode' is automatically +activated in `shell-mode' buffers." + :type 'boolean + :group 'guix-build-log) + (defcustom guix-build-log-mode-hook '() "Hook run after `guix-build-log-mode' is entered." :type 'hook @@ -346,6 +352,13 @@ programmatically using hooks: (when font-lock-mode (font-lock-fontify-buffer))) +;;;###autoload +(defun guix-build-log-minor-mode-activate-maybe () + "Activate `guix-build-log-minor-mode' depending on +`guix-build-log-minor-mode-activate' variable." + (when guix-build-log-minor-mode-activate + (guix-build-log-minor-mode))) + ;;;###autoload (add-to-list 'auto-mode-alist ;; Regexp for log files (usually placed in /var/log/guix/...) diff --git a/emacs/guix-init.el b/emacs/guix-init.el index 4b3d9c281c..1612dee83f 100644 --- a/emacs/guix-init.el +++ b/emacs/guix-init.el @@ -15,5 +15,6 @@ avoid loading autoloads of Emacs packages installed in (guix-emacs-load-autoloads 'all)) (add-hook 'scheme-mode-hook 'guix-devel-activate-mode-maybe) +(add-hook 'shell-mode-hook 'guix-build-log-minor-mode-activate-maybe) (provide 'guix-init) -- cgit 1.4.1