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 ms11 with LMTPS id kFGiK1bvBGC8KAAA0tVLHw (envelope-from ) for ; Mon, 18 Jan 2021 02:15:50 +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 UF90J1bvBGBhBwAAbx9fmQ (envelope-from ) for ; Mon, 18 Jan 2021 02:15:50 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.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 3F7879403AE for ; Mon, 18 Jan 2021 02:15:50 +0000 (UTC) Received: from localhost ([::1]:35664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1K57-0007HT-89 for larch@yhetil.org; Sun, 17 Jan 2021 21:15:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1K4Q-0007GN-1e for emacs-orgmode@gnu.org; Sun, 17 Jan 2021 21:15:06 -0500 Received: from mout-p-201.mailbox.org ([80.241.56.171]:13196) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1l1K4N-0001V1-Mk for emacs-orgmode@gnu.org; Sun, 17 Jan 2021 21:15:05 -0500 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4DJwNP456CzQlWp; Mon, 18 Jan 2021 03:15:01 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id xydlYPTqpeUk; Mon, 18 Jan 2021 03:14:52 +0100 (CET) From: Kevin Foley To: Ihor Radchenko , emacs-orgmode@gnu.org Subject: Re: Custom Bulk Functions With Prompt In-Reply-To: <87lfcrvvro.fsf@localhost> References: <871rekxgpf.fsf@localhost> <87lfcrvvro.fsf@localhost> Date: Sun, 17 Jan 2021 21:14:48 -0500 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-MBO-SPAM-Probability: X-Rspamd-Score: -3.64 / 15.00 / 15.00 X-Rspamd-Queue-Id: 7333D171E X-Rspamd-UID: fe65c0 Received-SPF: pass client-ip=80.241.56.171; envelope-from=kevin@kevinjfoley.me; helo=mout-p-201.mailbox.org 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no 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-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.36 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 3F7879403AE X-Spam-Score: -2.36 X-Migadu-Scanner: scn1.migadu.com X-TUID: nUXp7tnR5j6P --=-=-= Content-Type: text/plain Ihor Radchenko writes: > Note that attachment in the previous email appears to be empty. Can you > resend? I will take a look then. My mistake, populated file is attached. Thanks. Kevin --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=custom-bulk-function-args.diff diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index dedf7e5bb..1df99ec79 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -10487,7 +10487,12 @@ (defun org-agenda-bulk-action (&optional arg) (action (pcase (assoc action org-agenda-bulk-custom-functions) - (`(,_ ,f) (setq cmd f) (setq redo-at-end t)) + (`(,_ ,f) + (when (listp f) + (let ((args (funcall (nth 1 f))) + (func (nth 0 f))) + (setq f (apply #'apply-partially func args)))) + (setq cmd f) (setq redo-at-end t)) (_ (user-error "Invalid bulk action: %c" action))))) ;; Sort the markers, to make sure that parents are handled --=-=-=--