[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] org-add-planning-info: respect caller's given time [9.3.7 (relea

From: No Wayman
Subject: [PATCH] org-add-planning-info: respect caller's given time [9.3.7 (release_9.3.7-716-g3d4876 @ /home/n/.emacs.d/straight/build/org/)]
Date: Tue, 18 Aug 2020 18:16:05 -0400
User-agent: mu4e 1.5.5; emacs 28.0.50

The current behavior of `org-add-planning-info' does not include the time of day when it is passed the TIME argument. This is because `org-time-was-given' is initially let-bound to nil
during the scope of the function.

The attached patch removes that binding and allows the caller to pass the time of day in the above case.

An example use case I use with org-capture templates:

(defun +org-schedule-relative-to-deadline ()
 "Prompt for optional deadline, then an optional schedule time.
The scheduled default time is the deadline."
 (condition-case nil
     (org-deadline nil)
   (quit nil))
(let ((org-overriding-default-time (or (org-get-deadline-time (point))
;; works with patch, but without it the time of day is not included in timestamp. (org-schedule nil (org-read-date 'with-time 'to-time nil "SCHEDULE: " org-overriding-default-time))))

Attachment: 0001-org-add-planning-info-caller-time.patch
Description: org-add-planning-programmatic-time-of-day

reply via email to

[Prev in Thread] Current Thread [Next in Thread]