emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-datetree-goto-date
@ 2013-05-06  2:26 Liam Healy
  2013-05-06 11:31 ` org-datetree-goto-date Suvayu Ali
  0 siblings, 1 reply; 3+ messages in thread
From: Liam Healy @ 2013-05-06  2:26 UTC (permalink / raw)
  To: Org-mode mailing list

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-07 10:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-06  2:26 org-datetree-goto-date Liam Healy
2013-05-06 11:31 ` org-datetree-goto-date Suvayu Ali
2013-05-07 10:32   ` org-datetree-goto-date Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).