@jeremy thanks for the clarification. So it seems that you can correctly 
(in the sense of *syntactically* correct) use a macro call as argument of a 
widget attribute, but functionally fail to have it work as intended. This 
shows clearly that TW is way too much stuffed with booby-traps and 
something must be definitely done to make coding easier and safer for the 
average user. 

We need a stricter syntax, even at the expense of flexibility, to spare the 
user from these pitfalls, and we need debugging tools to make him easily 
single out the problem when syntax doesn't help. We cannot go on relying on 
knowledge of how the parser and 'wikifier' behaves, it simply cannot be 
viable if TW is to become widely used as is everybody's wish.
I'm not a complete beginner in programming, and as a matter of fact I spend 
50% of coding time trying to debug obscure malfunctioning that mostly turns 
out to require a developer-level knowledge of the parser to be worked out: 
I dare say that this scares away a lot of would-be users after the first, 
frustrating attempts.

In the meantime that TW morphs to something less tricky, a huge effort 
should be done IMHO in bettering the documentation so that the user is 
aware of the pitfalls left open by its syntax.

Thanks and regards,
CG

On Saturday, January 22, 2022 at 11:05:03 PM UTC+2 jeremy...@gmail.com 
wrote:

> Hi Charlie
>
> I often say "first things first, consider upgrading", but 5.2.1 has the 
> same issue.  So I say stick with what you have if it is working no-worse 
> than the latest.
>
>
> The problem is that the OP is using the macro "templatename" as an 
> attribute value in the `<$action-createtiddler>` widget, which means that 
> wikitext content will not be processed ("wikified"), so the transclusion in 
> the macro is ignored.
>
> The workaround is to use textual substitution within the macro (in other 
> words the $param$ and $(var)$ syntax).
>
> As for bug-reporting, that, to me, is a crappy process that needs some 
> tender loving care, including a need to update the related circa 2014 
> documentation (ReportingBugs <https://tiddlywiki.com/#ReportingBugs>).
>
>
> "Crappy"?
>
> It would be more helpful to explain the specific problems you see, and 
> perhaps suggest improvements.
>
> Best wishes
>
> Jeremy
>
>
> Rock'n roll !
>
>
>
>
>
> On Saturday, January 22, 2022 at 4:31:45 PM UTC-4 CarloGgi wrote:
>
>> It worked like a charm, thanks! 
>> If it is really a bug, is there a dedicated place to submit it for 
>> analysis?
>>
>> My TW version is 5.2.0
>>
>> Thanks again and regards,
>> CG
>>
>> On Saturday, January 22, 2022 at 9:57:46 PM UTC+2 cj.v...@gmail.com 
>> wrote:
>>
>>> TiddlyTalk is a pain.  Let me try pasting that code again so that it 
>>> shows okay over there.
>>>
>>> ```
>>> <$button>
>>>          <$action-createtiddler
>>>                  $basetitle="testTiddler"
>>>                  $template={{{ [[BASENAME-]addsuffix{!!grammar_class}] 
>>> }}} >
>>>
>>>                  <$action-navigate $to=<<createTiddler-title>>/>
>>>          </$action-createtiddler>
>>>  create new test tiddler
>>> </$button>
>>> ```
>>>
>>> On Saturday, January 22, 2022 at 3:53:48 PM UTC-4 Charlie Veniot wrote:
>>>
>>>> I'm thinking you found a bug related to how the action-createtiddler 
>>>> handles the $template parameter.
>>>>
>>>> In the meantime (i.e. until there is a fix or somebody can explain this 
>>>> "feature" going on) ...
>>>>
>>>> The following seems to work A-1 for me in my testing (ignore the "pre" 
>>>> tags):
>>>>
>>>> <pre>
>>>> <$button>
>>>>          <$action-createtiddler
>>>>                  $basetitle="testTiddler"
>>>>                  $template={{{ [[BASENAME-]addsuffix{!!grammar_class}] 
>>>> }}} >
>>>>
>>>>                  <$action-navigate $to=<<createTiddler-title>>/>
>>>>          </$action-createtiddler>
>>>>  create new test tiddler
>>>> </$button>
>>>> </pre>
>>>>
>>>> On Saturday, January 22, 2022 at 2:07:59 PM UTC-4 CarloGgi wrote:
>>>>
>>>>> hallo folks,
>>>>> i need to feed the $template parameter of an <$action-createtiddler> 
>>>>> widget with the correct template tiddler's name. The latter has a fixed 
>>>>> part 'BASENAME' and a parameterized (or variable) suffix, which is 
>>>>> choosen 
>>>>> by means of a <$select> input. The idea is to have a macro build the full 
>>>>> name based on the choice made by using <$select>, like in:
>>>>>
>>>>> \define templatename() BASENAME-{{!!grammar_class}}
>>>>>
>>>>> the suffix, as you can imagine, is taken from field grammar_class 
>>>>> which is set by the <$select> widget control.
>>>>>
>>>>> Now one would expect that things would work nice and easy writing this 
>>>>> code:
>>>>>
>>>>> <$button> create new test tiddler
>>>>>          <$action-createtiddler 
>>>>>                  $basetitle='testTiddler'
>>>>>                  $template=<<templatename>> >
>>>>>                  <$action-navigate $to=<<createTiddler-title>>/>
>>>>>          </$action-createtiddler>
>>>>> </$button>
>>>>>
>>>>> but disappointingly enough they do not! The new tiddler is created 
>>>>> indeed, but from NO TEMPLATE at all!
>>>>> Funny as it is, if we add a debug line like:
>>>>>
>>>>> template's name: <<templatename>> <br/>
>>>>>
>>>>> it displays correctly as
>>>>>
>>>>>     BASENAME-verb (or BASENAME-noun, or adjective, or whatever the 
>>>>> <$select> choice was)
>>>>>
>>>>> Hard-coding the name in the macro makes the code work (just for 
>>>>> testing purposes, there is no point here to have a macro just echoing an 
>>>>> hard-coded string).
>>>>>
>>>>> Now, before I ask why ON EARTH the above code doesn't work, let me say 
>>>>> that I expect for it to be because of how macros are parsed and when 
>>>>> macro 
>>>>> substitution is made, in which case I will do a little comment on it 
>>>>> later.
>>>>>
>>>>> Thanks everybody,
>>>>> CG 
>>>>>
>>>> -- 
> 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 tiddlywiki+...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/13f797cd-fc5f-457d-b598-80cfa214a017n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/tiddlywiki/13f797cd-fc5f-457d-b598-80cfa214a017n%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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/961c6974-ef92-487a-8b05-40859ea4db32n%40googlegroups.com.

Reply via email to