Re: Custom Bulk Functions With Prompt

2021-01-19 Thread Ihor Radchenko
Kevin Foley writes: > '((?R (set-category set-category-args)) > (?C bulk-cut)) > > I mostly went with this because I'm not very familiar with `pcase'. > I've confirmed it works as expected but let me know if you still think > another approach is better. I understand now. I thought you wanted t

Re: Custom Bulk Functions With Prompt

2021-01-19 Thread Kevin Foley
Ihor Radchenko writes: > You need to add extra matcher `(,_ ,argf ,f). My idea is to keep allow the user to optionally pass a list of argf and f instead of just a function. For example if no args need to be collected: '((?R set-category) (?C bulk-cut)) but if arguments needs to be collected

Re: Custom Bulk Functions With Prompt

2021-01-18 Thread Ihor Radchenko
Kevin Foley writes: > +(`(,_ ,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)) That will not wor

Re: Custom Bulk Functions With Prompt

2021-01-17 Thread Kevin Foley
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 diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index dedf7e5bb..1df99ec79 100644 --- a/lisp/org-agenda

Re: Custom Bulk Functions With Prompt

2021-01-17 Thread Ihor Radchenko
Kevin Foley writes: > I took a look this morning and came up with the attached patch. > Essentially if the custom function is a list then the first element is > the bulk function and the second is the argument function. > > If that looks reasonable I can add some documentation and submit a > prop

Re: Custom Bulk Functions With Prompt

2021-01-17 Thread Kevin Foley
Ihor Radchenko writes: > 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. I took a look this morning and came up with the attached patch. Essentially if the custom functio

Re: Custom Bulk Functions With Prompt

2021-01-16 Thread Ihor Radchenko
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 indicat