[tw] Re: Unable to get SetTiddlerColums transclusion working

2010-08-01 Thread TonG
Thanks Eric for the elaborate explanation.
Not reproducible results are always difficult to live with. Now I
understand.

The noPreParse fix - as expected - does work.

Tnx again,

Ton

On Jul 31, 10:20 pm, Eric Shulman elsdes...@gmail.com wrote:
  So, I can use the *old* script version but I am curious about why the
  transclusion version does not work (always).

 Transclusions use evaluated parameters in the tiddler macro to
 invoke code.  However, the handler for the tiddler macro has a subtle
 side-effect:

 parseParams() -- the function that processes the evaluated parameters
 -- is being called TWICE for each tiddler macro once by the
 core invokeMacro() function (this is done for ALL macros), and again
 by the tiddler macro's handler (so it can retrieve *named* parameter
 values).

 Unfortunately, because of the way SetTiddlerColumn (and other similar
 transclusions) operate, the doubled processing results in an error
 (too much recursion) that stops the code from working as intended.

 Fortunately, the good news is that I reported this issue quite some
 time ago, and that my suggested *support* for a fix was added to the
 core, starting with TW 2.5.x.  The solution involves switching off
 the pre-parsing done by invokeMacro(), so that only the
 tiddler.handler() parses the parameters and the evaluated params are
 invoked only once.

 The core fix is to look for a special flag, 'noPreParse', associated
 with a given macro, that signals it to bypass the default parsing and
 allow the specific macro handler to do all the parsing itself.

 Note: for backward-compatibility purposes, the 'noPreParse' flag is
 NOT set by default for any core macros, including the tiddler
 macro.  This means that the current behavior, including the double-
 processing side effect, is still  in effect, and ensures that existing
 documents won't have any problems after upgrading to the current TW
 core.

 Nonetheless, it is of course, 100% completely safe to activate the fix
 when writing NEW content, since nothing would be relying upon the old,
 buggy behavior.

 To activate the noPreParse fix for the tiddler macro, you should
 put the following into a tiddler, tagged with 'systemConfig':

 //{{{
 // prevents double processing of tiddler macro
 config.macros.tiddler.noPreParse=true;
 //}}}

 enjoy,
 -e
 Eric Shulman
 TiddlyTools / ELS Design Studios

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlyw...@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.



[tw] Re: Unable to get SetTiddlerColums transclusion working

2010-07-31 Thread TonG
SetTiddlerColumns started as a script. I found v1.0.0 here:
http://groups.google.com/group/tiddlywiki/browse_thread/thread/70bae199a81169c0/82bd74120381ec17?lnk=gstq=settiddlercolumns#82bd74120381ec17

As a script it works in my situation: I can set x columns and the text
is displayed in x columns.

The later transclusion version does not work in the mentioned minimal
test case and in most of my TWs.
In only one TW - with about 15 plugins - it dows work. Influence of
plugins?
So, I can use the *old* script version but I am curious about why the
transclusion version does not work (always).

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlyw...@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.



[tw] Re: Unable to get SetTiddlerColums transclusion working

2010-07-31 Thread Eric Shulman
 So, I can use the *old* script version but I am curious about why the
 transclusion version does not work (always).

Transclusions use evaluated parameters in the tiddler macro to
invoke code.  However, the handler for the tiddler macro has a subtle
side-effect:

parseParams() -- the function that processes the evaluated parameters
-- is being called TWICE for each tiddler macro once by the
core invokeMacro() function (this is done for ALL macros), and again
by the tiddler macro's handler (so it can retrieve *named* parameter
values).

Unfortunately, because of the way SetTiddlerColumn (and other similar
transclusions) operate, the doubled processing results in an error
(too much recursion) that stops the code from working as intended.

Fortunately, the good news is that I reported this issue quite some
time ago, and that my suggested *support* for a fix was added to the
core, starting with TW 2.5.x.  The solution involves switching off
the pre-parsing done by invokeMacro(), so that only the
tiddler.handler() parses the parameters and the evaluated params are
invoked only once.

The core fix is to look for a special flag, 'noPreParse', associated
with a given macro, that signals it to bypass the default parsing and
allow the specific macro handler to do all the parsing itself.

Note: for backward-compatibility purposes, the 'noPreParse' flag is
NOT set by default for any core macros, including the tiddler
macro.  This means that the current behavior, including the double-
processing side effect, is still  in effect, and ensures that existing
documents won't have any problems after upgrading to the current TW
core.

Nonetheless, it is of course, 100% completely safe to activate the fix
when writing NEW content, since nothing would be relying upon the old,
buggy behavior.

To activate the noPreParse fix for the tiddler macro, you should
put the following into a tiddler, tagged with 'systemConfig':

//{{{
// prevents double processing of tiddler macro
config.macros.tiddler.noPreParse=true;
//}}}

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To post to this group, send email to tiddlyw...@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.