Skip to content

Commit ed49550

Browse files
feat(api): Add match_query and header to agenda api
match_query can be used on tags and tags_todo to match the headlines. header allow proving custom header name for the view.
1 parent 6d23709 commit ed49550

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

lua/orgmode/api/agenda.lua

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,36 +46,43 @@ function OrgAgenda.agenda(options)
4646
orgmode.agenda:agenda(opts)
4747
end
4848

49-
---@class OrgAgendaTodosOptions
49+
---@class OrgApiAgendaTodosOptions
5050
---@field filters? OrgApiAgendaFilter
51+
---@field header? string
5152

52-
---@param options? OrgAgendaTodosOptions
53+
---@param options? OrgApiAgendaTodosOptions
5354
function OrgAgenda.todos(options)
5455
options = options or {}
5556
local opts = get_opts(options)
5657
orgmode.agenda:todos(opts)
5758
end
5859

59-
---@class OrgAgendaTagsOptions
60-
---@field filters? OrgApiAgendaFilter
60+
---@class OrgApiAgendaTagsOptions
61+
---@field filters? OrgApiAgendaFilter Agenda filters for tags and categories
62+
---@field match_query? string Match query to find the todos
6163
---@field todo_only? boolean
64+
---@field header? string
6265

63-
---@param options? OrgAgendaTagsOptions
66+
---@param options? OrgApiAgendaTagsOptions
6467
function OrgAgenda.tags(options)
6568
options = options or {}
6669
local opts = get_opts(options)
70+
opts.todo_only = options.todo_only
71+
opts.match_query = options.match_query
6772
orgmode.agenda:tags(opts)
6873
end
6974

70-
---@class OrgAgendaTagsTodoOptions
71-
---@field filters? OrgApiAgendaFilter
72-
---@field todo_only? boolean
75+
---@class OrgApiAgendaTagsTodoOptions
76+
---@field filters? OrgApiAgendaFilter Agenda filters for tags and categories
77+
---@field match_query? string Match query to find the todos
78+
---@field header? string
7379

74-
---@param options? OrgAgendaTagsOptions
80+
---@param options? OrgApiAgendaTagsOptions
7581
function OrgAgenda.tags_todo(options)
7682
options = options or {}
7783
local opts = get_opts(options)
78-
orgmode.agenda:tags(opts)
84+
opts.match_query = options.match_query
85+
orgmode.agenda:tags_todo(opts)
7986
end
8087

8188
return OrgAgenda

0 commit comments

Comments
 (0)