[TW-1268] Regular Expression based Virtual Tags
Benjamin Weber on 2014-02-20T15:52:05Z says:
Build your own virtual tag:
task config virtual.tag.mail "^@$"
Migrated metadata:
Created: 2014-02-20T15:52:05Z
Modified: 2017-01-16T18:48:12Z
Paul Beckingham on 2014-02-22T17:32:50Z says:
I like this. A user-configurable entity maps to a virtual tag. The example above uses a regex, but this could be more generalized to accept filters:
task config virtual.tag.MAIL '/@/'
Simiilarly:
task config virtual.tag.COMBINED '+one +two +three'
task config virtual.tag.LIVE 'status=pending or status=waiting'
Benjamin Weber on 2014-02-22T21:32:30Z says:
Okay, I someone had been earlier: http://taskwarrior.wordpress.com/2013/09/28/virtual-tags/comment-page-1/#comment-58
Don't consider the following lines seriously. I don't understand task. Total contribution in lines of code: zero.
I don't understand:
- A report is any number of preset filters with formatting plus sorting.
- A virtual tag is a preset filter.
- A preset filter selects tasks.
Let's unify:
- reports
- virtual tags
- preset filters
- status
into status: Predefined status User Defined Status.
||1. attribute||2. status||3. virtual tag||4. report||5. filter|| |wait|waiting|+WAITING|waiting|wait.any:| | | |-WAITING|ready|wait.none: ( scheduled.none: or scheduled.before:now )| | pending | | | | | |scheduled| |+SCHEDULED| |scheduled.any:| |start| |+ACTIVE|active|start.any:| | | |+UNBLOCKED|unblocked| | | | |+BLOCKED|blocked| | |depends| |+BLOCKING|blocking|depends.none:| |end|completed| |completed| | | | |+ANNOTATED| | | |due| |+OVERDUE|overdue| | |until|deleted|+UNTIL| | until.any:, deleted.any:| |recur| |+CHILD|recurring|recur.any:|
would become
||attribute||status||filter|| |wait|waiting|wait.any:| | | pending | | |scheduled|scheduled|scheduled.any:| |start|started|start.any:| |depends|unblocked| | |depends|blocked| | |depends|blocking|depends.none:| |end|completed|end.any:| | |annotated| | |due|overdue| | |until|deleted| | |recur|recurring|recur.any:| | |UDS|
1. Understand status
1. We have three layers of information (bottom to top):
1. status.<name> '<filter>' (1)
1. template.<name> '<columns> (2)
1. theme.<name> '/path/to/theme' (3)
1.
1. (1) Determines selection of tasks. <filter> supports regular expressions.
1. (2) Determines (1) column layout and (2) sorting. Taskwarrior follows ascending incidents of + and - suffixes for sorting, if unclear, left to right incidence determines sorting
1. (3) Determines painting.
2. Define status (in ~/.taskrc)
template.default 'id,project++++,priority--,due+,start.active--,entry.age,description' # used if no template.FILTER is specified
1. Lists all pending tasks
status.long 'status:pending'
template.long 'id,project+++,priority--,entry,start,due+,recur,due.countdown,entry.age,depends,tags,description'
1. Lists all pending tasks
status.list 'status:pending'
template.list 'id,project++++,priority--,due+,start.active---,entry.age,description'
1. Minimal listing of all pending tasks
status.ls 'status:pending'
template.ls 'id,project++,priority-,description'
1. Minimal listing of all pending tasks
status.minimal 'status:pending'
template.minimal 'id,project+,description.truncated++' # sorting order: project, description
1. List newest tasks
status.newest 'status:pending limit:10'
template.newest 'id-,project,priority,due,start.active,entry.age,description'
1. List oldest tasks
status.oldest '-newest' # inherits template from newest because no new is set
1. List overdue tasks (today is after due)
status.overdue 'status pending +OVERDUE'
template.overdue 'id,project++++,priority--,due+,start.active---,entry.age,description' # sorting order: id,
1. List active tasks (having a start date)
status.active 'status:pending +ACTIVE'
template.active 'id,project+++,priority--,due+,start.active,entry.age,description' # sorting order: project, priority, due
1. List completed tasks
status.completed 'status:completed'
template.completed 'end+,project+++,priority--,entry.age,description,uuid' # sorting order: end, project, priority
1. List recurring tasks
status.recurring 'status:pending +CHILD'
template.recurring 'id,project++++,priority--,due+,recur,start.active---,entry.age,description' # sorting order: due, priority, start, project
1. List all waiting tasks
status.waiting 'status:waiting +WAITING'
template.waiting 'id,project+++,priority--,wait+,entry.age,description' # sorting order: wait, priority, project
1. List all pending and completed tasks
status.all 'status.not:deleted'
template.all 'id,status,project,priority,due,end,start.active,entry.age,description' # how to recreate 'entry+'?
1. List the most urgent tasks
status.next 'status:pending limit:page'
status.ready 'next -WAITING "(scheduled.none: or scheduled.before:now)"'
template.next, template.ready 'id,project+++++,priority---,due++,start.active----,entry.age,urgency-,description' # sorting order: urgency, due, priority, start, project
theme.next, theme.ready '/usr/local/share/doc/task/rc/light-16.theme' # themes can be specified for each status independently
1. List blocked, unblocked, blocking tasks
status.blocked 'status:pending +BLOCKED'
status.unblocked -blocked # inherited sorting order of 'blocked' is not inverted
status.blocking 'status:pending +BLOCKING'
template.blocked, template.blocking 'id,depends,project++++,priority--,due+,start.active---,entry.age,description' # sorting order: due, priority, start, project
1. Some virtual tags
status.1-3 '+one +two +three'
1. Regular expression support
status.mail '/@/'
status.link '/http/'
status.today 'due:after yesterday and before:tomorrow'
status.tm '+today +mail'
status.green 'next +mail'
theme.green '/usr/local/share/doc/task/rc/dark-green-256.theme'
1. Minimal status (includes template), only matches of 'http', violetized
status.violet 'minimal /http/'
theme.violet '/usr/local/share/doc/task/rc/dark-violets-256.theme'
3. Use status
task status # lists all status
task -RECURRING # runs report inv(recurring)
task +one_to_three
task -one_to_three +mail
task +active -mail
task +mail +today
task +tm
task +tm -mail # = +today
task -(+mail +today -ACTIVE)
4. Share status in Status Gallery
A cutely curated gallery of tested, mainly user-contributed status will put the user's experience with Taskwarrior to new heights. The gallery may have screenshots. A status is a set of X-ray goggles, optional with night vision support, to view Taskwarrior's data. The requirements vary widely depending on the users' situations. Let's create an environment of allowing to share each other's status. The user's creativity can unfold, cross-pollinate each other and gives ample inspiration to build new status. The built-in powers of Taskwarrior may be utilised to a higher extent than ever before.
The Taskwarrior Project Team sets up a minimalistic paste service which allows the user to publish his specific status setup.
This is more important than all the extensions. ''It's Taskwarrior's core plus its user's creativity.''
5. Share status via Taskserver
Status specified in Taskserver's config file are available locally for Taskwarrior clients, where local status override global status.
Optional: Taskserver may have more often than not a link to the internet. So, it could use status by just inserting a statusUUID in its config (like a global addressbook). Taskserver may even (opt-in) track the usage of any status and push statistics to the paste service, ranking the order by the global usage pattern.
Benjamin Weber on 2014-02-23T11:31:43Z says:
I have read the following discussion after creating above post: http://taskwarrior.org/boards/6/topics/2414
Paul Beckingham on 2014-03-14T03:52:41Z says:
This is rather interesting.
Benjamin Weber on 2014-03-29T14:54:09Z says:
Two guys, one idea.
David Patrick on 2014-04-04T14:55:52Z says:
Y'know, from this comfy chair it, it looks more like one guy, two ideas. But interesting ideas Benjamin!
Can we please separate them?
The first one, as in the very first post in this thread (and the first comment by pb) creating a regex "virtual tag", is stand-alone brilliant! If implemented, it would be super-handy!
Among other things, it would completely address TW-165 User Definable Special Tags (a.k.a. "tag groups") and that would completely address (among other things) true context functionality.
The big tangent that follows, the unification of reports, VT and filters using selectors templates and themes, is also interesting, but bigger and unrelated. I'd really like to see the two concepts split-up, so that we might knock them down (or at least discuss) as two different ideas.
The first: easily defined regex or filtered VTs, yes please! and asap!
The second: unified reports, filters, and VT, I'd like to dub "semantic task", and let's keep that (separate) discussion rolling.
Benjamin Weber on 2014-04-30T11:50:50Z says:
We can split, sure. But be so kind and make your understanding touchable, WHY should we split? I favor to merging instead of splitting. However, for a beginning we can start and aim at a unified experience.
What is a vtag? A tool to select tasks. What is a report? A tool to select and display tasks in a specific layout.
A tag and a filter do the same: filter=vtag
Why selector selector.link '/http/' can't be used as vtag and for reports? Regex support should be unified in task.
David Patrick on 2015-01-01T17:14:32Z says:
1268 (the first paragraph, and pb's first comments) fully address 165
Now considered for 2.6.0.
This would be really interesting. I use taskwiki with vim and I have a complicated section on my daily journal which tracks what I have done and should do each day. It gets painfully slow on my laptop. When I edit it, I see a significant jump in CPU use. My suspect is that maybe creating a virtual tag to filter things on Taskwarrior side would be helpful.
## Todo || (+PENDING due.before:2023-03-23) or (+COMPLETED end.after:2023-03-22 end.before:2023-03-23) or (+SCHEDULED -COMPLETED schedule.before:2023-03-23) || due:today
### Work | @work | +work
### Personal | @personal | +personal
### Relax | @relax | +relax
### Computer | @computer | +computer