emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] bulk relative time shift (in org file)?


From: Memnon Anon
Subject: Re: [O] bulk relative time shift (in org file)?
Date: Thu, 28 Jul 2011 15:47:04 +0000 (UTC)

Michael C Gilbert <address@hidden> 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 ()
  (interactive)
  (let* ((acton (if (org-region-active-p) "region" 
                  "tree"))
         (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 ()
  (interactive)
  (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 ()
  (interactive)
  (let ((val (read-string "Shift region by: ")))
   (org-map-tree '(lambda () 
                      (org-schedule nil val)))))
--8<---------------cut here---------------end--------------->8---

Memnon




reply via email to

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