From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id IHgJJ96wqF9DPAAAsNZ9tg (envelope-from ) for ; Mon, 09 Nov 2020 03:00:46 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id eKq1It6wqF8WewAAbx9fmQ (envelope-from ) for ; Mon, 09 Nov 2020 03:00:46 +0000 Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3D36C9408E2 for ; Mon, 9 Nov 2020 03:00:41 +0000 (UTC) Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 127B38E34F; Sun, 8 Nov 2020 22:00:40 -0500 (EST) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:date:message-id:mime-version:content-transfer-encoding; s=sasl; bh=N+4koFhjU2oC5ImbmMkTBqeGHyY=; b=AGA7v2G35ywOFnNWbDG4 BIpTudSHYdpPF40zgTH9OHT9frUqD76VNINzgFWoXEVffiqFhFJxIKuKlXldHIg9 87jr6+TFcyMBjhLyG2XxHAmVL+5uPci64eXDiORK+3cOmD/VFptO91IRdrKUZDMJ gNok4mh7Sw2yNTFovxCoFEU= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 08D968E34E; Sun, 8 Nov 2020 22:00:40 -0500 (EST) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:subject:date:message-id:mime-version:content-transfer-encoding; s=mesmtp; bh=CZb4Mq6GHxY9VgR2R7ETxPFKGrGcFaNMbrM2TwpBfWM=; b=SIYpGFOcmX6Cg9vK6sRLcOmwY+mvV/dKZYcyHPynEcUu3nChBrJuwCpZ+oXWS/vypvGPdTRhiygaKeUy4zAjBV3aSP0iqLfQefC9Ks5Z6vJXA05zdnwmJox6RWolRjbJqDuj+UrOfGaqBo9eKhcm7WRcrQyLI/vhG7I/IGtg1C8= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 7BF578E34D; Sun, 8 Nov 2020 22:00:39 -0500 (EST) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: piem@inbox.kyleam.com Subject: [PATCH] Add a dispatch transient for commands Date: Sun, 8 Nov 2020 22:00:34 -0500 Message-Id: <20201109030034.11429-1-kyle@kyleam.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Pobox-Relay-ID: BF6F5AE4-2237-11EB-AD52-D152C8D8090B-24757444!pb-smtp1.pobox.com Content-Transfer-Encoding: quoted-printable X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=AGA7v2G3; dkim=fail (body hash did not verify) header.d=kyleam.com header.s=mesmtp header.b=SIYpGFOc; dmarc=none; spf=pass (aspmx1.migadu.com: domain of kyle@kyleam.com designates 64.147.108.70 as permitted sender) smtp.mailfrom=kyle@kyleam.com X-Spam-Score: 2.50 X-TUID: I1HNG1ICMy3Y A standard prefix command would do, but since piem-b4 already depends on transient, use transient here as well to provide a more helpful interface. --- piem.el | 10 +++++++++- piem.texi | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/piem.el b/piem.el index eb7b2f8..5ad2b94 100644 --- a/piem.el +++ b/piem.el @@ -5,7 +5,7 @@ ;; Author: Kyle Meyer ;; Keywords: vc, tools ;; Version: 0.1.0 -;; Package-Requires: ((emacs "26.3")) +;; Package-Requires: ((emacs "26.3") (transient "0.2.0")) ;; Homepage: https://git.kyleam.com/piem/about/ =20 ;; This program is free software; you can redistribute it and/or modify @@ -43,6 +43,7 @@ (require 'message) (require 'piem-maildir) (require 'rfc2047) (require 'subr-x) +(require 'transient) (require 'url) =20 (defvar url-http-end-of-headers) @@ -699,6 +700,13 @@ (defun piem-am (mbox &optional format info coderepo) (magit-status-setup-buffer) (dired ".")))) =20 +;;;###autoload (autoload 'piem-dispatch "piem" nil t) +(define-transient-command piem-dispatch () + "Invoke a piem command." + [("a" "apply patch" piem-am) + ("b" "call b4-am" piem-b4-am) + ("i" "inject thread into maildir" piem-inject-thread-into-maildir)]) + =0C =20 (defun piem-please () diff --git a/piem.texi b/piem.texi index 131ab44..a201948 100644 --- a/piem.texi +++ b/piem.texi @@ -119,6 +119,21 @@ designed to work with public-inbox archives.) =0C @node Getting started @chapter Getting started +@findex piem-dispatch + +@code{piem-dispatch} transient +(see +@ifinfo +@ref{Top,,,transient} +@end ifinfo +@ifnotinfo +@url{https://magit.vc/manual/transient/} +@end ifnotinfo +) +provides an entry point to piem commands. +It's recommended to bind @code{piem-dispatch} to a key. However, before +most of those commands do anything useful, you need to register inboxes +and activate at least one minor mode. =20 @node Registering inboxes @section Registering inboxes base-commit: 524862221a0928ef707cb5ab91cea8cf50bc3168 --=20 2.28.0