Combining multiple filters with "or" in a single filter expression

I’m bothered that I can’t see a simple way to do this. I want to combine more than one filter (with filter-filter run prefixes) into a single filter run expression, using or, not and.

I’m trying to set my$:/DefaultTiddlers to include all the incomplete tiddlers of a certain type… but I want to be able to set a field on the tiddler to note that the incomplete record is acceptable.

So I want something like this:

title: $:/DefaultTiddlers

[tag[Tag]!has[fld1]] [tag[Tag]!has[fld2]] :filter[!has[skip-empties]]  OR :filter[skip-empties[no]]
<!--                                                                   ^^                       -->
[[Other initially]]
[[Open tiddlers]] 
[[Go here]]

But I don’t know how to do the highlighted OR. Obviously for AND, I would just concatenate additional filters. And I’m sure I could do it with a function. Or I could do it with temporary variables,
But I haven’t found a way to do this with basic filter syntax. I feel I’m likely just being blind; it’s probably there.

Any suggestions for how to do this?

This is mostly an academic exercise for me now. I met the same goals by making the checkbox for skip-entries simply delete the field when it’s unchecked.1 Which means the field has value yes whenever it’s set, and I don’t need to check the no clause. But I am still curious about this, and bothered that I’m not coming up with something.

How would you do this?


1 Using uncheckactions like this:

<$checkbox field=skip-empties checked=yes uncheckactions="<$action-deletefield skip-empties/>"  />

Will a non-blank skip-empties field always be no or yes? If so, you could try

[tag[Tag]!has[fld1]] [tag[Tag]!has[fld2]] :filter[!skip-empties[yes]]

which would pass both blank/missing and “no” values.

Edit: Or even [tag[Tag]!has[fld1]] [tag[Tag]!has[fld2]] +[!skip-empties[yes]]… since you’re not using get, you shouldn’t need :filter in particular.

If you were using more complex :filters that couldn’t be condensed into a single run, I think you would indeed need to call an externally defined filter/function and move the “or” runs there. I know you’re already well-acquainted with functions, but for the benefit of any readers who may be less familiar, here are a couple such approaches:

\function .filter1() [!has[skip-empties]]  ~[skip-empties[no]]
\define .filter2() [!has[skip-empties]]  ~[skip-empties[no]]

With a function:
[tag[Tag]!has[fld1]] [tag[Tag]!has[fld2]] :filter[.filter1[]]

With a filter (as required in pre-5.3.0 wikis):
[tag[Tag]!has[fld1]] [tag[Tag]!has[fld2]] +[filter<filter2>]

Yes, that would have covered the need fine, but as you point out, it doesn’t do the general case. And of course, doing it with a function isn’t such a big deal, but it feels as if this should be a common need and therefore we should already have a nice syntax for it. Oh well.

Thank you very much!