Saved Searches in TP3

I don’t think my proposed syntaxes “should” be a problem in that respect. A project should only be recognized if there’s no text after the “:”. Otherwise anytime you use a colon in your notes it would turn into a project. I guess do let me know if you see another TaskPaper reader struggle with that… I haven’t kept careful track of what’s out there.

Hmm. I know you’re the father of the syntax so I’m not going to argue but tags after colons are supported in Taskmator and PlainTasks for Sublime Text. Could just be a happy accident.

No you are right, I’d forgot that bit! What about:

? My Search ? @a and @b//*

I have no major complaint with that other than hard to recognize when scanning a document. Might be prime for mistakes with all the white space requirements so support something like this too:

?My Search?@a and @b//*

Hum… I agree again, without syntax highlighting those question marks blend it pretty good. I like the idea of using a question mark in the syntax since it seems to be a good match for running a query. Here’s a new list of ideas:

  • Do Next Week [?] @due >[d] today and @due <[d] end of next week
  • Do Next Week ?? @due >[d] today and @due <[d] end of next week
  • Do Next Week -?- @due >[d] today and @due <[d] end of next week
  • Do Next Week :? @due >[d] today and @due <[d] end of next week

Any preferences? I sorta like :? as I can make it mean “defining a query” in my head. Though it probably sticks out the least visually.

Not a fan of starting without some anchor text or characters. If we break it down, there’s a name and a parameter part. You currently have syntax for tags with parameters like so:


Extrapolate a bit without conflicting too much with Markdown:

##Do Next Week(@due >[d] today and @due <[d] end of next week)

That would also stand out a bit better too. It would look like a header with Markdown parsing so I don’t think it’s too terrible.

I’d even be good with @@Do Next Week(@due >[d] today and @due <[d] end of next week) but that might make parsing harder but it is supported with other apps (not recognized as a valid tag).

That seems more inline with Taskpaper format since it resembles the tag/attribute relationship.

1 Like

As far as I can tell curly braces are not yet used in TaskPaper (or Markdown). What about this syntax:

Do Next Week: {@due >[d] today and @due <[d] end of next week}

I could not find out with 100% certainty whether you allow tags after projects lines, or whether they strictly must end with the colon, so this syntax extension might be problematic for the parser.

But I must say I like its unobtrusiveness. The curly braces are a good hint in my opinion that something is evaluated here (compared to the static metadata in @tags) and it makes sense to attach the curly braces block to a project line, since it will usually return more than one item, and saved searches might appear in the side bar in a similar way that projects do.

Thought I’d pitch in with my 2 cents.

The @ symbol is associated with a tag so @tag makes sense. Why not extrapolate that to queries. ? symbol is associate with queries, so in my mind, ?My Search(@due >[d] today and @due <[d] end of next week) would make perfect sense, or if we need to make it stand out a little more, simply use ??My Search(@due >[d] today and @due <[d] end of next week)

It would be nice if search will allow to filter repetitive tasks as well.

I don’t have an idea how it should look… Maybe some one has one.

Maybe tags should be to contains arrays, eg @repeat(mon, tue, wed) and search can allow to check if tag contains something…

I’m not quite sure what your goal is, but you can search based on tag values. For example:

  • @repeat mon

Will match @repeat(mon, tue, wed) while:

  • @repeat fri

Will not.

Just thought I’d chime in again to say I’m so glad you’re working on this, Jesse, and I can’t wait to see the final implementation.

I love the thought of searches being plain-text and so easily saveable.

Well now that I’ve started implementation all of my syntax ideas go out the window :smile: They all run into issues of one sort or another when I actually start the implementation. Instead I’m going for the simplest solution which is to embed the search in a tag. So from my above example searches will look like:

Do Next Week @search(@due >[d] today and @due <[d] end of next week)

Now I’m not sure why I felt the need to invent a new syntax. The above case “Do Next Week” would be displayed in the sidebar with some searchy icon next to it to distinguish from a normal project, and and when you select it the search will get applied.

No harm in that. I think it’s weird having tags within tags but it would work. Most TP based apps would simply display that line as a note so it shouldn’t be too distracting.

One comment about your implementation plans. I assume this will act like a filter. It would be good if clicking that filter somehow highlighted the filter tag in the document too. Makes editing it easier. It would be a pain to try to edit a filter name by first showing all and then searching for the filter by name.

Just posted a first version to try:

1 Like

Got it. The @search tag is still activated as a normal tag upon clicking. That seems wrong. I forgot to put a title in front of it and then went to click and edit. Instead it filtered the view for @search tags. But of course, on the other hand it’s a quick way to see all of the filters.

What’s your recommendation? Place all filters at the head of the document?

I think I broke the syntax:

Overdue @search((@due <[d] today or @today) and not @done)

Adding to my list… should be possible eventually, but currently no ‘)’ is allowed.

1 Like

I love the implementation so far. Is the syntax exactly the same as FT?

A little hard to test while a ) breaks it but I can eagerly await the update. :smile:

In the meantime I think you can rewrite these searches (at least some) using except or union. So it could be rewritten as:

Overdue @search(@due <[d] today or @today except @done)

I “think” that’s right… just typing in browser, haven’t tested.