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 SG9YIlLNA2ALUAAA0tVLHw (envelope-from ) for ; Sun, 17 Jan 2021 05:38:26 +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 AIwFHlLNA2AjKAAAbx9fmQ (envelope-from ) for ; Sun, 17 Jan 2021 05:38:26 +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 CD6979403A9 for ; Sun, 17 Jan 2021 05:38:25 +0000 (UTC) Received: from localhost ([::1]:35270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l10lc-00016O-ER for larch@yhetil.org; Sun, 17 Jan 2021 00:38:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l10lF-00014n-Cs for emacs-orgmode@gnu.org; Sun, 17 Jan 2021 00:38:01 -0500 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]:40988) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l10lD-0005j1-NH for emacs-orgmode@gnu.org; Sun, 17 Jan 2021 00:38:01 -0500 Received: by mail-oi1-x236.google.com with SMTP id 15so14277429oix.8 for ; Sat, 16 Jan 2021 21:37:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=V8CxdfxyPvKztvGQd7ACbuTG4zUInL409nxXUWU5B2s=; b=CjDkaa9Wr3EvIE+x7TzJr2LyfH8GOjiCyPJIDlM3uBGiix4BBRApUgYkuSFn226baF jW7pLBBLFHNQHpxgyRZw7ANLj2JbxtG/n2Q+IA5CTWaIVBnIt5ZkFk3VDeYlyha5BVtr ZCoEKp0J9qtQx9bLc4Ch2sroxlKvvJvXMpDXb32IeSDlrfNPeGNBYdpXfLanQRZm1jNr HMruC22ZUIgCS5CmvraWWFYRBFhzqcB524T6qY0xM9R5/Ru/UKNxhBSV+RQK+42rLhnk z2oH3F8Kg8IvPmG23lDP2heHxKJnuwhac8ZaswwVLP3lhhJCGGZu41RSggh1+WxDEFbE UxyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=V8CxdfxyPvKztvGQd7ACbuTG4zUInL409nxXUWU5B2s=; b=mdshc7butl3EKLMHApmOdyHgqAgp7KV22xxOts2dyrpPysxbZSeDILYiUWY01aUFzH SZp2JQBcfjMl6swQIuW5dy9WaxmQRc0BbkDsxYg3gwCsqDj7mKzOedxVnlC0PZsdvRBO v/1jMgTmrWwrzsJzMHqUiZBC6vExtQnZY3pNxwfp1Z5iOwIiJpqpV+ho4tMyWKh2ccra e4pRYVuslnvU7BOXc0rPQOIkye+8F2lalcSA1jkHCVOyJp8cNaXuuXFcL7QCbOdm7xhj DaAfr9VH8Z7IakZEBk7d6sKmJdb/FxS9eE2LciAVLCLctTDGPtDEcoVDmqQJfU3iuin+ UfRQ== X-Gm-Message-State: AOAM5317DbRC1VIgNJDIxa5/yJpQC3h8aUL+T4cJgkdvNmuVCaRbLF7f IgXkpf0Du3cBuXsBg4HX8FM= X-Google-Smtp-Source: ABdhPJwiHh+vgIiSIJlLosUrsNa3EJ0NDlzAQdxr2VWczkbjYyrr4WKtK+l3IFXsEBnt9ISIKANM7w== X-Received: by 2002:a05:6808:34d:: with SMTP id j13mr10075759oie.169.1610861878337; Sat, 16 Jan 2021 21:37:58 -0800 (PST) Received: from localhost ([192.200.115.226]) by smtp.gmail.com with ESMTPSA id m29sm2962768oof.20.2021.01.16.21.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jan 2021 21:37:57 -0800 (PST) From: Ihor Radchenko To: Kevin Foley , emacs-orgmode@gnu.org Subject: Re: Custom Bulk Functions With Prompt In-Reply-To: References: Date: Sun, 17 Jan 2021 13:42:04 +0800 Message-ID: <871rekxgpf.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::236; envelope-from=yantar92@gmail.com; helo=mail-oi1-x236.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.56 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=CjDkaa9W; dmarc=pass (policy=none) header.from=gmail.com; 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: CD6979403A9 X-Spam-Score: -2.56 X-Migadu-Scanner: scn1.migadu.com X-TUID: fjbFaNpK8vJh Kevin Foley writes: > I'd like to setup a custom bulk function using > `org-agenda-bulk-custom-functions', however I'd like to receive one > prompt when I select the action and then have the action performed on > every entry without being prompted again. Generally, you can set a variable indicating if your custom function is invoked first time during the bulk action. This variable can be set to nil in :before advice for org-agenda-bulk-action. Then, you can check the variable value in your custom function. If it is nil, it is the first invocation and you run the interactive version then setting the variable to 't. The variable will have 't value in all the following invocations and your function can run non-interactively. Instead of advice, you can also provide a simple patch implementing the described functionality in org-agenda-bulk-action. I do support adding this functionality to org. Best, Ihor