nvim-orgmode / nvim-orgmode/orgmode
Surface "add_to_drawer" in public headline API
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 3.9k
- Forks
- 190
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 7
Description
Does this feature exist in Emacs orgmode core?
No
Is code AI assisted/generated?
No
Orgmode link
No response
Feature value
Allows users to write into drawers without needing to create custom drawer parsing logic. Useful for custom logs, event hooks, time tracking, etc.
Additional context
I'm hooking into EventManager.event.TodoChanged and appending data to the LOGBOOK drawer:
local note = "..."
event.headline:add_to_drawer("LOGBOOK", note)
This works great but isn't documented as part of the api so it could break.
It actually prepends to the top of the drawer which works fine for me but ideally the api would allow adding content to the top or bottom of an existing drawer. It also creates a drawer that does not yet exist which works well for me.
Checked using :h OrgApi there's no mention of OrgHeadline.add_to_drawer or even add_note. Also the link to orgmode_api.txt on this page leads to a 404:
https://nvim-orgmode.github.io/#api-docs
https://nvim-orgmode.github.io/doc/orgmode_api.txt
I'm not clear where OrgApiHeadline is officially documented or what the difference is so perhaps this is also a note about improving the api discoverability. I'm just calling EventManager.listen... within my orgmode setup, I'm not writing a plugin.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by checking the OrgApi documentation linked from the issue, including OrgApiHeadline, OrgHeadline.add_to_drawer, add_note, and the orgmode_api.txt link. Document the existing method and clarify whether it prepends content, creates missing drawers, and supports choosing the top or bottom; done means the public API page is accurate and discoverable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100