It would be really convenient if for certain tasks in org-mode, the subtasks could inherit the deadline of the main task. This behavior should occur in case I have not already specified a deadline for the subtask. In this way, all the subtasks would show up in my org-agenda view, with proper deadlines which are easily manipulatable.
Here's advice that works for recent versions of Org 9, unlike my previous answer which stopped working at some point.
(defun org-entry-properties-inherit-deadline (orig-fun &optional pom which)
"Call ORIG-FUN with POM, but if WHICH is `DEADLINE' do it recursively."
(if (string= which "DEADLINE")
(org-with-point-at pom
(let (value)
(while (not (or (setq value (funcall orig-fun (point) which))
(not (org-up-heading-safe)))))
value)
(funcall orig-fun pom which))))
(advice-add 'org-entry-properties :around #'org-entry-properties-inherit-deadline)
DEADLINE is one of these properties, that are not inherited by default.
You can change that by customizing the variable org-use-property-inheritance
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With