Hi Eric,
 Yes, that works wonderful! In this way I can hide the macros I don't want 
to be accessible by other tiddlers or globally.
Some times we create a code contains several parts, but only one macro 
should be available.

*Note:*
I use the  TW 5.1.18-prerelease, it seems instead of $includevariables I 
have to use $importvariables



Thank again Eric.

Cheers
Mohammad


On Sunday, July 1, 2018 at 8:16:07 PM UTC+4:30, Eric Shulman wrote:
>
> On Sunday, July 1, 2018 at 7:22:20 AM UTC-7, Mohammad wrote:
>>
>> The case is how can I have myMac available globally (can be invoked from 
>> any tiddlers) but smac1 and smac2 remain private!
>>
>
> 1) put myMac() in a tiddler tagged with $:/tags/Macro
> 2) put smac1() and smac2() in another tiddler (e.g., "smacFunctions") 
> tagged with "MyMacroFunctions"
>
> in the definition of myMac(), write:
>
> \define myMac(x,y)
> <$includevariables filter="[tag[MyMacroFunctions]]">
> <<smac1 $x$>> <<smac2 $y$>>
> </$includevariables>
> \end
>
> The <$includevariables> widget pulls in all the variables (i.e., macro 
> definitions) contained in the tiddlers matching the specified filter.
>
> Note that, if you only want to include variables from one specific 
> tiddler, then you don't need to use a tag... you can just specify the name 
> of the tiddler as the filter:
> <$includevariables filter="smacFunctions">
>
> enjoy,
> -e
>

-- 
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0dfda00c-2942-4819-8661-d53b5ea8a5dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to