mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Add auto-insert skeleton for ".dir-locals.el"
* lisp/autoinsert.el (auto-insert-alist): Add auto-insert skeleton for ".dir-locals.el".
This commit is contained in:
parent
730e7da7ba
commit
6c82aafcc0
1 changed files with 24 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue