Inconsistant syntax between ext and common grouping

Have a suggestion for "Everything"? Please post it here.
Post Reply
aviasd
Posts: 135
Joined: Sat Oct 07, 2017 2:18 am

Inconsistant syntax between ext and common grouping

Post by aviasd »

Hi,

This is just a minor issue, but grouping multiple extensions using ext:ext1;ext2 differs from the common way of grouping <file1|file2>

Imo, to retain consistency, the ext handler should support the common way as well..

Br,
Avi

Edit: Sorry, Please move to suggestions
Last edited by NotNull on Fri Jun 05, 2020 3:37 pm, edited 1 time in total.
Reason: Moved to Suggestion orum
NotNull
Posts: 5252
Joined: Wed May 24, 2017 9:22 pm

Re: Inconsistant syntax between ext and common grouping

Post by NotNull »

See also: viewtopic.php?f=4&t=8933

My personal opinion:

Use ";" for functions [1] to separate a range of parameters and use "|" only as a logical operator.
Some functions only take 1 parameter, so there the | operator should be used:
dm:yesterday | dm:tomorrow

You want to avoid situations like this one: ext:ext1|file1. Should that search for:
files with extension ext1 OR with extension file1?
- or-
files with extension ext1 OR search for files named file1?


[1] And maybe add "," so you could also use ext:ext1,ext2
void
Developer
Posts: 15279
Joined: Fri Oct 16, 2009 11:31 pm

Re: Inconsistant syntax between ext and common grouping

Post by void »

Thanks for the suggestion.

Currently Everything uses a mixture of syntaxes for lists.

In future releases, most Everything search functions that take a list will eat the |

The planned search syntax for lists is:
<string> ::= <any non whitespace character or double quote>* | " <non double quote character>* "
<literal |> ::= <a literal pipe character>
<delimiter> ::= ; | <literal |>
<list> ::= <string> | <list><delimiter><string>

function:<list>

This will be consistent for all search functions that take a list as a parameter.

To use the OR operator, you would need to use a space to break the current search term, for example:
ext:ext1 | file1

The plan is to reserve < and > in functions for sub expressions, for example:
content:<foo bar>
is the same as:
content:foo content:bar
aviasd
Posts: 135
Joined: Sat Oct 07, 2017 2:18 am

Re: Inconsistant syntax between ext and common grouping

Post by aviasd »

void wrote: Sat Jun 06, 2020 12:53 am
<string> ::= <any non whitespace character or double quote>* | " <non double quote character>* "
<literal |> ::= <a literal pipe character>
<delimiter> ::= ; | <literal |>
So in this case there will be two OR delimiters: ; and | ?
<list> ::= <string> | <list><delimiter><string>
I'm not sure i understand this one - how would a list be enclosed ? inside < and > ? does this definition allows creating lists within lists ?

I think using | for OR is the common practice in most programming language, and I think only Ms implemented the ; as an OR delimiter for file extensions..
But if in the above case, both will be supported, It's a good solution.

Expressing what you need everything to find in the quickest way was always one of it's strength and searching in it always feels very natural to use, w/o thinking too much about syntax, so the more ways for express-abiliy the better
The plan is to reserve < and > in functions for sub expressions, for example:
content:<foo bar>
is the same as:
content:foo content:bar
I'm guessing that Inside the sub expressions the OR delimiter could be used ? e.g content:<foo|bar>
void
Developer
Posts: 15279
Joined: Fri Oct 16, 2009 11:31 pm

Re: Inconsistant syntax between ext and common grouping

Post by void »

So in this case there will be two OR delimiters: ; and | ?
Yes, two delimiters will be supported.
; can be escaped with double quotes.
doubles quotes can be escaped with quot: (or &quot: in future versions of Everything)
| can be escaped with &verbar: in future versions of Everything.
I'm not sure i understand this one - how would a list be enclosed ? inside < and > ? does this definition allows creating lists within lists ?
The list does not need to be enclosed.
A whitespace will break the search term.
lists cannot contain more lists.
think of the list syntax as:
<string><delimiter><string><delimiter><string><delimiter><string>...

list functions do not need to support sub-expressions.
I will consider adding support for < and > to enclose lists.
whitespaces inside < and > would most likely be treated as literal.
I'm guessing that Inside the sub expressions the OR delimiter could be used ? e.g content:<foo|bar>
Correct.
subexpressions will support:
whitespace = AND
| = OR
! = NOT

Everything 1.4 syntax:

ext:jpg;png;gif
filelist:"new text document.txt|new text document (2).txt"

Future syntax:

ext:jpg;png;gif
ext:jpg|png|gif
filelist:"new text document.txt";"new text document (2).txt"
filelist:"new text document.txt"|"new text document (2).txt"
filelist:"new text document.txt|new text document (2).txt"
possibly: filelist:<new text document.txt|new text document (2).txt>
aviasd
Posts: 135
Joined: Sat Oct 07, 2017 2:18 am

Re: Inconsistant syntax between ext and common grouping

Post by aviasd »

void wrote: Mon Jun 08, 2020 12:26 am
Yes, two delimiters will be supported.
; can be escaped with double quotes.
doubles quotes can be escaped with quot: (or &quot: in future versions of Everything)
| can be escaped with &verbar: in future versions of Everything.
I see . I'm guessing you have your reasons of not escaping with the standard backslash \

whitespaces inside < and > would most likely be treated as literal.
I'm guessing that Inside the sub expressions the OR delimiter could be used ? e.g content:<foo|bar>
Correct.
subexpressions will support:
whitespace = AND
| = OR
! = NOT
I'm sorry if I'm being difficult here but you say that whitespaces inside sub expressions would be treated as literal as well as being an AND delimiter.
So which one is the correct one ?

I think what you expressed in the first post will likely be the better option - an AND expression
for example:
now to find a folder that has both invoice and work. I need to specify two search terms:

Code: Select all

parent:invoice parent:work
If that could be shortened to

Code: Select all

parent:<invoice work> 
it's more concise. It can create a bit of confusion if you want to search for a filename called "invoice work" which in that case parent:"invoice work" (or parent:<"invoice work"> for consistency ) would be the correct term.
I do think that whitespace as an AND delimiter inside sub expressions can create a bit of ambiguity and suggest you would consider an explicit delimiter for AND. (Maybe & ? )
Somthin like

Code: Select all

parent:<invoice&work>
or even

Code: Select all

parent:invoice&work
Everything 1.4 syntax:

ext:jpg;png;gif
filelist:"new text document.txt"|"new text document (2).txt"
filelist:"new text document.txt|new text document (2).txt"

Future syntax:

ext:jpg;png;gif
ext:jpg|png|gif
filelist:"new text document.txt";"new text document (2).txt"
filelist:"new text document.txt"|"new text document (2).txt"
filelist:"new text document.txt|new text document (2).txt"
possibly: filelist:<new text document.txt|new text document (2).txt>
This makes it very clear :) Thanks!
P.S - Thanks for the detailed response !
Post Reply