I’d love to see it!
I’m hoping for a somewhat different pattern, and I don’t know if there is already something in place in TW to support it. It would act like $:/tags/StartupAction. With startup actions, you can add new bits to run at startup by giving them this tag, and if you choose, you can order the tagged item to choose the order in which they will run. I would love to see something similar here, not so much tied to buttons but tied to major life-cycle events: the current startup, tiddler saving, tiddler deleting, wiki saving, tiddler(s) exporting, and likely at least a few others. The current behavior would be captured in a tiddler with the appropriate $:/tag, and you can drag your action before or after $:/core/lifecycle/SaveTiddler/default (or whatever) in the $:/tags/ActionSaveTiddler list.
So for the suggestion in the OP, we could image this SaveTiddler lifecycle collects all the tiddlers with the given tag, and applies them one at a time, assigning currentTiddler to the tiddler being saved. Mohammed’s is first, and it parses the text field to find any line beginning $f, for each one grabbing a field name and a value and setting that in the tiddler, removing that line from the text. The next (and
for now final) action is the default save behavior. But if we wanted to do additional work, we can simple add more appropriately tagged tiddlers, and sort them where they belong.
I also can imagine the default behavior might be split into several pieces, offering the user a chance to insert behavior more granularly.
I’d be curious to see how it works. My imagination has run off in a slightly different direction.
I know cascade offer a great deal of flexibility that wasn’t available before they came along, but there are many ways in which they’re still rigid.