emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kevin Foley <kevin@kevinjfoley.me>
To: Ihor Radchenko <yantar92@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: Custom Bulk Functions With Prompt
Date: Sun, 17 Jan 2021 21:14:48 -0500	[thread overview]
Message-ID: <m2wnwbuh2f.fsf@Kevins-MBP.home.lan> (raw)
In-Reply-To: <87lfcrvvro.fsf@localhost>

[-- Attachment #1: Type: text/plain, Size: 211 bytes --]

Ihor Radchenko <yantar92@gmail.com> 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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: custom-bulk-function-args.diff --]
[-- Type: text/x-patch, Size: 697 bytes --]

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

  reply	other threads:[~2021-01-18  2:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-17  2:31 Custom Bulk Functions With Prompt Kevin Foley
2021-01-17  5:42 ` Ihor Radchenko
2021-01-17 18:06   ` Kevin Foley
2021-01-18  2:11     ` Ihor Radchenko
2021-01-18  2:14       ` Kevin Foley [this message]
2021-01-18  8:50         ` Ihor Radchenko
2021-01-19 18:36           ` Kevin Foley
2021-01-20  6:49             ` Ihor Radchenko
2021-01-21 14:01               ` [PATCH] Org Agenda Support Argument Collection for Custom Bulk Functions (was: Custom Bulk Functions With Prompt) Kevin Foley
2021-01-22  5:14                 ` Ihor Radchenko
2021-01-22  5:29                 ` Kyle Meyer
2021-01-27 23:13                   ` Kevin Foley
2021-01-30  7:48                     ` Kyle Meyer
2021-02-13 17:29                       ` Kevin Foley
2021-02-14 20:23                         ` Kyle Meyer
2021-02-15  2:30                           ` Kevin Foley
2021-02-15  3:01                             ` Kyle Meyer
2021-02-15 14:04                               ` Kevin Foley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2wnwbuh2f.fsf@Kevins-MBP.home.lan \
    --to=kevin@kevinjfoley.me \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).