1

I'd like to use datetree with month (alternatively week) granularity. Currently the datetree looks like that:

* 2019
** 2019-03 March
*** 2019-03-17 Sunday
**** TODO Weekly review

I'd like to drop the level 3 -- day, and how something like that:

* 2019
** 2019-03 March
*** TODO Weekly review

I've looked at https://orgmode.org/manual/Template-elements.html and it doesn't seem this is a build-in feature. Can you suggest any workaround how to achieve such a simplified datetree?

There is a similar question on the orgmode mailing list http://lists.gnu.org/archive/html/emacs-orgmode/2018-02/msg00092.html but without any answer.

1

Defining the following function should help:

(defun org-find-month-in-datetree()
  (org-datetree-find-date-create (calendar-current-date))
  (kill-line))

Then use an org-capture template like this:

'(org-capture-templates
  (quote
   ("w" "Weekly review" plain
    (file+function "~/org/test.org" org-find-month-in-datetree)
    "*** TODO Weekly review
%?))))

To get the same for a weekly date-tree change the function to

(defun org-find-week-in-datetree()
  (org-datetree-find-iso-week-create (calendar-current-date))
  (kill-line))
| improve this answer | |
  • Since the original question (Mar 2019!) and now I've switched to use an online service for my tasks :) I don't have an org mode configured anymore to test, but would it work if there are some days under given month? the kill-line will drop only the most recent day right? Anyways, seems like a good way if you don't want days at all (this is what I've wanted in the past) -- I'm going to accept :) Welcome to the forum and a good first contribution! – Igor Kupczyński May 7 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.