From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4ea1::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id OBKuKm30zGGdXQAAsNZ9tg (envelope-from ); Wed, 29 Dec 2021 23:51:09 +0000 Received: from out0.migadu.com ([2001:41d0:2:267::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id AEarJ230zGHHaAEAG6o9tA (envelope-from ); Thu, 30 Dec 2021 00:51:09 +0100 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1640821869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+fkR3FkU66HfDvkghJ3CLoBvHwgD5YZ9ApMPG7xrmJc=; b=Zs8F7JVW+0P5n+/aK8f7iEZ1gsFcJogyZTvddCCLgzH3Bcntrsf99LyFClUwp6nowmzHTl BV0/GixSeFz15QequawT2j7Vr5UX5C6yTsMJzUxKOWHKIn+2qSSlWdO5FlQvTCik0Qzwuq VRfL2Ci6G4Xm58d6DuYOxos7SiTSGmSIg9Sfop5jYvw/11LfioJt1UapzU1QoyXTFIFm99 o322kNUF9hhu9eevukv5RLz6H6l5y16nRCBbSIqpgClNAtEUDIMJ7RyD6TS+vmOkK+ylki Y1vZkLTa9ZuWD5AtvTxIqDE92HUssaVm8gTTq4EMa6ZS5xetjg3kt0Frs4on4w== From: Kyle Meyer To: piem@inbox.kyleam.com Subject: [RFC PATCH 10/14] piem-am--arguments: Make info extraction optional Date: Wed, 29 Dec 2021 18:50:32 -0500 Message-Id: <20211229235036.372313-11-kyle@kyleam.com> In-Reply-To: <20211229235036.372313-1-kyle@kyleam.com> References: <20211229235036.372313-1-kyle@kyleam.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyleam.com X-TUID: yQ3qIMB5js01 The new -extend variant won't need it. --- piem.el | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/piem.el b/piem.el index cb931489..c3c2dfdf 100644 --- a/piem.el +++ b/piem.el @@ -936,22 +936,24 @@ (defun piem--git-am (mbox format dir) (defvar-local piem-edit-patch--coderepo nil) (defvar-local piem-edit-patch--format nil) -(defun piem-am--arguments () +(defun piem-am--arguments (&optional with-info) (pcase-let ((`(,mbox . ,format) (or (and (derived-mode-p 'piem-edit-patch-mode) (cons (current-buffer) piem-edit-patch--format)) (piem-am-ready-mbox) (user-error "Could not find am-ready mbox for current buffer")))) - ;; We're responsible for cleaning up the buffer created by - ;; `piem-am-ready-mbox'; sneak in an indication to let the - ;; downstream code know. - (list (cons :interactive mbox) - format - (or piem-edit-patch--coderepo - (piem-inbox-coderepo-maybe-read)) - current-prefix-arg - (piem-extract-mbox-info mbox)))) + (nconc + ;; We're responsible for cleaning up the buffer created by + ;; `piem-am-ready-mbox'; sneak in an indication to let the + ;; downstream code know. + (list (cons :interactive mbox) + format + (or piem-edit-patch--coderepo + (piem-inbox-coderepo-maybe-read)) + current-prefix-arg) + (and with-info + (list (piem-extract-mbox-info mbox)))))) ;;;###autoload (defun piem-am-create (mbox &optional format coderepo toggle-worktree info) @@ -973,7 +975,7 @@ (defun piem-am-create (mbox &optional format coderepo toggle-worktree info) INFO is a plist that with information to help choose a default branch name or starting point (see `piem-default-branch-function' for a list of possible properties)." - (interactive (piem-am--arguments)) + (interactive (piem-am--arguments 'with-info)) (let* ((default-directory (or coderepo default-directory)) (am-directory default-directory) (use-worktree (xor piem-am-create-worktree toggle-worktree))) -- 2.34.0