From mboxrd@z Thu Jan 1 00:00:00 1970 From: Puneeth Chaganti Subject: [PATCH] Allow using a custom function for Bulk actions Date: Mon, 7 Mar 2011 15:58:02 +0530 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=00504502d4ceb97842049de1f48c Return-path: Received: from [140.186.70.92] (port=36425 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwXg0-00070T-Dp for emacs-orgmode@gnu.org; Mon, 07 Mar 2011 05:28:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwXfv-0005Ty-SW for emacs-orgmode@gnu.org; Mon, 07 Mar 2011 05:28:28 -0500 Received: from mail-ww0-f49.google.com ([74.125.82.49]:52781) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwXfv-0005Tt-Nw for emacs-orgmode@gnu.org; Mon, 07 Mar 2011 05:28:27 -0500 Received: by wwj40 with SMTP id 40so4155017wwj.30 for ; Mon, 07 Mar 2011 02:28:26 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode --00504502d4ceb97842049de1f48c Content-Type: text/plain; charset=UTF-8 Hi, Here's a patch that allows choosing or specifying any arbitrary function to be used for Bulk actions from agenda view. >From d997a0bb5c399d203059fb5e60db630eab95e003 Mon Sep 17 00:00:00 2001 From: Puneeth Chaganti Date: Mon, 7 Mar 2011 15:54:20 +0530 Subject: [PATCH] org-agenda: Allow specifying a function for bulk action * lisp/org-agenda.el: (org-agenda-bulk-action) A function can be specified, to be used for bulk action on marked items. --- lisp/org-agenda.el | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index e6afbb0..0297d36 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -7969,7 +7969,7 @@ The prefix arg is passed through to the command if possible." (interactive "P") (unless org-agenda-bulk-marked-entries (error "No entries are marked")) - (message "Bulk: [r]efile [$]arch [A]rch->sib [t]odo [+/-]tag [s]chd [S]catter [d]eadline") + (message "Bulk: [r]efile [$]arch [A]rch->sib [t]odo [+/-]tag [s]chd [S]catter [d]eadline [f]unction") (let* ((action (read-char-exclusive)) (org-log-refile (if org-log-refile 'time nil)) (entries (reverse org-agenda-bulk-marked-entries)) @@ -8059,6 +8059,11 @@ The prefix arg is passed through to the command if possible." (org-agenda-date-later distance) (error nil))))))) + ((equal action ?f) + (setq cmd (list (intern + (org-icompleting-read "Function: " + obarray 'fboundp t nil nil))))) + (t (error "Invalid bulk action"))) ;; Sort the markers, to make sure that parents are handled before children -- 1.7.4.1 -- Puneeth --00504502d4ceb97842049de1f48c Content-Type: text/x-patch; charset=US-ASCII; name="0001-org-agenda-Allow-specifying-a-function-for-bulk-acti.patch" Content-Disposition: attachment; filename="0001-org-agenda-Allow-specifying-a-function-for-bulk-acti.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gkz8ztkl0 RnJvbSBkOTk3YTBiYjVjMzk5ZDIwMzA1OWZiNWU2MGRiNjMwZWFiOTVlMDAzIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQdW5lZXRoIENoYWdhbnRpIDxwdW5jaGFnYW5AZ21haWwuY29t PgpEYXRlOiBNb24sIDcgTWFyIDIwMTEgMTU6NTQ6MjAgKzA1MzAKU3ViamVjdDogW1BBVENIXSBv cmctYWdlbmRhOiBBbGxvdyBzcGVjaWZ5aW5nIGEgZnVuY3Rpb24gZm9yIGJ1bGsgYWN0aW9uCgoq IGxpc3Avb3JnLWFnZW5kYS5lbDogKG9yZy1hZ2VuZGEtYnVsay1hY3Rpb24pIEEgZnVuY3Rpb24g Y2FuIGJlCnNwZWNpZmllZCwgdG8gYmUgdXNlZCBmb3I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