Annotating complex Visual Filters

Features wanted...
Post Reply
aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Annotating complex Visual Filters

Post by aurumdigitus »

While recently doing an involved operation it become necessary to construct several intricate Visual Filters. It would have been very handy to have been able to Comment them with a // at the end of the line as with Scripts.

Could this or a similar approach be implemented?

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Annotating complex Visual Filters

Post by TheQwerty »

You could always turn your filter into a script and use string concatenation to construct the filter over multiple lines and with comments.

It may not be elegant but it would get the job done.

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: Annotating complex Visual Filters

Post by aurumdigitus »

You approach is innovative and yes does get the job done. Unless and until Don replies it will suffice.

admin
Site Admin
Posts: 66360
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Annotating complex Visual Filters

Post by admin »

aurumdigitus wrote:While recently doing an involved operation it become necessary to construct several intricate Visual Filters. It would have been very handy to have been able to Comment them with a // at the end of the line as with Scripts.

Could this or a similar approach be implemented?
Not being a RegExp expert: Would // at the end of the line be safe (non-ambiguous) with all sorts of RegExp filters?

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: Annotating complex Visual Filters

Post by aurumdigitus »

Admin wrote:Not being a RegExp expert: Would // at the end of the line be safe (non-ambiguous) with all sorts of RegExp filters?
Not being RegExp gifted either that's why left open the door to similar approach, i.e. some other symbol or character.

Gandolf

Re: Annotating complex Visual Filters

Post by Gandolf »

Another file manager uses the approach...

Code: Select all

GRAPHICS: *.bmp,*.gif,*.ico,*.jpe,*.jpeg,*.jpg,*.png
where the name (or, in your case, description) of the filter is to the left of the colon, and the filter to the right. I think I mentioned this somewhere else in the forum long ago.

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Annotating complex Visual Filters

Post by Stefan »

admin wrote:
aurumdigitus wrote:While recently doing an involved operation it become necessary to construct several intricate Visual Filters. It would have been very handy to have been able to Comment them with a // at the end of the line as with Scripts.

Could this or a similar approach be implemented?
Not being a RegExp expert: Would // at the end of the line be safe (non-ambiguous) with all sorts of RegExp filters?
Did you mean 'Visual Filter' is an RegEx and you want to add an option to comment within that RegEx?

Then try (?#comment)
http://www.regular-expressions.info/comments.html

inline modifier (?x).
http://www.exampledepot.com/egs/java.ut ... mment.html

``the /x modifier'',
http://www.perl.com/doc/manual/html/pod/perlre.html

admin
Site Admin
Posts: 66360
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Annotating complex Visual Filters

Post by admin »

Stefan wrote:
admin wrote:
aurumdigitus wrote:While recently doing an involved operation it become necessary to construct several intricate Visual Filters. It would have been very handy to have been able to Comment them with a // at the end of the line as with Scripts.

Could this or a similar approach be implemented?
Not being a RegExp expert: Would // at the end of the line be safe (non-ambiguous) with all sorts of RegExp filters?
Did you mean 'Visual Filter' is an RegEx and you want to add an option to comment within that RegEx?

Then try (?#comment)
http://www.regular-expressions.info/comments.html

inline modifier (?x).
http://www.exampledepot.com/egs/java.ut ... mment.html

``the /x modifier'',
http://www.perl.com/doc/manual/html/pod/perlre.html
(?#comment) is already supported in all XY RegExps.

In other contexts (POM, Favorites) we can have quoted captions at the beginning of the item, so why not here? The caption/comment would be preprended to the VF as "Caption" (incl the quotes and followed with a space!).
Now, consequently should the tab caption show just the VF caption (if there is any)? Like this (for a filter "images" *.gif|*.png|*.jpg):
To see the attached files, you need to log into the forum.

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Annotating complex Visual Filters

Post by Stefan »

admin wrote: Now, consequently should the tab caption show just the VF caption (if there is any)? Like this (for a filter "images" *.gif|*.png|*.jpg):
I think this is an good idea.

For the others, as I see now, one can already use
*.gif|*.png|*.jpg|//Show Images only comment

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: Annotating complex Visual Filters

Post by aurumdigitus »

v8.90.0014 - 2010-03-24 14:00
+ Visual Filters: Now you can prepend a caption to each filter item. The syntax is similar to the one you know from Favorites or the POM, only that the quoted caption must be followed by a space character to avoid ambiguities.
For example:
"Images" *.gif|*.png|*.jpg
"Items ending with g" >g$
The tab captions will show only the (unquoted) caption of a VF with caption.
How that the code has appeared in Beta with near the speed of light hopefully others in addition to Don and myself will find it a useful adjunct! 8)

Post Reply