org-capture.el: When capturing from an agenda buffer use the cursor date at the default date

* org-capture.el (org-capture): When called from an agenda
buffer, use the cursor date at the default date.
This commit is contained in:
Bastien Guerry 2012-09-02 12:29:59 +02:00
parent ea0b50be37
commit a3f82f430b
1 changed files with 3 additions and 0 deletions

View File

@ -505,6 +505,9 @@ Lisp programs can set KEYS to a string associated with a template in
`org-capture-templates'. In this case, interactive selection will be
bypassed."
(interactive "P")
(if (eq major-mode 'org-agenda-mode)
(setq org-overriding-default-time
(org-get-cursor-date)))
(cond
((equal goto '(4)) (org-capture-goto-target))
((equal goto '(16)) (org-capture-goto-last-stored))