Long standing bug in list-links-draggable Macro

Folks,

If you use the list-links-draggable Macro it defaults to current tiddler and the “list” field, however if you name a different field eg field=fieldlist the current tiddler is not defaulted, and you have to pass it as a parameter, to do this you must use the macrocall form;

<$macrocall $name=list-links-draggable tiddler=<<currentTiddler>>  field=fieldlist/>

See $:/core/macros/list

I am not yet set up to submit a change to this macro definition, only documentation.

The (shortened) macro definition looks like this:

\define list-links-draggable(tiddler,field:"list", ...)

So the tiddler variable is undefined. If tiddler is not specified, the macro does not work at all, which imo is intended. It fails silently.

So the fix can be done with documentation.

  1. We could add some info to the tiddler parameter, that it is required. All other parameters are optional.
  2. The examples could be extended to also show the <$macrocall version with tiddler and field defined, as shown in your example.

Why is this Mario?

If you use <<list-links-draggable>> the default is the currentTiddler will be used. That is it does not fail silently, it works

List dragable.json (369 Bytes)

Perhaps there is a use I don’t know but with its use with other fields one would think there is no need to fail silently, just work with the current tiddler.

I have re-written the macro defined in $:/core/macros/list and add it here so you can see the changes to the shadow with preview “differences from shdow”.

updated-list-macro.json (4.3 KB)

I am yet to exhaustively test it, but I can’t see how it would break anything.

If this passes “muster” perhaps someone can raise a change, or at least tell me which GitHub repository I would need to fork to submit a change to the core. Pending its review?

It does not work. The list-field is not changed. It falls back to the value before.

The TW default repo is called “master”.

  • Checkout “master”
  • create a new “feature-branch” eg: new-links-draggable
  • make your changes
  • push them to branch new-links-draggable in your rep
  • create a pull-request against Jeremy’s master branch

That’s the workflow

I wonder if anyone could test / review this package above. Then I will try my first core change?

Mario this works if you install my modifications above see updated-list-macro.json

  • Once dropped on tiddlywiki.com use the difrerence from shadow to see my changes.