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
Alan Pearce alan@alanpearce.co.uk
Wed, 23 Jul 2014 17:57:57 +0100
1 files changed, 11 insertions(+), 2 deletions(-)
jump to
M tag-emacs/emacs.d/init.el → tag-emacs/emacs.d/init.el
@@ -148,6 +148,12 @@ (ap/set-fonts "Consolas" "Segoe UI" 10)) ((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 @@ :mode (("\\.Xdefaults\\'" . xrdb-mode) ("\\.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))