I wanted a function that would take me to a particular date in a
datetree and didn't find one, so I wrote my own and bound it to C-c d.

(defun org-datetree-goto-date (&optional siblings)
  "Go to and show the date in the date tree. With optional argument
SIBLINGS, on each level of the hierarchy all
siblings are shown. If no entry exists for the date, it will be created."
  (interactive "P")
  (let ((date (decode-time (org-read-date nil t))))
    (org-datetree-find-date-create (list (nth 4 date) (nth 3 date)
(nth 5 date))))
  (outline-show-heading)
  (show-subtree)
  (org-reveal siblings))

(add-hook 'org-mode-hook
          (lambda ()
            (local-set-key [(control ?c) ?d] 'org-datetree-goto-date)))

Maybe this would be useful for others if included in org-mode.

Liam

Reply via email to