From ed588077de01a0c1c573e649d3c25017221ce6b6 Mon Sep 17 00:00:00 2001 From: Madeleine Sydney Date: Sun, 2 Feb 2025 11:52:10 -0700 Subject: [PATCH] fix: Mark transient hooks as permanent-local --- users/crumb/programs/emacs/lib/syd-prelude.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/users/crumb/programs/emacs/lib/syd-prelude.el b/users/crumb/programs/emacs/lib/syd-prelude.el index f5eaf9b..b56bd1e 100644 --- a/users/crumb/programs/emacs/lib/syd-prelude.el +++ b/users/crumb/programs/emacs/lib/syd-prelude.el @@ -51,13 +51,15 @@ (defun ,hook-name (&rest _) "Transient hook defined by `with-transient-after'." (cond ((functionp ,hook-or-function*) - (advice-remove ,hook-or-function* (function ,hook-name))) + (advice-remove ,hook-or-function* #',hook-name)) ((symbolp ,hook-or-function*) - (remove-hook ,hook-or-function* (function ,hook-name)))) + (remove-hook ,hook-or-function* #',hook-name))) ,@forms) (cond ((functionp ,hook-or-function*) - (advice-add ,hook-or-function* :before (function ,hook-name))) + (advice-add ,hook-or-function* :before #',hook-name)) ((symbolp ,hook-or-function*) - (add-hook ,hook-or-function* (function ,hook-name))))))) + ;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Setting-Hooks.html#Setting-Hooks-1 + (put ',hook-name 'permanent-local-hook t) + (add-hook ,hook-or-function* #',hook-name)))))) (provide 'syd-prelude)