Hi Joojaa,
I only know Emacs as a user but I do not know anything about Elisp...etc. Could you be more precise, or give some more detailled explanations about what you do this, please? (..or even some links could be very useful...)
Because, if we can do this kind of stuff into Emacs, then, Emacs could become THE Mel-editor incorporating a kind of script editor...
Thanks a lot,
Benoit