I have been thinking about how to implement python function replacement without having to jam even more into the F&R dialog and *not* use a plugin.
Since in replacements \F has no special meaning as a capture group, we could start any python replacement function name with that.
So to use function replacement from a replace function in a module named 'mymod.py' **without any gui changes** the replace field in the F&R dialog could be set by the user to:
Then the current ReplaceBuilder code would detect that and invoke the replace() function in mymod.py which would be stored in the Sigil Preferences folder in a replacement_ functions folder.
Then all a user would have to do is fill that folder with whatever python modules with replace functions they want.
Yes this is more than a bit esoteric and cryptic but so are python replacement functions and regex and this would only be used by very advanced users.
If we went this approach, we could easily add this capability to Sigil itself (no plugin needed) and it would not bloat or otherwise interfere with the current F&R for 99.9% of the users.
Any printing output from a replacement function would need to be written to a log file by the user, and no function edit and remove interface would be added. The user him/herself would be responsible for creating, editing, storing, and removing their own python code.
It would also work "as is" with Saved Searches.
Thoughts?