2

I have a large set of tagged tasks in an org file and I want to shift all their dates by one week. Dates could be scheduled, deadlines, or plain dates. What is the easiest way to do this?

I attempted this using bulk actions via the agenda tag view, but I get a warning message about bulk actions not supporting tag views when I attempt to apply my custom org-agenda-date-later 7 function. I don't know how to do this in agenda without a tag view.

Update 2017-06-19: I have not solved this yet, but I made some headway. You can shift a date three days relative to its current value using ++3d in the date prompt. Agenda bulk actions does not work with this because it relies on org-read-date to prompt for a new date that will be applied to ALL selected items, meaning there is no chance of the currents dates of each item to be considered. So first, that must be fixed, which will require calculating a new date per selected item. Next, bulk actions need to be added to search results. I will try to take care of these one-by-one, but will take awhile.

4
  • 1
    You can loop through all org-mode files searching for tags and matching criteria and modify them with something similar to my custom functions in the linked thread emacs.stackexchange.com/a/5700/2287. You can borrow the loop function at the tail end of the example in this link: emacs.stackexchange.com/a/12563/2287 To match tags, you can isolate them with the org-complex-heading-regexp while you re-search-backward. When searching, if you go to point-max and search backward, you will already be at heading each time re-search-backward stops as part of the while loop.
    – lawlist
    Jun 19, 2017 at 21:28
  • Here is a cl-loop example that gathers all tags using concepts described in the previous comment. You can modify it to do action at each heading if certain criteria is met, and as it loops through each of the org-agenda-files: (loop for file in (org-agenda-files nil 'ifmode) append (let (result) (org-check-agenda-file file) (with-current-buffer (find-file-noselect file) (save-excursion (goto-char (point-max)) (while (re-search-backward org-complex-heading-regexp nil t) (push (match-string-no-properties 5) result))) result))) If you don't already have cl loaded, you can (require 'cl)
    – lawlist
    Jun 20, 2017 at 1:32
  • It is probably not too difficult to fix the bulk feature with tags in an *Org Agenda* buffer for a specific use-case. That being said, the org-mode library is a moving target as it is under constant development -- many people frequently upgrade to the latest stable release. Some people use the stock version that ships with Emacs, and some people have older versions of Emacs with older versions of org-mode. In short, if a feature was disabled with a warning message, it likely means there were problems enabling it -- to enable it again without knowing all the problems, invites trouble.
    – lawlist
    Jun 20, 2017 at 15:52
  • I was looking for something similar, which in my case was to move all SCHEDULED items one day into the future - to put them off for a day. Define a function my/org-agenda-reschedule-week as seen here: emacs.stackexchange.com/questions/29585/… and then use the Bulk agenda with this function. Of course, things will move from Fridays to Saturdays when I'd rather they went to the next Monday.
    – djnz0feh
    Dec 22, 2021 at 14:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.