kookma / TW-Commander

A tiddler toolkit for Tiddlywiki 5. Batch operations on bulk of tiddlers. Create, delete, add fields, tags, search and replace and inspect tiddlers.
https://kookma.github.io/TW-Commander/
49 stars 6 forks source link

All commander macros are restricted to commander #14

Closed flibbles closed 4 years ago

flibbles commented 4 years ago

Currently, TW-Commander injects 68 macros into the global macro namespace. And as far as I can tell, none of these are macros the end user will ever use. (Please correct me if I'm mistaken).

Every global macro has an overhead. This is something I've been trying to address in Tiddlywiki. Each increases stack depth and runtime. Also, they make widgets like <<dumpvariables>> all that much harder to use. On top of that, collision is quite possible, especially for some macros, like display or showTags or set-title. If the user uses the names of any of the 68 macros defined in Commander, they're guaranteed either to be breaking Commander, or their own tiddlers.

So I have this PR. Instead of using $:/tags/Macro everywhere, commander could use $:/tags/Commander/Macro and just use import pragma where necessary. I've done it. I've tested it, mostly. Should help keep Commander's affect on Tiddlywiki more minimal.

kookma commented 4 years ago

@flibbles This is what I discussed several time in forum! I also asked for private macro or submacro for example if a macro name is __name then it will not be treated as global or in a tiddler the first macro as global and the below ones as private

By the way thank you for this solution! Now I expect to have a quicker operation!

kookma commented 4 years ago

Seems there is a conflict!

flibbles commented 4 years ago

Should be ready to merge now.

I built both my PRs off of master, so there was just a touch of overlap.

kookma commented 4 years ago

@flibbles It is done now!