From mboxrd@z Thu Jan 1 00:00:00 1970 From: Memnon Anon Subject: Re: bulk relative time shift (in org file)? Date: Sat, 16 Jul 2011 18:00:05 +0000 (UTC) Message-ID: <87y5zynmda.fsf@mean.albasani.net> References: <871uyaogg9.fsf@mean.albasani.net> <87k4bn8a5p.fsf@mean.albasani.net> <87sjq6up5y.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:43734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qi9Ek-0003u8-7M for emacs-orgmode@gnu.org; Sat, 16 Jul 2011 14:05:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qi9Ei-0003BO-BM for emacs-orgmode@gnu.org; Sat, 16 Jul 2011 14:05:10 -0400 Received: from lo.gmane.org ([80.91.229.12]:53169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qi9Ei-0003BB-0t for emacs-orgmode@gnu.org; Sat, 16 Jul 2011 14:05:08 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Qi9Eg-00006D-Sd for emacs-orgmode@gnu.org; Sat, 16 Jul 2011 20:05:06 +0200 Received: from e178193051.adsl.alicedsl.de ([85.178.193.51]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Jul 2011 20:05:06 +0200 Received: from gegendosenfleisch by e178193051.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Jul 2011 20:05:06 +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 Bastien writes: > My Gnus .overview has been corrupted and I lost track of the question. > Can you restate it shortly here? ,----[ Original request as short as I can get it ] | Michael is looking for a way to "bulk re'timestamp'" items | relativ to the timestamp the item has currently. | This should work on region, subtree etc. | He wants to avoid cloning and would prefer doing this | directly in the file, not with the agenda. `---- Example: --8<---------------cut here---------------start------------->8--- Before: * Project A ** Task A SCHEDULED: <2011-07-16 Sa> ** Taks B SCHEDULED: <2011-07-19 Di> ** Task C SCHEDULED: <2011-07-21 Do> After "Bulk re-timestamp schedule +7d scope subtree" : * Project A ** Task A SCHEDULED: <2011-07-23 Sa> ** Taks B SCHEDULED: <2011-07-26 Di> ** Task C SCHEDULED: <2011-07-28 Do> --8<---------------cut here---------------end--------------->8--- I said that the agenda seems to me the easiest way to do it. >But the agenda is in many ways another interface to the org file. (i.e. Agenda can be more than a calendar like presentation) >And it supports limiting to: Region, Subtree, etc. out of the box! Prototype bulkshift by date: #+begin_src emacs-lisp (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))))))) #+end_src Use: "M-15 B f my-org-bul" in the agenda (limited to what you want, then marking the items.) > I 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. Memnon "This is not really short :(" Anon