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

* Re: org-datetree-goto-date
  2013-05-06  2:26 org-datetree-goto-date Liam Healy
@ 2013-05-06 11:31 ` Suvayu Ali
  2013-05-07 10:32   ` org-datetree-goto-date Bastien
  0 siblings, 1 reply; 3+ messages in thread
From: Suvayu Ali @ 2013-05-06 11:31 UTC (permalink / raw)
  To: emacs-orgmode

On Sun, May 05, 2013 at 10:26:15PM -0400, Liam Healy wrote:
> 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)

 [...chomp...chomp...chomp...]

>   (org-reveal siblings))

This works beautifully!  I have added a (beginning-of-line) at the end
since I use a lot of the speed commands.

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

I would agree.  Why don't you submit this as a patch to org-datetree.el?

Thanks!

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: org-datetree-goto-date
  2013-05-06 11:31 ` org-datetree-goto-date Suvayu Ali
@ 2013-05-07 10:32   ` Bastien
  0 siblings, 0 replies; 3+ messages in thread
From: Bastien @ 2013-05-07 10:32 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

>> Maybe this would be useful for others if included in org-mode.
>
> I would agree.  Why don't you submit this as a patch to org-datetree.el?

Indeed!  Thanks,

-- 
 Bastien

^ 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).