Disable file template for .dir-locals.el files

This commit is contained in:
Henrik Lissner 2017-10-28 18:06:47 +02:00
parent 8b11a88aa2
commit 213e933a80
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -31,10 +31,13 @@
(evil-initialize-state 'insert))))
(defun +file-templates-add (args)
(cl-destructuring-bind (regexp trigger mode &optional project-only-p) args
(cl-destructuring-bind (regexp trigger &optional mode project-only-p) args
(define-auto-insert
regexp
(vector `(lambda () (+file-templates--expand ,trigger ',mode ,project-only-p))))))
(if trigger
(vector
`(lambda () (+file-templates--expand ,trigger ',mode ,project-only-p)))
#'ignore))))
(mapc #'+file-templates-add
;; General
@ -51,6 +54,7 @@
("/Makefile$" "__" makefile-gmake-mode)
;; Elisp
("\\.el$" "__initfile" emacs-lisp-mode)
("/.dir-locals.el$" nil)
("-test\\.el$" "__" emacs-ert-mode)
("/.emacs.d/.+\\.el$" "__doom-module" emacs-lisp-mode)
("/.emacs.d/.+/packages\\.el$" "__doom-packages" emacs-lisp-mode)