forked from mirrors/org-mode
org-agenda: Match timestamps inside node properties
* lisp/org-agenda.el (org-agenda-get-timestamps): Use `org-at-timestamp-p' instead of org-element to check if at valid timestamp. Agenda should consider timestamps inside node properties even though they are not parsed by org-element. * testing/lisp/test-org-agenda.el (test-org-agenda/property-timestamp): Add new test checking active timestamp inside property drawer. * testing/examples/agenda-file.org (test timestamp inside properties): Add heading for `test-org-agenda/property-timestamp'. Reported in https://list.orgmode.org/06d301d83d9e$f8b44340$ea1cc9c0$@tomdavey.com
This commit is contained in:
parent
847e332301
commit
d9bf64f064
|
@ -5732,7 +5732,7 @@ displayed in agenda view."
|
||||||
(org-before-first-heading-p)
|
(org-before-first-heading-p)
|
||||||
(and org-agenda-include-inactive-timestamps
|
(and org-agenda-include-inactive-timestamps
|
||||||
(org-at-clock-log-p))
|
(org-at-clock-log-p))
|
||||||
(not (eq 'timestamp (org-element-type (org-element-context)))))
|
(not (org-at-timestamp-p 'agenda)))
|
||||||
(throw :skip nil))
|
(throw :skip nil))
|
||||||
(org-agenda-skip))
|
(org-agenda-skip))
|
||||||
(let* ((pos (match-beginning 0))
|
(let* ((pos (match-beginning 0))
|
||||||
|
|
|
@ -16,3 +16,7 @@ SCHEDULED: <2022-01-03 Mon>
|
||||||
#+begin_example
|
#+begin_example
|
||||||
SCHEDULED: <2022-01-03 Mon>
|
SCHEDULED: <2022-01-03 Mon>
|
||||||
#+end_example
|
#+end_example
|
||||||
|
* test timestamp inside properties
|
||||||
|
:PROPERTIES:
|
||||||
|
:CREATED: <2022-03-22 Tue>
|
||||||
|
:END:
|
||||||
|
|
|
@ -106,6 +106,21 @@ See https://list.orgmode.org/20220101200103.GB29829@itccanarias.org/T/#t."
|
||||||
(should (= 2 (count-lines (point-min) (point-max)))))
|
(should (= 2 (count-lines (point-min) (point-max)))))
|
||||||
(org-test-agenda--kill-all-agendas))
|
(org-test-agenda--kill-all-agendas))
|
||||||
|
|
||||||
|
(ert-deftest test-org-agenda/property-timestamp ()
|
||||||
|
"Match timestamps inside property drawer.
|
||||||
|
See https://list.orgmode.org/06d301d83d9e$f8b44340$ea1cc9c0$@tomdavey.com"
|
||||||
|
(cl-assert (not org-agenda-sticky) nil "precondition violation")
|
||||||
|
(cl-assert (not (org-test-agenda--agenda-buffers))
|
||||||
|
nil "precondition violation")
|
||||||
|
(let ((org-agenda-span 'day)
|
||||||
|
(org-agenda-files `(,(expand-file-name "examples/agenda-file.org"
|
||||||
|
org-test-dir))))
|
||||||
|
(org-agenda-list nil "<2022-03-22 Tue>")
|
||||||
|
(set-buffer org-agenda-buffer-name)
|
||||||
|
(message "%s" (buffer-string))
|
||||||
|
(should (= 4 (count-lines (point-min) (point-max)))))
|
||||||
|
(org-test-agenda--kill-all-agendas))
|
||||||
|
|
||||||
(ert-deftest test-org-agenda/set-priority ()
|
(ert-deftest test-org-agenda/set-priority ()
|
||||||
"One informative line in the agenda. Check that org-agenda-priority updates the agenda."
|
"One informative line in the agenda. Check that org-agenda-priority updates the agenda."
|
||||||
(cl-assert (not org-agenda-sticky) nil "precondition violation")
|
(cl-assert (not org-agenda-sticky) nil "precondition violation")
|
||||||
|
|
Loading…
Reference in New Issue