aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Ángel Moreno <mail@migalmoreno.com>2022-04-21 23:33:56 +0200
committerMiguel Ángel Moreno <mail@migalmoreno.com>2022-04-21 23:33:56 +0200
commit0a54d478cfaa1a9cefddaf2196f0cc91a46f7bd9 (patch)
tree0a5a0f7beb160278cfa255e18a406d88e306873b
parent1e1a360957be67d7ca69a364ed5780fb345e3ef7 (diff)
fdroid.el: Adds map and binds commands
-rw-r--r--fdroid.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/fdroid.el b/fdroid.el
index 771d594..3fd25d0 100644
--- a/fdroid.el
+++ b/fdroid.el
@@ -22,6 +22,10 @@
(defvar fdroid--packages nil
"Holds the list of cached packages from the current F-Droid repository.")
+
+(defvar fdroid-map nil
+ "Map to bind `fdroid' commands to.")
+
(cl-defmacro fdroid-with--fdroidcl (commands message &body body)
"Executes `fdroid-program' with COMMANDS, runs BODY in the context of the result,
and shows MESSAGE after completion."
@@ -35,7 +39,7 @@ and shows MESSAGE after completion."
:buffer (current-buffer)
:command (append (list fdroid-program)
,commands)
- :sentinel (lambda (p e)
+ :sentinel (lambda (p _e)
(cond
((and (= (process-exit-status p) 0)
fdroid-log-events
@@ -196,6 +200,14 @@ for a MULTIPLE package selection."
("u" fdroid-uninstall)
("s" fdroid-show))
+(define-prefix-command 'fdroid-map)
+(define-key fdroid-map [?l] #'fdroid-list-packages)
+(define-key fdroid-map [?i] #'fdroid-install)
+(define-key fdroid-map [?d] #'fdroid-download)
+(define-key fdroid-map [?u] #'fdroid-uninstall)
+(define-key fdroid-map [?s] #'fdroid-show)
+(define-key fdroid-map [?I] #'fdroid-install-multiple)
+
(add-to-list 'embark-keymap-alist '(fdroid . embark-fdroid-actions))
(provide 'fdroid)