|
@@ -5766,7 +5766,17 @@ Providing it allows for quicker computation."
|
|
|
(if (and (>= origin (point)) (< origin (line-end-position)))
|
|
|
(narrow-to-region (point) (line-end-position))
|
|
|
(throw 'objects-forbidden element))))
|
|
|
- ;; All other locations cannot contain objects: bail out.
|
|
|
+ ;; At a planning line, if point is at a timestamp, return it,
|
|
|
+ ;; otherwise, return element.
|
|
|
+ ((eq type 'planning)
|
|
|
+ (dolist (p '(:closed :deadline :scheduled))
|
|
|
+ (let ((timestamp (org-element-property p element)))
|
|
|
+ (when (and timestamp
|
|
|
+ (<= (org-element-property :begin timestamp) origin)
|
|
|
+ (> (org-element-property :end timestamp) origin))
|
|
|
+ (throw 'objects-forbidden timestamp))))
|
|
|
+ ;; All other locations cannot contain objects: bail out.
|
|
|
+ (throw 'objects-forbidden element))
|
|
|
(t (throw 'objects-forbidden element)))
|
|
|
(goto-char (point-min))
|
|
|
(let* ((restriction (org-element-restriction type))
|