From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id ADU7DZLosF6yZgAA0tVLHw (envelope-from ) for ; Tue, 05 May 2020 04:16:18 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id eOMIHpzosF71CwAAB5/wlQ (envelope-from ) for ; Tue, 05 May 2020 04:16:28 +0000 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:470:142::17]) (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 73707944563 for ; Tue, 5 May 2020 04:16:27 +0000 (UTC) Received: from localhost ([::1]:35056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVp0N-0001ia-TF for larch@yhetil.org; Tue, 05 May 2020 00:16:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVozd-0001gZ-7J for emacs-orgmode@gnu.org; Tue, 05 May 2020 00:15:41 -0400 Received: from pb-smtp21.pobox.com ([173.228.157.53]:64875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVozc-0001rP-7C for emacs-orgmode@gnu.org; Tue, 05 May 2020 00:15:40 -0400 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 31D6CC0703; Tue, 5 May 2020 00:15:39 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=7dggB5btrxkl+G8gacLOXbsCY 4Y=; b=gP2ccCFH5RztOmbb0aUbEgokf6F7P+e1J6m9yOYX7Syew1pzGI6bLC1Mq +cbG90844JtosXDK54coFct4nQIyEQiRlwFZC49XjcJyMFE7bCeGhKTaB7iXWSEr 4F3B5PwmoNlsi1k2cId+Yn3pwD/CfgyV5muEL0dgdNWdq6X5uU= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 2B76BC0702; Tue, 5 May 2020 00:15:39 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:cc:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=mesmtp; bh=wrmweO3OuKlbB/qOX/ah37TZQSMrSGEBlgHlmkXj9tY=; b=DTmHTI6KKfptrN2sedoavsEBQjMKhEyarLbEF7Od1Vryh/SPEj1wCQTRDozV+LbdOZv4ve6MO9IFILq0ODbXpi7+TWvXOvqnlcZTaLTVKlHRy0A3/t4zgktKtDThsFbZZEOvT/8vwyunhKTexdvpMGTX6Av0yQdtlR1FiDIiGjM= 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-smtp21.pobox.com (Postfix) with ESMTPSA id A2329C0701; Tue, 5 May 2020 00:15:36 -0400 (EDT) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: Axel Kielhorn , emacs-orgmode@gnu.org Subject: [PATCH 4/4] org: Retain prefix arg when dispatching dynamic block commands Date: Tue, 5 May 2020 00:15:22 -0400 Message-Id: <20200505041522.30222-5-kyle@kyleam.com> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200505041522.30222-1-kyle@kyleam.com> References: <3CE37EF0-6C7A-4CC0-AFEE-2B82296D63E1@axelkielhorn.de> <20200505041522.30222-1-kyle@kyleam.com> MIME-Version: 1.0 X-Pobox-Relay-ID: 124A27D4-8E87-11EA-9849-8D86F504CC47-24757444!pb-smtp21.pobox.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=173.228.157.53; envelope-from=kyle@kyleam.com; helo=pb-smtp21.pobox.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/05 00:15:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 X-Spam-Score: 3.49 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=pobox.com header.s=sasl header.b=gP2ccCFH; dkim=fail (body hash did not verify) header.d=kyleam.com header.s=mesmtp header.b=DTmHTI6K; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scan-Result: default: False [3.49 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.49536587588236]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2001:470:142::/48:c]; R_MISSING_CHARSET(2.50)[]; DWL_DNSWL_FAIL(0.00)[2001:470:142::17:server fail]; R_DKIM_REJECT(1.00)[pobox.com:s=sasl,kyleam.com:s=mesmtp]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.13), country: US(-0.00), ip: 2001:470:142::17(-0.50)]; DKIM_TRACE(0.00)[pobox.com:-,kyleam.com:-]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_IN_DNSWL_FAIL(0.00)[2001:470:142::17:server fail]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:2001:470:142::/48, country:US]; TAGGED_FROM(0.00)[larch=yhetil.org]; FROM_NEQ_ENVFROM(0.00)[kyle@kyleam.com,emacs-orgmode-bounces@gnu.org]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[kyleam.com]; HAS_LIST_UNSUB(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; RCVD_COUNT_SEVEN(0.00)[7]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: Q+o6PAVQpLpj * lisp/org.el (org-dynamic-block-insert-dblock): Add an interactive-p argument that is non-nil for interactive calls and signals to call the dynamic block function interactively. org-clock-report takes a prefix argument. When it had a regular binding, this was easy to access. As of 34b71a0ca (Add a dispatcher command for inserting dynamic blocks, 2018-12-23), its only "binding" is through the dynamic block dispatcher. Make it possible to supply a prefix argument in that context too. --- lisp/org.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index bf82a49cc..751223f06 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9652,15 +9652,18 @@ (defun org-dynamic-block-define (type func) (`nil (push (cons type func) org-dynamic-block-alist)) (def (setcdr def func)))) =20 -(defun org-dynamic-block-insert-dblock (type) +(defun org-dynamic-block-insert-dblock (type &optional interactive-p) "Insert a dynamic block of type TYPE. When used interactively, select the dynamic block types among -defined types, per `org-dynamic-block-define'." +defined types, per `org-dynamic-block-define'. If INTERACTIVE-P +is non-nil, call the dynamic block function interactively." (interactive (list (completing-read "Dynamic block: " - (org-dynamic-block-types)))) + (org-dynamic-block-types)) + t)) (pcase (org-dynamic-block-function type) (`nil (error "No such dynamic block: %S" type)) - ((and f (pred functionp)) (funcall f)) + ((and f (pred functionp)) + (if interactive-p (call-interactively f) (funcall f))) (_ (error "Invalid function for dynamic block %S" type)))) =20 (defun org-dblock-update (&optional arg) --=20 2.26.1