org-deadline
works by calling org-add-planning-info
, with org-deadline
's input (nil
if you call it with C-c C-d
) and gets a default time from org-parse-time-string
, which is hard-coded to today at 00:00. So there is no variable we can easily change to set the default time.
This default time is then passed to org-read-date
which gets the user input and does take an argument letting us set our own default time. Thus, we can advise org-deadline
to call a different version of org-read-date
whose default time is some value we set:
(require 'cl-lib)
(defvar org-deadline-default-time "10:00"
"The default time for deadlines.")
(defun advise-deadline-default-time (deadline-func arg &optional time)
(let ((old-time (symbol-function #'org-read-date)))
(cl-letf (((symbol-function #'org-read-date)
#'(lambda (&optional a b c d default-time f g)
(let ((default-time (or default-time
org-deadline-default-time)))
(apply old-time a b c d f default-time g)
))))
(apply deadline-func arg time)
)))
(advice-add #'org-deadline :around #'advise-deadline-default-time)
(org-deadline nil "10:00")
or(org-scheduled nil "10:00")
. Look at the doc-string fororg-read-date
to familiarize yourself with the acceptable formats --M-x describe-function RET org-read-date RET
.