summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNo Wayman <iarchivedmywholelife@gmail.com>2020-09-08 10:27:13 +0200
committerBastien <bzg@gnu.org>2020-09-08 10:27:13 +0200
commit4f49ebb6d6ebde78ccea88704fcead33bb0b59f5 (patch)
tree429e677e9d659a0bba26c55c4b49a43d8f822c6c
parent7c4b67d49aa5fbac9bdb39c5883c9faf88cd2cbf (diff)
downloadorg-mode-4f49ebb6d6ebde78ccea88704fcead33bb0b59f5.tar.gz
org.el: Fix `org-add-planning-info'
* lisp/org.el (org-add-planning-info): * lisp/org.el (org-add-planning-info): Use `org-time-was-given' and `org-end-time-was-given' if the variables are bound from an outside call. This allows e.g. programmatically passing a time of day to `org-schedule'. TINYCHANGE
-rw-r--r--lisp/org.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/org.el b/lisp/org.el
index bc74ced..5a650eb 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10618,7 +10618,7 @@ among `closed', `deadline', `scheduled' and nil. TIME indicates
the time to use. If none is given, the user is prompted for
a date. REMOVE indicates what kind of entries to remove. An old
WHAT entry will also be removed."
- (let (org-time-was-given org-end-time-was-given default-time default-input)
+ (let (default-time default-input)
(when (and (memq what '(scheduled deadline))
(or (not time)
(and (stringp time)
@@ -10707,10 +10707,12 @@ WHAT entry will also be removed."
;; Insert associated timestamp.
(let ((ts (org-insert-time-stamp
time
- (or org-time-was-given
+ (or (and (boundp 'org-time-was-given) org-time-was-given)
(and (eq what 'closed) org-log-done-with-time))
(eq what 'closed)
- nil nil (list org-end-time-was-given))))
+ nil nil
+ (when (boundp 'org-end-time-was-given)
+ (list org-end-time-was-given)))))
(unless (eolp) (insert " "))
ts)))))