As for Geany code, I'd tried it closer. The following corrections introduce %f, %d and other Run's wildcards in the context string:
**build.h**
gchar *build_replace_placeholder(const GeanyDocument *doc, const gchar *src);
**build.c**
GEANY_API_SYMBOL gchar *build_replace_placeholder(const GeanyDocument *doc, const gchar *src)
**callbacks.c**
gchar *command_line = g_strdup(command); command_line = build_replace_placeholder(doc, command_line); //apl utils_str_replace_all(&command_line, "%s", word);
But it does not resolve the whole issue.