I couldn't just leave it at that so I hacked a bit more. The result is ability to pass parameters with the python-function so as to execute something in python (you could do your math calculations inside lyx this way - "LyX is a wysiwym document processor that can also serve as a pocket calculator" ;-) There is an "interface" to actions in LyX from python, that is you can do: python-function lyx.action("word-forward") and voila the cursor will move a word forward. Basically this hits a dead end now. There is now a need to be able to query lyx, to be able to iterate over the text and other such things. This now becomes too much work for now. btw: There is a bug in the minibuffer that prevents it from passing parameters in that patch I have a hack to fix this. I'll see if I can come up with something cleaner. It doesn't matter to anything since the only other command who need arguments in the same way is some help command. The math stuff is handled differently and accepts parameters correctly. -- Baruch Even http://baruch.ev-en.org/