emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Kevin Foley <kevin@kevinjfoley.me>
Cc: emacs-orgmode@gnu.org, Ihor Radchenko <yantar92@gmail.com>
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	[thread overview]
Message-ID: <87zh11sfnu.fsf@kyleam.com> (raw)
In-Reply-To: <m2bldijsn4.fsf@Kevins-MBP.home.lan>

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)


  parent reply	other threads:[~2021-01-22  5:30 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
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 [this message]
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=87zh11sfnu.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=kevin@kevinjfoley.me \
    --cc=yantar92@gmail.com \
    --subject='Re: [PATCH] Org Agenda Support Argument Collection for Custom Bulk Functions (was: Custom Bulk Functions With Prompt)' \
    /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

Code repositories for project(s) associated with this 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).