use-package on v28 is going to kill me

The :config doesn't always run!?
This commit is contained in:
Howard Abrams 2022-09-28 13:38:56 -07:00
parent 530a7b6b5a
commit 4bf3d05e07

View file

@ -131,7 +131,7 @@ Seems the best [[https://github.com/hlissner/doom-snippets][collection of snippe
** Auto Insert Templates
The [[https://www.emacswiki.org/emacs/AutoInsertMode][auto-insert]] feature is a wee bit complicated. All I want is to associate a filename regular expression with a YASnippet template. I'm stealing some ideas from Henrik Lissner's [[https://github.com/hlissner/doom-emacs/blob/develop/modules/editor/file-templates/autoload.el][set-file-template!]] macro, but simpler?
#+begin_src emacs-lisp
(use-package autoinsert
(use-package autoinsert
:init
(setq auto-insert-directory (expand-file-name "templates" user-emacs-directory))
;; Don't prompt before insertion:
@ -142,7 +142,7 @@ The [[https://www.emacswiki.org/emacs/AutoInsertMode][auto-insert]] feature is a
#+end_src
Since auto insertion requires entering data for particular fields, and for that Yasnippet is better, so in this case, we combine them:
#+begin_src emacs-lisp
(defun ha-autoinsert-yas-expand()
(defun ha-autoinsert-yas-expand()
"Replace text in yasnippet template."
(yas-expand-snippet (buffer-string) (point-min) (point-max)))
#+end_src