From c97d205e4e8a40403cfeff20cf02c43a0113e24c Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Mon, 27 Apr 2026 00:38:54 +0300 Subject: vc: Add inapt-if checks to popup commands --- lisp/forgejo-vc.el | 16 ++++++++++++---- 1 file 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)) -- cgit v1.0