Hi

No idea -- ask Jeremy :-) I borrowed the term from the FieldMangler widget 
-- there were two widgets to replace the functionality of the FieldMangler 
widget -- the SetFields widget (which dealt with fields) and the MangleTags 
widget (which dealt with tags) -- the name stuck (the x- is shorthand for 
action-.)

Now that I may abandon the original 'add=' 'remove=' schema, and that the 
widget is now aimed at general list operations, I suppose a new name will 
be appropriate at some stage -- perhaps: ActionEditList or ActionListOps.

The main objection to the use of filters comes from Jed -- the core methods 
and filters all assume single instances of a string, and Jed regards 
arbitrary list operations as essential. I don't know how much work would be 
involved in changing the core methods and filters to handle arbitrary 
lists. Introduces lots of complications :-(

The neat thing though, is that the same skills used to construct filter 
expressions may be used to carry out list operations -- and this takes care 
of most of the everyday usage nicely. For example:

To add a couple of strings/tags:

<$x-mangletags $list="mylist" $subfilter="newstring [[another new 
string]]"/>

-- this applies the specified subfilter to the current list -- the current 
list being specified with the $tiddler and $field attributes

To remove a couple of strings/tags, then sort the resulting list:

<$x-mangletags $list="mylist" $subfilter="-oldstring -[[another old 
string]] +[sort[]]"/>

To add the prefix '$' to all strings in the list (no idea what for):

<$x-mangletags $list="mylist" $subfilter="+[addprefix[$]]"/>

To create a list of all tiddler titles tagged with 'Widget', then sort them 
in reverse order:

<$x-mangletags $list="mylist" $filter="[tag[Widget]]" 
$subfilter="+[!sort[]]"/>

To remove all tags with the prefix '$' from the current tiddler:

<$x-mangletags $list="tags" $subfilter="+[!prefix[$]]"/>

As you may notice, this allows many options for maintaining order in a user 
list and the syntax isn't too bad for most commonly encountered operations. 
I think, with a few more filters designed for the task, this may be useful 
(might also include an option for direct operations in the widget aswell.) 

You can play around with this on the demo wiki I have posted.

regards

On Wednesday, 14 October 2015 20:29:42 UTC+2, Tobias Beer wrote:
>
> Hi Metabele,
>
> Looks very interesting but I fail to quite capture
> what it actually does and how it works.
>
> Tbh, I've always been a bit dumbfounded by the notion "mangle".
> What would I be doing when "mangling" or now x-mangling?
>
> Best wishes,
>
> — tb
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0dfb31ec-b1d4-45dc-8acd-26ab50d43801%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to