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

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

[nongnu] elpa/helm f5159e17b8: Revert "Ensure init hooks are defined as


From: ELPA Syncer
Subject: [nongnu] elpa/helm f5159e17b8: Revert "Ensure init hooks are defined as symbol functions" (Fix #2534)
Date: Wed, 27 Jul 2022 01:58:34 -0400 (EDT)

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

    Revert "Ensure init hooks are defined as symbol functions" (Fix #2534)
    
    This reverts commit 5da20ad1f78a4e7f5d89abb245ce55122f40772d.
---
 helm-core.el | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/helm-core.el b/helm-core.el
index 816da6a01d..67be4243a8 100644
--- a/helm-core.el
+++ b/helm-core.el
@@ -3697,13 +3697,16 @@ 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 for s in sources
+  (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
            for hv = (assoc-default hook s)
-           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))))
+           if (and hv (not (symbolp hv)))
+           do (set h hv)
+           and do (helm-log-run-hook h)
+           else do (helm-log-run-hook hv)))
 
 (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]