emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Org Agenda Support Argument Collection for Custom Bulk Funct


From: Kyle Meyer
Subject: Re: [PATCH] Org Agenda Support Argument Collection for Custom Bulk Functions (was: Custom Bulk Functions With Prompt)
Date: Fri, 22 Jan 2021 00:29:25 -0500

Kevin Foley writes:

> Attached patch should allow user to specify a function to collect
> arguments when calling a custom bulk function such that those arguments
> are only collected once and used for each entry.

Thanks, Kevin and Ihor.  This sounds like a good change to me too.

> Subject: [PATCH] org-agenda.el: Support argument collection for custom bulk
>  functions
>
> * lisp/org-agenda.el: (org-agenda-bulk-custom-functions): Add

nit: No ":" after "lisp/org-agenda.el".

> documentation about for collection arguments for custom bulk functions.

Drop either "about" or "for"?

> (org-agenda-bulk-action): Support function to collect arguments for
> custom bulk functions.
> ---
>  lisp/org-agenda.el | 22 ++++++++++++++++++++--

In addition to the NEWS entry that Ihor mentioned, it looks like an
update to the manual is missing.

>  1 file changed, 20 insertions(+), 2 deletions(-)
>
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index dedf7e5bb..deadacc1e 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -2080,7 +2080,20 @@ (defcustom org-agenda-bulk-custom-functions nil
>  
>  With selected entries in an agenda buffer, `B R' will call
>  the custom function `set-category' on the selected entries.
> -Note that functions in this alist don't need to be quoted."
> +Note that functions in this alist don't need to be quoted.
> +
> +If the custom function accepts arguments which you'd like to
> +collect once from the user to be used for each call, you can pass
> +a list with the bulk function, and the function which collects
> +it's arguments and returns them as a list.  For example:

s/it's/its/

> +
> +  \\='((?R (set-category get-category))
> +    (?C bulk-cut))
> +
> +Now, `B R' will call the custom `get-category' which would prompt
> +the user once for a category.  That category is then passed as an
> +argument to `set-category' for each entry it's called against.
> +"
>    :type '(alist :key-type character :value-type (group function))

Should this :type be updated?

>    :version "24.1"

Please update this version, or rather drop :version and add

  :package-version '(Org . "9.5")

>    :group 'org-agenda)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]