I tried searching the forums but didn’t get an answer, here is the scheme search I tried
#+BEGIN_SRC scheme
(define (focus item)
(and (not (string=? (item-state item) "DONE"))
(not (member "project" (item-tags item)))
(or
(string=? (item-priority item) "A")
(string=? (item-state item) "DOING")
(string=? (item-file item) "calendar-beorg")
(member "calendar-beorg.org" (item-file item))
(member "cal" (item-file item))
(date-in-range? (item-scheduled item))
(date-in-range? (item-active-date item))
(date-in-range? (item-deadline item))
)))
#+END_SRC
Can you give some more details about what you are trying to do? The file calendar-beorg is usually a file that beorgs writes to with calendar entries for the purposes of Emacs users who don’t want to mess around getting system calendars showing in the agenda. That however wouldn’t have custom states in. Hopefully if you can provide some more details as to what you would like beorg to search I can help you come up with a simpler way of doing this.
Sorry is my description is not very clear, it doesn’t look like there is OR syntax when using Syntax search, so I want to implement a view using scheme search that shows today’s as well as expired tasks, and tasks with priority A, as well as today’s calendar events, and the rest of it works fine, but I can’t attach today’s calendar events to scheme search view
You can work out with Scheme if an item is a calendar event (or a reminder) with (item-is-file item) returning #f (or item-file will return an empty string). The items in calendar-beorg.org aren’t seen by beorg - as they will just be duplicates of actual calendar items. Is date-in-range? a function you’ve defined elsewhere, as this isn’t currently a defined function.
Thank you very much for your help. After adjustment, the scheme query can work properly. Date-in-range is another function I defined. However, there is still a small problem. I can use this query to work properly in the program, but if the iOS widget uses the same query, it can only display tasks without calendar events.