summary refs log tree commit diff stats
path: root/tag-emacs
diff options
context:
space:
mode:
authorAlan Pearce2014-07-23 17:57:57 +0100
committerAlan Pearce2014-07-23 17:57:57 +0100
commit3670531f404f2f17327676c46f9487ca60e50547 (patch)
tree98c214dfbd2cdd83d40b8b3995a4b16001a47c66 /tag-emacs
parent656d10b19d09c72b4cc14e96c7639e92493ee853 (diff)
downloadnixfiles-3670531f404f2f17327676c46f9487ca60e50547.tar.lz
nixfiles-3670531f404f2f17327676c46f9487ca60e50547.tar.zst
nixfiles-3670531f404f2f17327676c46f9487ca60e50547.zip
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
Diffstat (limited to 'tag-emacs')
-rw-r--r--tag-emacs/emacs.d/init.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el
index 4cd7faa5..f33c9544 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))