[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm 9a16c5bd0f 2/3: Add warnings for init-hooks
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm 9a16c5bd0f 2/3: Add warnings for init-hooks |
Date: |
Wed, 3 Aug 2022 05:58:56 -0400 (EDT) |
branch: elpa/helm
commit 9a16c5bd0feeeeba5c198c29213ddb6bfbda7061
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Add warnings for init-hooks
---
helm-source.el | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/helm-source.el b/helm-source.el
index 27fdca76a1..70279a9d8f 100644
--- a/helm-source.el
+++ b/helm-source.el
@@ -1159,7 +1159,16 @@ The header line is based on one of
`persistent-action-if',
(let ((val (if (symbolp it)
(symbol-value it)
it)))
- (setf (slot-value source 'requires-pattern) val))))
+ (setf (slot-value source 'requires-pattern) val)))
+ (let ((sname (slot-value source 'name)))
+ (pcase (slot-value source 'before-init-hook)
+ ((or (and (pred (functionp)) (pred (not symbolp)))
+ (pred (consp)))
+ (warn "Helm source `%s': before-init-hook Should be defined as a
symbol" sname)))
+ (pcase (slot-value source 'after-init-hook)
+ ((or (and (pred (functionp)) (pred (not symbolp)))
+ (pred (consp)))
+ (warn "Helm source `%s': after-init-hook Should be defined as a symbol"
sname)))))
(cl-defmethod helm-setup-user-source ((_source helm-source)))