diff options
| author | Thanos Apollo <public@thanosapollo.org> | 2026-04-27 00:38:54 +0300 |
|---|---|---|
| committer | Thanos Apollo <public@thanosapollo.org> | 2026-04-27 00:38:54 +0300 |
| commit | c97d205e4e8a40403cfeff20cf02c43a0113e24c (patch) | |
| tree | 72655a3fae5303eed8808601a6e21366aeae8ea4 | |
| parent | 6cb7c54fe8adc1184717039bcf99778d2bdfe10a (diff) | |
vc: Add inapt-if checks to popup commands
| -rw-r--r-- | lisp/forgejo-vc.el | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lisp/forgejo-vc.el b/lisp/forgejo-vc.el index b9976ef..67f949d 100644 --- a/lisp/forgejo-vc.el +++ b/lisp/forgejo-vc.el @@ -459,16 +459,24 @@ and mark it as manually merged after a successful push." ;;; Popup keymap +(defun forgejo-vc--no-remote-p () + "Return non-nil when not in a repo with a Forgejo remote." + (not (forgejo-vc--repo-from-remote))) + (keymap-popup-define forgejo-vc-map "Forgejo operations for the current repository." :group "View" "i" ("Issues" forgejo-vc-issues) "p" ("Pull requests" forgejo-vc-pulls) :group "PR" - "s" ("Submit PR" forgejo-vc-submit :c-u "force push") - "f" ("Fetch PR" forgejo-vc-fetch) - "u" ("Update PR branch" forgejo-vc-update) - "P" ("Push" forgejo-vc-push :c-u "mark PR merged") + "s" ("Submit PR" forgejo-vc-submit :c-u "force push" + :inapt-if (lambda () (forgejo-vc--no-remote-p))) + "f" ("Fetch PR" forgejo-vc-fetch + :inapt-if (lambda () (forgejo-vc--no-remote-p))) + "u" ("Update PR branch" forgejo-vc-update + :inapt-if (lambda () (forgejo-vc--no-remote-p))) + "P" ("Push" forgejo-vc-push :c-u "mark PR merged" + :inapt-if (lambda () (forgejo-vc--no-remote-p))) :group "Actions" "S" ("Settings" forgejo-settings) "b" ("Browse repo" forgejo-vc-browse)) |
