emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Liam Healy <lnp@healy.washington.dc.us>
To: Org-mode mailing list <emacs-orgmode@gnu.org>
Subject: org-datetree-goto-date
Date: Sun, 5 May 2013 22:26:15 -0400	[thread overview]
Message-ID: <CADe9tL7xL8Oci9k4BsiOs_sH3b2N4ormAojDwJ1smF8J3yZGLA@mail.gmail.com> (raw)

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	other threads:[~2013-05-06  2:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-06  2:26 Liam Healy [this message]
2013-05-06 11:31 ` org-datetree-goto-date Suvayu Ali
2013-05-07 10:32   ` org-datetree-goto-date Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADe9tL7xL8Oci9k4BsiOs_sH3b2N4ormAojDwJ1smF8J3yZGLA@mail.gmail.com \
    --to=lnp@healy.washington.dc.us \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).