From c42600d7717fd5774f631690194a5b6cfd341e7d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 5 May 2019 00:01:52 -0400 Subject: [PATCH] Fix void-variable sym errors And remove trailing hyphen on anonymous transient hooks. --- core/core-lib.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/core-lib.el b/core/core-lib.el index 8e43b71a8..084f858d0 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -227,13 +227,14 @@ advised)." (let ((append (if (eq (car forms) :after) (pop forms))) (fn (if (symbolp (car forms)) (intern (format "doom|transient-hook-%s" (pop forms))) - (make-symbol "doom|transient-hook-")))) + (make-symbol "doom|transient-hook")))) `(let ((sym ,hook-or-function)) (fset ',fn (lambda (&rest _) ,@forms - (cond ((functionp sym) (advice-remove sym #',fn)) - ((symbolp sym) (remove-hook sym #',fn))) + (let ((sym ,hook-or-function)) + (cond ((functionp sym) (advice-remove sym #',fn)) + ((symbolp sym) (remove-hook sym #',fn)))) (unintern ',fn nil))) (cond ((functionp sym) (advice-add ,hook-or-function ,(if append :after :before) #',fn))