\define list-tagged-draggable-drop-actions()
<!-- Save the current ordering of the tiddlers with this tag -->
<$set name="order" filter="[<tag>tagging[]]">
<!-- Remove any list-after or list-before fields from the tiddlers with this tag -->
<$list filter="[<tag>tagging[]]">
<$action-deletefield $field="list-before"/>
<$action-deletefield $field="list-after"/>
</$list>
<$action-deletefield $tiddler=<<actionTiddler>> $field="tags"/>
<!-- Assign the list field of the tag with the current ordering -->
<$action-setfield $tiddler=<<tag>> $field="list" $value=<<order>>/>
<!-- Add the newly inserted item to the list -->
<$action-listops $tiddler=<<tag>> $field="list" $subfilter="+[insertbefore:currentTiddler<actionTiddler>]"/>
<!-- Make sure the newly added item has the right tag -->
<$action-listops $tiddler=<<actionTiddler>> $tags="[<tag>]"/>
</$set>
\end