Set commands for Boolean precedence?

Have a suggestion for "Everything"? Please post it here.
Post Reply
2530
Posts: 14
Joined: Mon Jun 27, 2022 4:49 pm

Set commands for Boolean precedence?

Post by 2530 »

I understand I can manually switch the precedence in the Settings: or over and, or then and over or.

But then, for programmatical searches, I want to be sure the correct precedence is set, so I searched three voidtools pages

- Searching
- Command line interface
- Command line options

- and then the forum, for "precedence", but without finding such a command,

a) neither for the start of EV

b) nor for the "current" programmatical search.

I understand those commands would work differently:

a) would also reset the setting of the regular EV interface, whilst

b) would override any setting in/per a) for the current programmatical search.

Would it be possible for you to implement both commands / switches, or at least one of those (ideally, then b)?

For an example, a general switch could be
-booloa for or over and, and
-boolao for and over or,

and a specific switch could be
\boa for or over and, and
\bao for and over or, respectively.

Thank you very much for considering those!

And again, EV/ES is something absolutely wonderful; you obviously are the nicest man in the whole Windows industry!
therube
Posts: 5056
Joined: Thu Sep 03, 2009 6:48 pm

Re: Set commands for Boolean precedence?

Post by therube »

(I'm not quite following, but it should always be OR > AND - well, IMO ;-).)

I'll note...

Tools | Options | General -> Search --> Allow literal operators

will allow you to use OR and AND (case sensitive) with ES (or the GUI)
& quotes will negate that "OR and AND"
NotNull
Posts: 5517
Joined: Wed May 24, 2017 9:22 pm

Re: Set commands for Boolean precedence?

Post by NotNull »

The order of processing can be made independent of the operator prcedence setting by using grouping.

<a | b> c
a | <b c>
2530
Posts: 14
Joined: Mon Jun 27, 2022 4:49 pm

Re: Set commands for Boolean precedence?

Post by 2530 »

That is technically correct, but the idea is to avoid grouping when technically not necessary, and in most cases just smart ordering of the different elements and a fixed precedence (most of the time or over and, but not in all cases) would do; that's why I would like to be able to set it programmatically.
NotNull
Posts: 5517
Joined: Wed May 24, 2017 9:22 pm

Re: Set commands for Boolean precedence?

Post by NotNull »

Ok, that's all the help I can give (don't write the code)

Will move it to the Suggestions forum.
void
Developer
Posts: 17153
Joined: Fri Oct 16, 2009 11:31 pm

Re: Set commands for Boolean precedence?

Post by void »

< > Grouping should be used when the order of operations is important.

I will consider a search modifier to specify the precedence.
Thank you for your feedback and suggestions.
void
Developer
Posts: 17153
Joined: Fri Oct 16, 2009 11:31 pm

Re: Set commands for Boolean precedence?

Post by void »

Everything 1.5.0.1339a adds a ::and-precedence: and a ::or-precedence: search modifier.


For example:
::and-precedence: sonic tails | mario luigi
::or-precedence: sonic tails | mario luigi

Default: Use Tools -> Options -> Search -> Operator precedence setting.
Post Reply