From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:306:f42::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id EJUPMoO4/mEwfQAAsNZ9tg (envelope-from ) for ; Sat, 05 Feb 2022 17:48:51 +0000 Received: from out1.migadu.com ([2001:41d0:2:863f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id YM+UMYO4/mEO9AAAauVa8A (envelope-from ) for ; Sat, 05 Feb 2022 18:48:51 +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=1644083331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NetPGqwz2Yy9jFRU431ddTn9cK6FsAcEdt5/04yRZp8=; b=k8HKVfFm7/yqQhz9cdKG6E3/Yjr0STNd4FRG48KmNZwUB9VOa0u2Nu0Rm5VItzxWjRR2ON G9vyi6bkRZoVC5n45uB7hDFSnhH8nEVDeoEzaF0GBy2IxXrDuVGnpYxKm47CMOM7HG8pYx bfLljvwQZMIFPA58H9971GDU8Op+0+RN2uwXD5F5O1BTFcg/NIEYPtOhFfOx9pAj39rthn 14IjMs+spTkeQRbKLpzpEt+2N9g8mWVfs3FwOsxO5MHg4xRWuwAZtF7Fs7kUBJaxIefj/1 aoTvPWakHHHSzpRV/Sdzcw+wSsWbYo28lJUq5eCLyT38jGL48TNDi2Qp6dVC6Q== From: Kyle Meyer To: piem@inbox.kyleam.com Subject: Re: [RFC PATCH 06/14] edit patch: Inject values via interactive arguments In-Reply-To: <20211229235036.372313-7-kyle@kyleam.com> References: <20211229235036.372313-1-kyle@kyleam.com> <20211229235036.372313-7-kyle@kyleam.com> Date: Sat, 05 Feb 2022 12:48:49 -0500 Message-ID: <87r18hkxvi.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyleam.com X-TUID: ctg4omD/3Hhi Kyle Meyer writes: > piem-edit stores values in buffer-local variables that > piem-edit-patch-am then uses in a non-interactive call to piem-am. > That works, but the caller doesn't have access to piem-am's > toggle-worktree argument. And this functionality gap will grow bigger > when an upcoming commit moves transition piem-am to a transient, s/transition // > moving the current piem-am to a suffix. > > Instead teach piem-am--arguments how to pull the mbox and coderepo > from these buffer-local values so that piem-edit-patch-am can just > call piem-am interactively. I don't think I'm going to revisit this series today, but as a note for later ... > [...] > (defun piem-edit () > "Edit an am-ready mbox before feeding it to `git am'." > (interactive) > @@ -1017,12 +1020,7 @@ (defun piem-edit () > (defun piem-edit-patch-am () > "Apply the patch that is currently edited." > (interactive) > - (let ((buf (current-buffer))) > - (piem-am buf > - piem-edit-patch--format > - (piem-extract-mbox-info (current-buffer)) > - piem-edit-patch--coderepo) > - (kill-buffer buf))) > + (call-interactively #'piem-am)) ... I'm not sure why I kept piem-edit around if it's reduced to an interactive call to piem-am. Why not just bind piem-am in piem-edit-patch-mode-map?