emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Memnon Anon <gegendosenfleisch@googlemail.com>
To: emacs-orgmode@gnu.org
Subject: Re: bulk relative time shift (in org file)?
Date: Thu, 28 Jul 2011 15:47:04 +0000 (UTC)	[thread overview]
Message-ID: <87r55aifzs.fsf@mean.albasani.net> (raw)
In-Reply-To: 0FE41F87-81FA-4F4B-8262-447A58B4FC56@gilbert.org

Michael C Gilbert <mcg@gilbert.org> writes:

> Ideally, something like this should be available in the org file,
> rather than in the agenda. [...]
> But if I shift back and forth to the agenda, then I can make this
> work. I'm assuming that the 'Cc C-s' and 'C-c C-d' commands don't work
> on regions or on everything under a heading?

It may be feasible to make scheduling and deadlining act on region;
lets wait what Bastien thinks when he is back from well
deserved vacation.

I have been experimenting to get this done with a simple function
one could bind to e.g. `C-s M-s'. (Or one could defadvice
the proper functions (?), I have to read up on that ...)

In my first tests, it somewhat works, but the logbook
is updated only on the last item, not sure why that is, yet.

I will investigate later if no one jumps in and improves/replaces
this prototype:

--8<---------------cut here---------------start------------->8---
(defun my-org-schedule-shift ()
  (let* ((acton (if (org-region-active-p) "region" 
	 (val (read-string (concat "shift "acton" by: "))))
    (if (equal acton "region")
	(org-map-region '(lambda () 
			   (org-schedule nil val)) (region-beginning) (region-end))
      (org-map-tree '(lambda () 
		       (org-schedule nil val))))))

(defun my-org-schedule-shift-region ()
  (let ((val (read-string "Shift region by: ")))
   (org-map-region '(lambda () 
		      (org-schedule nil val)) (region-beginning) (region-end))))

(defun my-org-schedule-shift-tree ()
  (let ((val (read-string "Shift region by: ")))
   (org-map-tree '(lambda () 
		      (org-schedule nil val)))))
--8<---------------cut here---------------end--------------->8---


      reply	other threads:[~2011-07-28 15:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-30 22:24 bulk relative time shift (in org file)? Michael Gilbert
2011-07-01  3:36 ` Memnon Anon
2011-07-12 21:30   ` Memnon Anon
2011-07-16 17:10     ` Bastien
2011-07-16 18:00       ` Memnon Anon
2011-07-24 16:06         ` Bastien
2011-07-26 19:44           ` Memnon Anon
2011-07-28  2:01             ` Michael C Gilbert
2011-07-28 15:47               ` Memnon Anon [this message]

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:

  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=87r55aifzs.fsf@mean.albasani.net \
    --to=gegendosenfleisch@googlemail.com \
    --cc=emacs-orgmode@gnu.org \


* 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


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).