emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Adam Porter <adam@alphapapa.net>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Change: (org-agenda-bulk-action) Prompt w/number of marked items
Date: Sun, 02 Sep 2018 04:00:49 -0500	[thread overview]
Message-ID: <87r2ic46ke.fsf@alphapapa.net> (raw)

* lisp/org-agenda.el (org-agenda-bulk-action): When scattering, prompt
  for number of days with number of marked items.

A typical pattern for me is to mark a significant number of items
scheduled in the past and scatter them into the future.  Usually I
want to schedule one item per day, i.e. across a number of days equal
to the number of marked items.  The default prompt is 7 days, and
counting the number of items is tedious.  This uses the number of
marked items as the initial prompt for the number of days.

Alternatively, the number of marked items could be indicated in the
prompt string, e.g. "Scatter X tasks across how many days:".  A
customizeable default could also be provided.
---
 lisp/org-agenda.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index eaeddb6..44ecd70 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -9967,7 +9967,7 @@ The prefix arg is passed through to the command if possible."
 	 (let ((days (read-number
 		      (format "Scatter tasks across how many %sdays: "
 			      (if arg "week" ""))
-		      7)))
+                      (length org-agenda-bulk-marked-entries))))
 	   (setq cmd
 		 `(lambda ()
 		    (let ((distance (1+ (random ,days))))
-- 
2.7.4

             reply	other threads:[~2018-09-02  9:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-02  9:00 Adam Porter [this message]
2018-09-06 19:32 ` [PATCH] Change: (org-agenda-bulk-action) Prompt w/number of marked items Nicolas Goaziou
2018-09-13  9:55   ` Adam Porter
2018-09-13 10:36     ` Adam Porter
2018-09-13 21:12       ` Nicolas Goaziou

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=87r2ic46ke.fsf@alphapapa.net \
    --to=adam@alphapapa.net \
    --cc=emacs-orgmode@gnu.org \
    /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).