Skip to content

Commit

Permalink
Fix: (:time-grid) Only look at time-of-day text property
Browse files Browse the repository at this point in the history
Fixes #264.

Reported-by: Florian Lindner <https://github.com/floli>
Suggested-by: Ihor Radchenko <https://github.com/yantar92>
  • Loading branch information
alphapapa committed Jul 15, 2024
1 parent 05c0f19 commit 05a7100
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 23 deletions.
3 changes: 3 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ As explained in the usage instructions and shown in the example, items are colle
*Changes*
+ Selector ~:auto-outline-path~ puts top-level headings in a group named "Top-level headings". ([[https://github.com/alphapapa/org-super-agenda/issues/258][#258]]. Thanks to [[https://github.com/gsingh93][Gulshan Singh]] for suggesting.)

*Fixes*
+ Selector ~:time-grid~ incorrectly recognized some items. ([[https://github.com/alphapapa/org-super-agenda/issues/264][#264]]. Thanks to [[https://github.com/floli][Florian Lindner]] for reporting, and to [[https://github.com/yantar92][Ihor Radchenko]] for suggesting.)

** 1.3

*Additions*
Expand Down
12 changes: 1 addition & 11 deletions org-super-agenda.el
Original file line number Diff line number Diff line change
Expand Up @@ -458,17 +458,7 @@ This matches the `dotime' text-property, which, if NOT set to
`time' (I know, this gets confusing), means it WILL appear in the
agenda time-grid. "
:section-name "Timed items" ; Note: this does not mean the item has a "SCHEDULED:" line
:test (or (--when-let (org-find-text-property-in-string 'time item)
;; This property is a string; if empty, it doesn't match
(not (string-empty-p it)))
;; This property is nil if it doesn't match
(org-find-text-property-in-string 'time-of-day item)
(--when-let (org-find-text-property-in-string 'dotime item)
;; For this to match, the 'dotime property must be set, and
;; it must not be equal to 'time. If it is not set, or if
;; it is set and is equal to 'time, the item is not part of
;; the time-grid. Yes, this is confusing. :)
(not (eql it 'time)))))
:test (org-find-text-property-in-string 'time-of-day item))

(org-super-agenda--defgroup deadline
"Group items that have a deadline.
Expand Down
30 changes: 18 additions & 12 deletions org-super-agenda.info
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,12 @@ File: README.info, Node: 14-pre, Next: 13, Up: Changelog
(https://github.com/alphapapa/org-super-agenda/issues/258). Thanks
to Gulshan Singh (https://github.com/gsingh93) for suggesting.)

*Fixes*
• Selector ‘:time-grid’ incorrectly recognized some items. (#264
(https://github.com/alphapapa/org-super-agenda/issues/264). Thanks
to Florian Lindner (https://github.com/floli) for reporting, and to
Ihor Radchenko (https://github.com/yantar92) for suggesting.)


File: README.info, Node: 13, Next: 12, Prev: 14-pre, Up: Changelog

Expand Down Expand Up @@ -840,18 +846,18 @@ Node: Why are some items not displayed even though I used group selectors for th
Node: Why did a group disappear when I moved it to the end of the list?21178
Node: Changelog21759
Node: 14-pre21997
Node: 1322829
Node: 1224392
Node: 11127062
Node: 1127237
Node: 10328821
Node: 10229032
Node: 10129166
Node: 10029504
Node: Development29609
Node: Bugs30011
Node: Tests30705
Node: Credits31042
Node: 1323129
Node: 1224692
Node: 11127362
Node: 1127537
Node: 10329121
Node: 10229332
Node: 10129466
Node: 10029804
Node: Development29909
Node: Bugs30311
Node: Tests31005
Node: Credits31342

End Tag Table

Expand Down
5 changes: 5 additions & 0 deletions test/264.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#+TITLE: Test for [[https://github.com/alphapapa/org-super-agenda/issues/264][issue #264]]

* TODO dated item
SCHEDULED: <2024-07-04 Do 14:00>
* TODO undated item
3 changes: 3 additions & 0 deletions test/results.el
Original file line number Diff line number Diff line change
Expand Up @@ -2271,4 +2271,7 @@ Wednesday 5 July 2017
ambition: In 77 d.: TODO Visit Mars :universe:ambition::space:travel:planet:
test: Scheduled: TODO [#C] Get haircut :personal:@town:
ambition: TODO Practice leaping tall ! :universe:ambition::personal:
" "0c6d159283a0cf5bc797ee5037d2f068" " Todo
264: TODO dated item
264: TODO undated item
"))
11 changes: 11 additions & 0 deletions test/test.el
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,14 @@ already loaded."
(:todo "WAITING")
(:name "Not TODOs"
:not (:todo t))))))))

(ert-deftest org-super-agenda-test--issue-264 ()
;; See <https://github.com/alphapapa/org-super-agenda/issues/264>.
;; DONE: Works.
(should (org-super-agenda-test--run
:body (org-todo-list)
:data-file "test/264.org"
:skip-lines 3
:groups '((:name "time-grid" :time-grid t)
(:name "Todo" :todo "TODO")
(:name "catch-all" :anything t)))))

0 comments on commit 05a7100

Please sign in to comment.