Thanks Jeremy, By the way I created a macro in a tiddler called "global macro" in tiddlywiki.com as below
\import [all[shadows+tiddlers]tag[$:/tags/localMacro]!has[draft.of]] \define test() This is a test The $:/tags/localMacro is used to tag my local macro and have few tiddlers tagged with $:/tags/localMacro Then in another tiddler I wrote <<test>> Nothing is shown! Then I removed the first line and blank lines from "global macro" it works! What is the problem. --Mohammad On Friday, August 30, 2019 at 1:43:41 PM UTC+4:30, Jeremy Ruston wrote: > > Hi Mohammad > > You can use the existing import pragma to bring in macro definitions from > other tiddlers without cluttering the global name space. For example, you > might have a global macro defined in a tiddler tagged $:/tags/Macro, and > then put your local macros into tiddlers just tagged > $:/tags/MyPublisher/MyPlugin/LocalMacros. Then, at the top of your global > macro you’d bring in those local macros with: > > \import > [all[shadows+tiddlers]tag[$:/tags/MyPublisher/MyPlugin/LocalMacros]!has[draft.of]] > > \define myPublicMacro() > … > > > Best wishes > > Jeremy > > > > On 30 Aug 2019, at 05:47, Mohammad <[email protected] <javascript:>> > wrote: > > Description > > It is quite common when developing a macro to do a specific task, it needs > some auxiliary macros. For example I wrote a macro *mySearch* to do > search in tiddlers text field which itself call another macro to show the > result *showResult *in some specific format. Users only needs to call > *mySearch* and not *showResult*. > > > These global macros (tagged with $:/tags/Macro) are anywhere available > and make the whole namespace messy. > > > Proposal > > Like other programming language we can have sub macro or private members. > For example TW core can prevent access to all macros in a tiddler tagged > with $:/tags/Macro if their name meet some certian criteria for example: > __NANE__ or __::NAME > > > Benefits > > A tiddler tagged with $:/tags/Macro with many macro variables in it acts > like a small namespace. Only certain macro can be called (are global) and > other follow the above rule only accessible from inside that tiddler. > Tiddlywiki will remain tidy, Global vars will not overwrite each other, ... > > > > --Mohammad > > > > > > -- > 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] <javascript:>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/tiddlywiki/7dd82716-23d8-4be5-abd6-2028bab54d8f%40googlegroups.com > > <https://groups.google.com/d/msgid/tiddlywiki/7dd82716-23d8-4be5-abd6-2028bab54d8f%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/61d47b39-4cdc-4c60-a94a-3738b856c5f5%40googlegroups.com.

