Syntax of functions

Have a suggestion for "Everything"? Please post it here.
Post Reply
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Syntax of functions

Post by Stamimail »

Currently the syntax of Everything functions is based on the Windows syntax, which you type in at first the name of the function and then a : like this
functionname:

I think it is not a good method, since the program doesn't know when you intend to type a function name till the end of the functionname when you type :, so in meantime it searching for the letters you're typing and change the Results List without the user wish.

I suggest to make the functions syntax with a (customizable) prefix (and also suffix) something like

:functionname:
or
/functionname/
or
/functionname: (maybe this is the preferred syntax for functions)
or
/functionname= (maybe this is the preferred syntax for the ini file settings)
etc

When you type the prefix, the program know you are typing a function, so it won't affect the Results List till the function will be ready to be launched.
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: Syntax of functions

Post by therube »

An opening : or / or ... is still going to affect the results list - at the least by wiping all results out until the function name is fully typed out.

(Do we already have some sort of delayed interpretation of the search line?
Maybe something like that, but...)


(PS: / can already be used as an alternative to \, & already with one of the changes, I think it was with entering .ini changes from the search line, could potentially cause issues.)
salazor
Posts: 258
Joined: Tue Jun 17, 2014 10:52 am

Re: Syntax of functions

Post by salazor »

It fits me as now, but maybe not to interfere do it as in Excel:

Code: Select all

=functionname:
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Syntax of functions

Post by Stamimail »

therube wrote:An opening : or / or ... is still going to affect the results list - at the least by wiping all results out until the function name is fully typed out.
You display the problem well.
salazor wrote:It fits me as now, but maybe not to interfere do it as in Excel:

Code: Select all

=functionname:
Folders and Files can get = in their names, so the program indeed needs to look for = . Therefore I think it would be better to use one of these:
Image
void
Developer
Posts: 16683
Joined: Fri Oct 16, 2009 11:31 pm

Re: Syntax of functions

Post by void »

I understand the frustration with having to type function:

I'll be reviewing auto complete in Everything 1.5, and also adding support for customizing the main UI so you can have a size bar, date modified bar etc..

Maybe starting a search term with > could show a list of functions..
Allowing the user to customize the characters > and : in >size: is always a good idea.
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Syntax of functions

Post by Stamimail »

Also in mind,

The suffix = can tell the program it's ini entry.
The suffix : can tell it's a function.

Alternatively,

You can use a prefix, something like:

/settings:statusbar_selected_item_format=
/configuration:statusbar_selected_item_format=
/preferences:statusbar_selected_item_format=
/ini:statusbar_selected_item_format=

[Multiple possibilities make it Associative, meaning, you don't have to read the Help to find what you want.]

and also to create a short prefix (for advanced users use in High Frequently), something like:
/?statusbar_selected_item_format=
or
//statusbar_selected_item_format=
/>statusbar_selected_item_format=
etc

Now, as for Not function.
Currently the operator ! is been used.
But ! is also valid in Folder/FIle names ???
IMHO needs to be changed to something like:
/!
/!:

/!nottext
/!:.lnk

Another thing needs to take into account here for future release,
Text Mode (maybe I will write about this idea later)
If in the future Everything will partially support a Text search, since you may find Everything commands and tools helpful not only for manipulate File/Folders, but also for manipulate texts.
In Text Mode all characters are valid.
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Syntax of functions

Post by Stamimail »

Code: Select all

parent:<path>	  Search for files and folders in the specified path, excluding subfolders.
parents:<count>	Search for files and folders with the specified number of parent folders.
I think it is better not to use similar terminology for different commands.
void
Developer
Posts: 16683
Joined: Fri Oct 16, 2009 11:31 pm

Re: Syntax of functions

Post by void »

The following functions are the same:
infolder:
parent:
nosubfolders:

path: would have been nice to use here, but it was already taken as the match full path and filename search modifier.

The following functions are the same:
parents:
depth:

I'll consider using the depth: search function in place of the parents: search function.
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Syntax of functions

Post by Stamimail »

Also,
I think to use a special character as a prefix for showing a list of functions is a good idea.
Do you think it is possible to include in that "list of functions", not only the functions names but also their descriptions, as they are in "Search Syntax" help?
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Syntax of functions

Post by Stamimail »

Another idea for suffix for functions
You can use something like { } or < >
(< > is more readable than " ", and unlike { } it is invalid character in folder/file name)

/functionname<abc def>
/regex<gr(a|e)y>
/regex:<gr(a|e)y>

in this way it will be more easy to define a range for the function.
viewtopic.php?f=5&t=6417&p=19636#p19658
nod5
Posts: 38
Joined: Fri Aug 19, 2016 9:12 pm

Re: Syntax of functions

Post by nod5 »

void wrote: Thu Mar 23, 2017 2:51 am I understand the frustration with having to type function:

I'll be reviewing auto complete in Everything 1.5, and also adding support for customizing the main UI so you can have a size bar, date modified bar etc..

Maybe starting a search term with > could show a list of functions..
Allowing the user to customize the characters > and : in >size: is always a good idea.
Suggestion: If a user at the start of the searchbox or after a space types : (colon character) then Everything shows a list of functions and stops showing file results as long as the list is visible. The list would work like intellisense/autosuggest in code editors.
- Typing filters the list
- Up/Down naviges the list
- Tab and Enter applies the selected row

When the user applies a selected row Everything transforms the : and the typed string into function:
For example the user types :ex and select ext from the list then Everything transforms :ex into ext:

This gets you autosuggest without introducing a new special character like > to show the autosuggest list and it is backwards compatible with the current function: format.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Syntax of functions

Post by NotNull »

Funny. Was just thinking about it and came up with the same idea! :)
As long as it ends the autofill when I type ":\" (I use that a lot: :\TEMP to only get the rootfolders TEMP)
Alternative: "::" instead of ":"

Other ideas:
- Functions like Excel/Libre Office Calc:
2019-05-27 21_51_18-Window.png
2019-05-27 21_51_18-Window.png (17.95 KiB) Viewed 21689 times
- Sublime (editor) uses Ctrl-P to open a "quicksearch box" (it has an official name, but works like Google Search / Firefox' about:config )
type "date" to zoom in on all date related functions/modifiers/ ...
nod5
Posts: 38
Joined: Fri Aug 19, 2016 9:12 pm

Re: Syntax of functions

Post by nod5 »

NotNull wrote: Mon May 27, 2019 7:55 pm Funny. Was just thinking about it and came up with the same idea! :)
As long as it ends the autofill when I type ":\" (I use that a lot: :\TEMP to only get the rootfolders TEMP)
:) I hope an autosuggest feature could be made compatible with that use case.
NotNull wrote: Mon May 27, 2019 7:55 pm - Sublime (editor) uses Ctrl-P to open a "quicksearch box" (it has an official name
I think the generic term at least in code editors (Atom, Sublime, VS Code, ...) is Command Palette. For example
https://code.visualstudio.com/docs/gets ... nd-palette
VS Code uses ctrl+shift+P and that keyboard shortcut is vacant in Everything.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Syntax of functions

Post by NotNull »

nod5 wrote: Mon May 27, 2019 9:37 pm I think the generic term at least in code editors (Atom, Sublime, VS Code, ...) is Command Palette.
Yep, that's the one. Thanks!

BTW: Not only in editors. In fman (filemanager) and mpv.net (videoplayer with Everything integrated) it is also called Command Palette. I think you found the official term :)

EDIT: Sublime also uses Ctrl-Shift-P (and so do fman and mpv.net; looks like the de facto standard)
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Syntax of functions

Post by Stamimail »

Compare:
Menu > Help > Search Syntax
Menu > Tools > Options... > Keyboard > Show commands containing: _______
void
Developer
Posts: 16683
Joined: Fri Oct 16, 2009 11:31 pm

Re: Syntax of functions

Post by void »

There are hundreds of functions ready for the next major version..

The user will need to be able to find these functions and their syntax easily.

I like the Excel Function Wizard, something like that could work well.

I also want Everything to show the syntax of a function with an example in a tooltip, when you type in size: a tooltip is shown, something like:
size:value

Examples:
size:<2mb
size:10mb..100mb

Summary
Find files with the matching size in bytes.

value
The size or range of sizes in bytes to find.
KB, MB or GB suffixes can be used.
I like the idea of using : to auto suggest functions, I'll consider :function: as valid function syntax, eg:
:size:<2mb

Thanks for the suggestions.
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Syntax of functions

Post by Stamimail »

void wrote: Thu May 30, 2019 2:06 am I also want Everything to show the syntax of a function with an example in a tooltip, when you type in size: a tooltip is shown, something like:
size:value

Examples:
size:<2mb
size:10mb..100mb

Summary
Find files with the matching size in bytes.

value
The size or range of sizes in bytes to find.
KB, MB or GB suffixes can be used.
I think this kind of "tooltip" is very important, and needs a designer and "try and error" for best result. It would be a main feature with high frequency of use in Everything.
It should fit with voidtools website help for make easy the maintenance.
You can also add in this "tooltip" the Help in forum, like:
More info:
viewforum.php?f=5 /functions/size/
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Syntax of functions

Post by Stamimail »

void wrote: Thu May 30, 2019 2:06 amI like the idea of using : to auto suggest functions, I'll consider :function: as valid function syntax, eg:
:size:<2mb
How do you solve the range of function problem, for functions like
:regex:
Janus
Posts: 84
Joined: Mon Nov 07, 2016 7:33 pm

Re: Syntax of functions

Post by Janus »

A thought.
First, the current advanced search is great, but cumbersome, and it also puts things in an odd order in the search box.

Between 'Search' and 'Bookmarks', you could put 'Filters', a drop down containing commonly used filters.
When a filter is selected, it is either prepended, or appended to the contents of the search bar.
A default date search might be inserted set for the last year based on the date. dm:d/m/y-1..d/m/y

That insert however, could be wrapped in { } characters.
Or you could use ` or even ~ to indicate a toggle to a command.
Those two characters are above tab to the left of 1, at least on my keyboard.
With or without the wrapper, it would make it easier for beginners insert filters.
A quick alt-I and some arrow keys would get them a starting place.

Just thoughts.


Janus.
void
Developer
Posts: 16683
Joined: Fri Oct 16, 2009 11:31 pm

Re: Syntax of functions

Post by void »

How do you solve the range of function problem, for functions like
:regex:
It's still on my TODO list, I really want something for content:, other functions I'm not so sure it will be useful.

What I want is content:<abc 123> to search for content:abc content:123
This wouldn't work for functions that take an integer as < is used for less than, which is fine as it is only really useful for functions that take a string.
You'll also need to escape a literal < with double quotes..
I need to spend more time on this..
First, the current advanced search is great, but cumbersome, and it also puts things in an odd order in the search box.
The order is by design, each function has a weight and the most expensive functions are placed at the end of the search.
The next major version of Everything this will not matter as search terms will be reordered behind the scenes.

A treeview to the left of the advanced search may make it easier to jump to a section of interest.
Adding any of the advanced search options to the toolbar may make the more common search options more accessible.
Between 'Search' and 'Bookmarks', you could put 'Filters', a drop down containing commonly used filters.
Thanks for the suggestion, I'll consider a filters menu.
Post Reply