emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/helm 5da20ad1f7 1/2: Ensure init hooks are defined as symb


From: ELPA Syncer
Subject: [nongnu] elpa/helm 5da20ad1f7 1/2: Ensure init hooks are defined as symbol functions
Date: Tue, 26 Jul 2022 12:58:36 -0400 (EDT)

branch: elpa/helm
commit 5da20ad1f78a4e7f5d89abb245ce55122f40772d
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Ensure init hooks are defined as symbol functions
---
 helm-core.el | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/helm-core.el b/helm-core.el
index 67be4243a8..816da6a01d 100644
--- a/helm-core.el
+++ b/helm-core.el
@@ -3697,16 +3697,13 @@ For RESUME INPUT DEFAULT and SOURCES see `helm'."
 (defun helm--run-init-hooks (hook sources)
   "Run after and before init hooks local to source.
 See :after-init-hook and :before-init-hook in `helm-source'."
-  (cl-loop with sname = (cl-ecase hook
-                          (before-init-hook "h-before-init-hook")
-                          (after-init-hook "h-after-init-hook"))
-           with h = (cl-gensym sname)
-           for s in sources
+  (cl-loop for s in sources
            for hv = (assoc-default hook s)
-           if (and hv (not (symbolp hv)))
-           do (set h hv)
-           and do (helm-log-run-hook h)
-           else do (helm-log-run-hook hv)))
+           if (symbolp hv)
+           do (helm-log-run-hook hv)
+           else return
+           (error "`%s' hook in source `%s' not specified as symbol function"
+                  hook (helm-attr 'name s))))
 
 (defun helm-restore-position-on-quit ()
   "Restore position in `helm-current-buffer' when quitting."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]