From eb6b4b9b9c56ba2a73952e03e3412cf1fc7f9ce3 Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Wed, 22 Oct 2025 13:19:47 -0400 Subject: [PATCH] fix: load autoloaded functions before patching --- config.org | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config.org b/config.org index 4f71649..4cf772b 100644 --- a/config.org +++ b/config.org @@ -2239,6 +2239,9 @@ When editing a snippet, the binding =C-c C-t= can be used to test it in a fresh Doom's command to create a new snippet, ~+snippets/new~, defines a template inside of itself purely for when creating a snippet through this command. This doesn't make much sense to me when file templates already exist as a standard system in Doom, and snippets are stored inside files! #+begin_src emacs-lisp +;; HACK: Force snippet function to load +(autoload-do-load #'+snippets/new) + (defpatch! nil (defun +snippets/new) (&optional all-modes) "Create a new snippet in `+snippets-dir'. @@ -2275,6 +2278,9 @@ Doom's =file-templates= module extends =yasnippet= to provide a nice file templa This system works well for the most part, but there's a serious issue with its UI: the function that registers file templates, ~set-file-templates!~, takes a plist to configure the template. If this list is empty, an existing template is removed instead. This is not only unintuitive, but it prevents you from having an empty property list, which is often necessary! We'll patch the function to remove this issue with a =:remove= key, as well as to have templates appended to the alist instead of prepended to make the order of templates more clear. #+begin_src emacs-lisp +;; HACK: Force templates function to load +(autoload-do-load #'set-file-template!) + (defpatch! nil (defun +file-templates--set) (pred plist) (if (el-patch-swap (null (car-safe plist))