I just had a lot of trouble wondering why my patch to apps/lib/kateconfigdialog.cpp did nothing. Literally wildly changing around the checkboxes had no effect. And it built it too! Because when I introduced a bug, the compiler and emerge bailed. I was stuck, until I was told on #kate (IRC), that apps/lib is libkateprivate. Which on Gentoo, is and should be part of the kate-lib package. And lo and behold, applying the same exact patch to kate-lib, had the desired effect. So the kate ebuild includes and compiles code that it should not and that has no effect. Can we leave that out, and avoid uselessly building the same code twice? :)
Correction: s/libkatepart/libkateprivate/
If you contribute a patch to kate making use of an external libkateprivate and manage to upstream it too, then yes, that is possible. The odds of upstream being interested in that are low, though, and I will not put any effort into it.