Browse Source

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.
Bastien Guerry 12 years ago
parent
commit
a3f82f430b
1 changed files with 3 additions and 0 deletions
  1. 3 0
      lisp/org-capture.el

+ 3 - 0
lisp/org-capture.el

@@ -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))