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

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

[nongnu] elpa/helm 00d1679561 1/6: Rewrite helm-info-lookup-fallback-sou


From: ELPA Syncer
Subject: [nongnu] elpa/helm 00d1679561 1/6: Rewrite helm-info-lookup-fallback-source
Date: Tue, 27 Feb 2024 13:04:38 -0500 (EST)

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

    Rewrite helm-info-lookup-fallback-source
---
 helm-elisp.el | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/helm-elisp.el b/helm-elisp.el
index 61c542d720..c8bee2fd36 100644
--- a/helm-elisp.el
+++ b/helm-elisp.el
@@ -749,23 +749,23 @@ is only used to test DEFAULT."
               ("Info lookup" . helm-info-lookup-symbol))))
 
 (defun helm-info-lookup-fallback-source (candidate)
-  (let ((sym (helm-symbolify candidate))
-        src-name fn)
-    (cond ((class-p sym)
-           (setq fn #'helm-describe-function
-                 src-name "Describe class"))
-          ((cl-generic-p sym)
-           (setq fn #'helm-describe-function
-                 src-name "Describe generic function"))
-          ((fboundp sym)
-           (setq fn #'helm-describe-function
-                 src-name "Describe function"))
-          ((facep sym)
-           (setq fn #'helm-describe-face
-                 src-name "Describe face"))
-          (t
-           (setq fn #'helm-describe-variable
-                 src-name "Describe variable")))
+  (cl-multiple-value-bind (fn src-name)
+      (helm-acase (helm-symbolify candidate)
+        ((guard (class-p it))
+         (list #'helm-describe-function
+               "Describe class"))
+        ((guard (cl-generic-p it))
+         (list #'helm-describe-function
+               "Describe generic function"))
+        ((guard (fboundp it))
+         (list #'helm-describe-function
+               "Describe function"))
+        ((guard (facep it))
+         (list #'helm-describe-face
+               "Describe face"))
+        (t
+         (list #'helm-describe-variable
+               "Describe variable")))
     (helm-build-sync-source src-name
       :candidates (list candidate)
       :persistent-action (lambda (candidate)



reply via email to

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