Since there are tons of reasons why the s_doPlugins function is called, it would be beneficial to have a parameter to read who/what called the function. Currently it's hard to write fool-proof code since a simple click somewhere on an empty space of the document already calls s_doPlugins.