sleek icon indicating copy to clipboard operation
sleek copied to clipboard

Wishlist: per todo file configuration

Open callegar opened this issue 2 years ago • 2 comments

Feature Request

Description:

It is unclear to me whether the todo.txt specifications has a provision for comment lines in the file (e.g. lines starting with # getting ignored).

In case there is such a provision, it would be great if sleek could interpret a header or a trailer of specially crafted comments as a local configuration specific to the todo file. This would be similar to the emacs local variables in case you are an emacs user.

IMHO this would have a few advantages:

  • it would make the configuration portable with the todo file (e.g. you can copy over the file to another machine and have it ready with its own setup);
  • it would make it more robust to specify the archiving destination per file;
  • it would make it possible to have a filtering setup per file (e.g., you may want not to see completed tasks in your main todo.txt, but you definitely want to see them in an archive of completed tasks);
  • it would make it possible to pre-declare contexts and projects without having to resort to (hidden) fake tasks.

Note that currently sleek seems to have no notion of a comment marker.

callegar avatar Nov 23 '23 13:11 callegar

This seems similar to my #556 issue.

swantzter avatar Nov 30 '23 12:11 swantzter

Thanks for linking to your #556 issue, which pointed at the discussion on https://github.com/todotxt/todo.txt/issues/1.

From there it seems to me that there is strong resistance in adding a comment marker and that the idea is that comments are perceived as unneeded because of the hidden task extension (h:) that is the official way to declare stuff, like contexts or projects.

So I suggest using precisely that. A hidden task with a sleek_cfg:1 tag could be used to store sleek local variables in a todo.txt file. In this case, the todo text could get parsed for variable assignments (e.g.: done_archive="..." filter_completed=true filter_by_threshold=true lang=it).

This would not break any other application trying to use the same todo.txt file.

callegar avatar Dec 01 '23 14:12 callegar