-
Notifications
You must be signed in to change notification settings - Fork 95
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
Correctly handles custom priorities #304
base: master
Are you sure you want to change the base?
Conversation
68af60a
to
d610820
Compare
Priority is UDA, which means one can even make it a float (like I have done). I want to point out that a correct implementation of custom priorities should be included. As of writing, without this implementation, taskwiki fails silently. |
tw.overrides.update({'context':''}) | ||
|
||
# Read urgency levels once instead of at every task processing. | ||
_urgency_levels = tw.config.get("uda.priority.values") or "H,M,L," |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd argue urgency_levels
is not a fortunate name here, as urgency
already has a meaning in TW ecosystem which is distinct from priority
.
@@ -17,7 +17,7 @@ | |||
DUE = r'(?P<due>{0})'.format(DUE_UNNAMED) | |||
TEXT = r'(?P<text>.+?)' | |||
COMPLETION_MARK = r'(?P<completed>.)' | |||
PRIORITY = r'(?P<priority>!{1,3})' | |||
PRIORITY = r'(?P<priority>!+|¡+)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a big fan of the reversed exclamation mark - while it really does look cool, it is not straightforward to type on the keyboard. I'm wondering if there is not a different symbol we could use that would naturally convey the meaning of lower priority.
This solves #275.
It reads taskwarrior configuration and extracts the priorities from there (for instance,
0,L,,M,H
, which treatsL
as lower priority that''
). The 'no priority' level is the empty priority (priority:
). Priorities left of that are considered as insignificance indicators (and are shown with¡
, the reverse of!
) and priorities right of the 'no-priority' are considered higher (and are shown as!
, as is the case currently). For example:Of course, the above is just an example, the user can set the taskwarrior setting
uda.priority.values
to a sequence of characters so as to customize the exact behavior. In taskwarrior, it is the coefficient of a priority that matters and not the position of the the priority inuda.priority.values
. This leaves theuda.priority.values
settings free for the user to set in a way that the above markers (¡
and!
) make sense to them.I am also thinking of adding a configuration option to set custom markers (instead of
¡
and!
).One TODO is to highlight the (arbitrary) priority markers correctly, instead of only the
!
,!!
,!!!
cases.