Consistency for groups

Have a suggestion for "Everything"? Please post it here.
Post Reply
Fraka
Posts: 27
Joined: Thu Jan 12, 2017 5:07 pm

Consistency for groups

Post by Fraka »

Hi!

Is there a reason why some groups are delimited by pipe symbol and some by semicolon?
I always forget how to do it and it would be much easier to just follow the convention that the pipe symbol stands for "or".

Furthermore, the help is talking about lists but never defines a list. Wouldn't it be more consistent to call them groups, too?

Another thing that is a bit unlucky in the help docs is that grouping actually uses <>. Most of the time if you see something like

Code: Select all

child:<filename>
you would suppose it means

Code: Select all

child:MyFile.txt
But then you got

Code: Select all

ext:<list>
which is used like this:

Code: Select all

ext:<doc;ppt;txt>
Makes you wonder if the upper one stands for a group of filenames. But then you would delimit them with pipe symbol, not with semicolon as in the ext function.

Kind of a damper for self-learning the syntax.

Happy Halloween,
Fraka
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Consistency for groups

Post by NotNull »

Legacy. You can use the "|" syntax and just 'forget' about the rest :)
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Consistency for groups

Post by raccoon »

One is a group of items

<item1|item2|item3>

the other is a function with parameters

function:param1;param2;param3

Your decision to wrap function parameters inside of <> is arbitrary and generally unnecessary.

But be thankful there are options and flexibility for every situation you might encounter, including personal preference.

EDIT

If you are getting the angle brackets <> from the help documentation, please note this may be your source of confusion.
ext:<list> --- Search for files with a matching extension in the specified semicolon delimited extension list.
source: https://www.voidtools.com/support/everything/searching/

Those angle brackets are not literal syntax but instead what is called "augmented BNF" documentation syntax, where angle brackets <> denote required parameters, and square brackets [] denote optional parameters. You're not supposed to actually type out the brackets, but, sometimes you can anyway.

The correct syntax to type is: ext:jpg;png;gif
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Consistency for groups

Post by NotNull »

raccoon wrote: Mon Oct 31, 2022 3:25 pm Your decision to wrap function parameters inside of <> is arbitrary and generally unnecessary.
That depends ...
I wouldn't know any syntax to find pictures with width 1920 or 640 other than width:<1920|640>

(other than width:1920 | width:640, but try that with 5 different horizontal resolutions ;))
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Consistency for groups

Post by raccoon »

I concede[d] that there are situations where it can be useful to use alternation grouping in some functions, but it's generally unnecessary. His specific examples were indeed arbitrary or just mistaken reading of the documentation's ABNF.

That said, I am curious why functions like width and height and other single-parm functions can't/don't/won't automatically detect parm2;parm3... as alternation. As in height:720;1080 instead of height:<720|1080>. Is this a decision that has been articulated as change going forward?

(to the armchair reader: height:720..1080 can actually be more useful since it also discovers all heights in-between, as in 1040 and 1036, found in common aspect ratios.)
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Consistency for groups

Post by void »

Everything tries to follow the Unix man page syntax standard.

<param> = required parameter.
[param] = optional parameter.

The < and > are not literally required.
The [ and ] are not literally required.

For example:

child:<filename>

accepts:

child:abc123.txt



width:<width>

accepts:

width:1920



ext:<semicolon-delimited-list>

accepts:

ext:jpg;png



Everything 1.5 will support ; or | as a list separator.
Generally ; is the preferred list separator.

Everything 1.4 has a mixture of ; or | support for different functions so I can understand the confusion.
filelist: is an odd one out in Everything 1.4 that requires an | list.



Everything 1.5 will add support for sub-expressions.

For example:

width:<1920|3840>

expands to:

width:1920 | width:3840



Everything 1.5 will also add support for Group expansion.

For example:

gr<a|e>y

expands to:

gray|grey



Please try the Everything 1.5 search function syntax.
Some of this updated help still applies to Everything 1.4
Fraka
Posts: 27
Joined: Thu Jan 12, 2017 5:07 pm

Re: Consistency for groups

Post by Fraka »

Thank you for your answers. It is a bit clearer now, but still some confusion.
I think those examples/"accepts" would be very helpful in the help docs...
Maybe link to the according example in the chapter below or write it directly into the help list. I wouldn't mind it to be a bit more detailed. We already have a concise cheatsheet offline in the program itself (Help --> Search syntax).
By the way I'm open to do some work by myself and send you the suggestion.

Still I don't get why there is a difference between lists and groups or what the difference is and why it is necessary.

NotNull wrote:You can use the "|" syntax and just 'forget' about the rest
contradicts
void wrote:Generally ; is the preferred list separator.
According to that it should be

Code: Select all

width:<1920;3840>
or even

Code: Select all

width:1920;3840
not

Code: Select all

width:<1920|3840>
? But I like and prefer the last line, it's much closer to the convention or expectations.
raccoon wrote:the other is a function with parameters function:param1;param2;param3
It's just a function followed by a list of values.

Do we have functions that really take positional parameters? Actually it's always just a single value (which includes e.g. ranges - those are just a fancy data type) or a list of OR-connected-values ("logic disjunction")?

Imho lists and groups are not well distiguishable, should be the same and have the same syntax.

So I'd hope to get rid of semicolon as delimiter and use

Code: Select all

function:<value1|value2|value3>
for multiple values and

Code: Select all

function:value1
for single values everywhere.

If Everything supports semicolon instead of pipe as delimiter and can detect lists that are not wrapped in brackets, that is just a comfort bonus feature.

However, it looks like 1.5 will make this whole thread obsolete. Supports bracketed groups everywhere no matter if it is internally treated as list, parameter, whatever.
Maybe add a new example to the docs:

Code: Select all

Search for jpg or png files on the D: drive:

d: *.jpg|*.png

or

d: ext:<jpg|png>
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Consistency for groups

Post by void »

width:1920;3840

width:<1920|3840>
width: doesn't accept a list of values.
; should only be used for functions that accept lists (eg: ext:, filelist:, pathlist:, people:, tags: etc..).

width:<1920|3840> (sub-expressions) is the preferred usage here.
width:1920;3840 will not work.
I will consider adding support for this ; syntax.



ext:<jpg|png> works, but the preferred usage is:
ext:jpg;png

perhaps the function should have been called extlist:, but that is a lot more to type.
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Consistency for groups

Post by void »

Everything 1.5.0.1328a adds semicolon (;) delimited list support to search functions.

You can now use a semicolon (;) delimited list with any search function that accepts numbers or dates.

For example:

width:1920;3840
( is the same as width:1920 | width:3840 or width:<1920|3840> )

dm:2022-11-10;2022-10-10;2022-09-10
( is the same as dm:2022-11-10 | dm:2022-10-10 | dm:2022-09-10 or dm:<2022-11-10|2022-10-10|2022-09-10> )
Post Reply