In ConTeXt mkiv, how do I register a callback? callback.register() does nothing (and IIRC most callbacks are frozen anyway) and somewhere I found tasks.appendaction, but this gives me an error that tasks is not defined (nil).

I'd like to add something to the post_linebreak_filter callback.

Edit: thanks to Khaled's answer and help from the Mailing list, I've got a solution now. The key is to create my own namespace:

moduledata.mystuff={}

and add my function:

moduledata.mystuff.show_hyph = show_hyph

and to register the function to the "finalizers" callbacks, which are the post_linebreak_filter equivalent in ConTeXt.

@Charles: Sorry for entering this discussion late. (I can't quite follow since parts are already deleted.) Just wanted to say: I usually strongly discourage people to include answers into the question. Just a pointer is OK, but I think we should keep answers to answers. What do you think? (@Patrick: In my opinion you've already got to much of an answer in the question now.)
–
Hendrik VogtMar 2 '11 at 14:39

@Charles: Thanks for the feedback. Well, for a question with three hundred and two answers, a summary is somewhat necessary, but here we have two answers. But still it might be worth asking for other opinions on meta.
–
Hendrik VogtMar 2 '11 at 15:10