discussion and development of piem
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: piem@inbox.kyleam.com
Subject: [PATCH] Add a dispatch transient for commands
Date: Sun,  8 Nov 2020 22:00:34 -0500	[thread overview]
Message-ID: <20201109030034.11429-1-kyle@kyleam.com> (raw)

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 <kyle@kyleam.com>
 ;; 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/
 
 ;; 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)
 
 (defvar url-http-end-of-headers)
@@ -699,6 +700,13 @@ (defun piem-am (mbox &optional format info coderepo)
         (magit-status-setup-buffer)
       (dired "."))))
 
+;;;###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)])
+
 \f
 
 (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.)
 \f
 @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.
 
 @node Registering inboxes
 @section Registering inboxes

base-commit: 524862221a0928ef707cb5ab91cea8cf50bc3168
-- 
2.28.0


                 reply	other threads:[~2020-11-09  3:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://git.kyleam.com/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201109030034.11429-1-kyle@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=piem@inbox.kyleam.com \
    --subject='Re: [PATCH] Add a dispatch transient for commands' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.kyleam.com/piem/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).