Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve order of the todo agenda #842

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lyz-code
Copy link

As with all my PRs, I'm really a noob at Lua trying to do my best. I'd appreciate any suggestions to improve the code.

Until it's merged users can use my fork

As the order of the org_todo_keywords define the order of the todo in
the agenda, a user may want to have a default TODO state different than
the first one in the org_todo_keywords list
@lyz-code lyz-code force-pushed the feat/improve-todo-agenda-order branch from 47ba087 to 8a1acbf Compare December 24, 2024 15:12
@lyz-code
Copy link
Author

If you like the implementation I can add the documentation of the new configuration option

@kristijanhusak
Copy link
Member

Is this how Emacs does the sorting, or just something that you think would be good to add? IIRC sort is not changed when clocking in/out.

@lyz-code
Copy link
Author

lyz-code commented Jan 2, 2025

I've never used Emacs so it's my personal opinion :S , I can also add options to configure the non default behaviours if you want

@seflue
Copy link
Contributor

seflue commented Jan 3, 2025

Thanks @lyz-code for the effort. I like the attempt to provide a better agenda sorting then the current one. Because this implementation is the personal flavor of @lyz-code, my question to you, @kristijanhusak would be: Would you be open that we provide an option, where the user can define a closure, which does the sorting? Than we provide a default implementation, which mirrors the Emacs behavior and a couple of helper functions accessible from the options, so the user can easily implement their own sorting flavor?

@kristijanhusak
Copy link
Member

@seflue since I plan to add custom agenda commands in the following months, for now I'm thinking to attach the sorting function to the AgendaView class, and let the power users monkey patch it. With the custom agenda commands, there will be a way to do this as part of the configuration. Would that work @lyz-code ?

@seflue
Copy link
Contributor

seflue commented Jan 4, 2025

@kristijanhusak Would you also do that with the sort_agenda_items function in AgendaView which is currently just a local function? I would be really happy to make the agenda view a bit more custamizable, even if this means to write some code. The current behavior is most often too noisy and it is hard to let the important things stand out without losing track of the rest.

Can you elaborate a bit more on your plan of custom agenda commands? I have some requirements to the agenda which made me already thinking of writing my own agenda plugin - but I didn't find the time yet to seriously design something decent. But I would be happy to give feedback on what you have in mind.

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.

3 participants