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

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

[nongnu] elpa/helm 355b5da3ff 1/5: Fix warnings with pcase in emacs-27


From: ELPA Syncer
Subject: [nongnu] elpa/helm 355b5da3ff 1/5: Fix warnings with pcase in emacs-27
Date: Tue, 5 Sep 2023 07:00:15 -0400 (EDT)

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

    Fix warnings with pcase in emacs-27
    
    Emacs-27 pcase doesn't understand well (and var (pred ...) (guard ...)
    So let's use helm-aif instead.
---
 helm-source.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/helm-source.el b/helm-source.el
index a12de1e5aa..5f6ec66475 100644
--- a/helm-source.el
+++ b/helm-source.el
@@ -1172,14 +1172,14 @@ The header line is based on one of 
`persistent-action-if',
   ;; a list, if a function an error will raise later anyway when this function
   ;; is called with `run-hooks'.
   (let ((sname (slot-value source 'name)))
-    (pcase (slot-value source 'before-init-hook)
-      ((or (and val (pred (functionp)) (guard (not (symbolp val))))
-           (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 val (pred (functionp)) (guard (not (symbolp val))))
-           (pred (consp)))
-       (warn "Helm source `%s': after-init-hook Should be defined as a symbol" 
sname)))))
+    (helm-aif (slot-value source 'before-init-hook)
+        (when (or (and (functionp it) (not (symbolp it)))
+                  (consp it))
+          (warn "Helm source `%s': before-init-hook Should be defined as a 
symbol" sname)))
+    (helm-aif (slot-value source 'after-init-hook)
+        (when (or (and (functionp it) (not (symbolp it)))
+                  (consp it))
+          (warn "Helm source `%s': after-init-hook Should be defined as a 
symbol" sname)))))
 
 (cl-defmethod helm-setup-user-source ((_source helm-source)))
 



reply via email to

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