Commit 6c82aafc authored by Stefan Kangas's avatar Stefan Kangas

Add auto-insert skeleton for ".dir-locals.el"

* lisp/autoinsert.el (auto-insert-alist): Add auto-insert skeleton for
".dir-locals.el".
parent 730e7da7
......@@ -162,6 +162,29 @@ If this contains a %s, that will be replaced by the matching rule."
(replace-match (capitalize (user-login-name)) t t))
'(end-of-line 1) " <" (progn user-mail-address) ">\n")
(".dir-locals.el"
nil
";;; Directory Local Variables\n"
";;; For more information see (info \"(emacs) Directory Variables\")\n\n"
"(("
'(setq v1 (let (modes)
(mapatoms (lambda (mode)
(let ((name (symbol-name mode)))
(when (string-match "-mode$" name)
(add-to-list 'modes name)))))
(sort modes 'string<)))
(completing-read "Local variables for mode: " v1 nil t)
" . (("
(let ((all-variables
(apropos-internal ".*"
(lambda (symbol)
(and (boundp symbol)
(get symbol 'variable-documentation))))))
(completing-read "Variable to set: " all-variables))
" . "
(completing-read "Value to set it to: " nil)
"))))\n")
(("\\.el\\'" . "Emacs Lisp header")
"Short description: "
";;; " (file-name-nondirectory (buffer-file-name)) " --- " str
......@@ -315,7 +338,7 @@ described above, e.g. [\"header.insert\" date-and-author-update]."
;; There's no custom equivalent of "repeat" for vectors.
:value-type (choice file function
(sexp :tag "Skeleton or vector")))
:version "25.1")
:version "27.1")
;; Establish a default value for auto-insert-directory
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment