Skip to content

feat(agenda): implement support for org_agenda_prefix_format#1122

Open
swapnilsm wants to merge 8 commits intonvim-orgmode:masterfrom
swapnilsm:master
Open

feat(agenda): implement support for org_agenda_prefix_format#1122
swapnilsm wants to merge 8 commits intonvim-orgmode:masterfrom
swapnilsm:master

Conversation

@swapnilsm
Copy link
Copy Markdown

@swapnilsm swapnilsm commented Apr 3, 2026

Summary

This PR implements support for org_agenda_prefix_format, allowing users to customize the prefix of agenda lines using format strings or Lua expressions. The implementation uses a pre-compiled formatting system to ensure high performance and efficiency during agenda rendering.

Related Issues

Closes #913

Changes

  • Implementation of org_agenda_prefix_format: Added support for customizing agenda line prefixes, mimicking the Emacs Orgmode feature. Supported in agenda, todo, tags, tags_todo, and search views.
  • Pre-compilation & Caching: Format strings are parsed into segments and cached. Lua expressions are compiled once, significantly improving agenda rendering performance compared to a naive per-line parsing approach.
  • Support for Lua Expressions: Users can use %(...) placeholders to evaluate custom Lua code within the prefix, with access to headline, item, and metadata.
  • Architectural Design: The Formatter module separates parsing from evaluation, leading to cleaner and more maintainable code.
  • Semantic Naming: Introduced the marker field in AgendaItem to represent planning status indicators (Deadline, Scheduled, etc.), replacing more ambiguous naming.
  • Documentation: Added comprehensive documentation in configuration.org and synchronized the Vim help file.
  • Verification: Included a dedicated test suite for the formatter to ensure correctness across various format string configurations.

Checklist

I confirm that I have:

  • Followed the Conventional Commits specification
  • My PR title also follows the conventional commits specification.
  • Updated relevant documentation, if necessary.
  • Thoroughly tested my changes.
  • Added tests (if applicable) and verified existing tests pass with make test.
  • Checked for breaking changes and documented them, if any.

@swapnilsm swapnilsm changed the title refactor(agenda): optimize prefix formatting with pre-compilation feat(agenda): implement support for org_agenda_prefix_format Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for org-agenda-prefix-format

1 participant