This MR can probably be seen as a weak version of !37 (closed) proposed by @matt. I make a rather minimalist use of GTypeModule (initially inspired by what was done for Tumbler), with the main goal to be able to add new features to Mousepad without adding mandatory dependencies, and without touching what becomes the main body of the code.
Everything that concerns the possibility for the user to develop his own plugins is not my objective here, even if by design we are already going on that way. So this can be seen as a first step, where we can see in particular in practice which part of the code would really deserve to be exposed and documented if we were to go further into !37 (closed).
A typical use case of this modular structure is the addition of gspell support, which is implemented in this MR (it's just a port of !2 (closed) in modular form though: various improvements could be considered afterwards, but that's not the point here).
Another case to come is xfconf, which will become an optional dependency, and for which I plan to set up a binding with GSettings. Mousepad would then benefit from a better integration with Xfce, while still being able to be used independently.
Then there are all the open issues already labeled "Future plugin" that are candidates for such a development.
@lastonestanding it would be nice if you could give this a try, since you had expressed your interest in adding gspell support.
@rootkea any testing and thoughts are welcome too.