summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2012-09-17 18:42:11 +0200
committerBastien Guerry <bzg@altern.org>2012-09-17 18:42:11 +0200
commitd66cbad3d9350fea592be485015281a285060640 (patch)
treebcdc4cc94bef7b180272c773a37064b0619e1105
parentf1f1fc8d48171659be7130453596ae7567ab874d (diff)
downloadorg-mode-d66cbad3d9350fea592be485015281a285060640.tar.gz
org-capture.el: Fix bug in `org-capture-string'
* org-capture.el (org-capture-entry): New variable. (org-capture-string, org-capture): Use it to possibly skip the interactive prompt for a capture template.
-rw-r--r--lisp/org-capture.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index a932ce7..79e5a5d 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -432,10 +432,11 @@ for a capture buffer.")
;;;###autoload
(defvar org-capture-initial nil)
+(defvar org-capture-entry nil)
(defun org-capture-string (string &optional keys)
(interactive "sInitial text: \n")
(let ((org-capture-initial string)
- (entry (org-capture-select-template keys)))
+ (org-capture-entry (org-capture-select-template keys)))
(org-capture)))
(defcustom org-capture-templates-contexts nil
@@ -529,7 +530,7 @@ agenda will use the date at point as the default date."
org-capture-link-is-already-stored)
(plist-get org-store-link-plist :annotation)
(ignore-errors (org-store-link nil))))
- (entry (org-capture-select-template keys))
+ (entry (or org-capture-entry (org-capture-select-template keys)))
initial)
(setq initial (or org-capture-initial
(and (org-region-active-p)