]> code.delx.au - dotemacs/commitdiff
stumpwm-mode can be activated with auto-mode-list
authorJames Bunton <jamesbunton@delx.net.au>
Wed, 24 May 2017 11:20:27 +0000 (21:20 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Wed, 24 May 2017 11:20:27 +0000 (21:20 +1000)
lisp/my-file-modes.el

index 6020b4cf2e8848197e7c6cc453f8aa264d3ad0bb..ca984a30dabed65ab08b88ceafe5bef7530ab5f4 100644 (file)
 (require 'ssh-file-modes)
 
 (when (require 'stumpwm-mode nil 'noerror)
-  (add-hook 'find-file-hook
-            (lambda ()
-              (when (string=
-                     ".stumpwmrc"
-                     (file-name-nondirectory (buffer-file-name)))
-                (stumpwm-mode)))))
+  (add-to-list 'auto-mode-alist '("/\\.stumpwmrc\\'" . stumpwm-mode)))
 
 (require 'yaml-mode)