From 3670531f404f2f17327676c46f9487ca60e50547 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 23 Jul 2014 17:57:57 +0100 Subject: Emacs: Enable rainbow-mode for xmonad-type files Create a derived mode to enable specific mode hooks for such files Add hook to new mode for enabling rainbow-mode --- tag-emacs/emacs.d/init.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'tag-emacs/emacs.d/init.el') diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el index 4cd7faa..f33c954 100644 --- a/tag-emacs/emacs.d/init.el +++ b/tag-emacs/emacs.d/init.el @@ -148,6 +148,12 @@ ((eq system-type 'darwin) (ap/set-fonts "Monaco" "Helvetica" 12)))) +(req-package rainbow-mode + :commands (rainbow-turn-on + rainbow-turn-off) + :config (progn + (add-hook 'xmonad-mode-hook #'rainbow-turn-on))) + ;;;; Autosaves & Backups (let ((backup-dir (expand-file-name "~/.emacs.d/backups/"))) (unless (file-directory-p backup-dir) @@ -578,8 +584,11 @@ ("\\.Xresources\\'" . xrdb-mode))) (req-package haskell-mode - :mode (("\\.hs\\'" . haskell-mode) - ("xmobarrc\\'" . haskell-mode))) + :mode (("\\.hs\\'" . haskell-mode))) + +(define-derived-mode xmonad-mode haskell-mode "XM") +(add-to-list 'auto-mode-alist '("xmobarrc\\'" . xmonad-mode)) +(add-to-list 'auto-mode-alist '("xmonad.hs\\'" . xmonad-mode)) (req-package nginx-mode :mode (("nginx.conf" . nginx-mode)) -- cgit 1.4.1