From mboxrd@z Thu Jan 1 00:00:00 1970 From: Memnon Anon Subject: Re: bulk relative time shift (in org file)? Date: Fri, 1 Jul 2011 03:36:04 +0000 (UTC) Message-ID: <871uyaogg9.fsf@mean.albasani.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:51572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcUWl-0006wR-Tv for emacs-orgmode@gnu.org; Thu, 30 Jun 2011 23:36:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QcUWk-0007ou-AS for emacs-orgmode@gnu.org; Thu, 30 Jun 2011 23:36:23 -0400 Received: from lo.gmane.org ([80.91.229.12]:47544) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcUWk-0007og-1P for emacs-orgmode@gnu.org; Thu, 30 Jun 2011 23:36:22 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QcUWi-0007MP-69 for emacs-orgmode@gnu.org; Fri, 01 Jul 2011 05:36:20 +0200 Received: from e178209154.adsl.alicedsl.de ([85.178.209.154]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Jul 2011 05:36:20 +0200 Received: from gegendosenfleisch by e178209154.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Jul 2011 05:36:20 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Michael, Michael Gilbert writes: > - select a number of items with time stamps in an org file (either by > region or, if I must, all items subsidiary to a headline) > - change all of their deadlines (or some other time stamp) by a set > number of days, relative to the date they currently have - the result > is a bulk rescheduling, with the relative timing of the items > remaining intact This is interesting! Elisp fun, where is my *scratch*?! [Later ... much later] When I heard Bulk rescheduling, I naturally turned to the agenda. (To be honest, I would probably have tried another way if I had read your mail more carefully the first time) I know, you said: > - I would prefer to do this in the org file, not in the Agenda. This > is a planning activity. But the agenda is in many ways another interface to the org file. And it supports limiting to: Region, Subtree, etc. So, based on the example in the manual, I made this prototype for deadlines: --8<---------------cut here---------------start------------->8--- (defun my-org-bulkshift-deadline () "Shift the deadline of marked items in the agenda by n days. Set n via Prefix Arg!" (interactive "P") (let* ((marker (or (org-get-at-bol 'org-hd-marker) (org-agenda-error))) (buffer (marker-buffer marker)) ) (with-current-buffer buffer (save-excursion (save-restriction (widen) (goto-char marker) (org-back-to-heading t) (when (and (org-entry-get (point) "DEADLINE") ; There is a deadline there (numberp current-prefix-arg)) ; And current-prefix-arg is a number (re-search-forward org-deadline-time-regexp) (org-timestamp-change current-prefix-arg 'day))))))) --8<---------------cut here---------------end--------------->8--- So, if you have a Project like this one: * Proj a ** NEXT Task 1 :TAGA:TAGB: ** TODO Task 2 :TAGC: ** Task 3 :TAGD: ** TODO [#A] Task 4 ** TODO [#A] Task 5 Use the agenda and its filtering and limiting support to a) limit to subtree, to region or limit to buffer b) include/exlude TAGa/b/c c) include/exclude state WAITING/NEXT/whatever d) etc.etc.etc. (and there are custom agendas as well :) And when you have what you want, you just ark 'em up and do "M-15 B f my-org-bul" and its done. You can use many levels of filtering, but you don't have to of course. Sleepy me did only minimal testing so far, but the prototype seems to work and my-org-bulkshift-scheduled, -plain et al. can be easily added and/or combined into one function. Seems to me that using the agenda is the most flexible approach... > Any guidance? Oh, guidance would be great: I'm curious what others will propose. Memnon "off to bed" Anon