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

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

[nongnu] elpa/helm 9c3a1325ba 2/4: Use dotimes in helm-map to allow unqu


From: ELPA Syncer
Subject: [nongnu] elpa/helm 9c3a1325ba 2/4: Use dotimes in helm-map to allow unquoting lambda
Date: Mon, 4 Jul 2022 14:58:37 -0400 (EDT)

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

    Use dotimes in helm-map to allow unquoting lambda
---
 helm-core.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/helm-core.el b/helm-core.el
index 4f50881da4..4c48fa61cf 100644
--- a/helm-core.el
+++ b/helm-core.el
@@ -281,12 +281,13 @@ and vectors, so don't use strings to define them."
     ;; Use `describe-mode' key in `global-map'.
     (cl-dolist (k (where-is-internal #'describe-mode global-map))
       (define-key map k #'helm-help))
-    ;; Bind all actions from 1 to 12 to their corresponding nth index+1.
-    (cl-loop for n from 0 to 11 do
-             (define-key map (kbd (format "<f%s>" (1+ n)))
-               `(lambda ()
-                  (interactive)
-                  (helm-select-nth-action ,n))))
+    ;; Bind all actions from f1 to f12, `helm-select-nth-action'
+    ;; counts from 0, i.e. (helm-select-nth-action 0) = action 1.
+    (dotimes (n 11)
+      (define-key map (kbd (format "<f%s>" (1+ n)))
+        (lambda ()
+          (interactive)
+          (helm-select-nth-action n))))
     map)
   "Keymap for helm.")
 



reply via email to

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