I'm looking for a minor mode to keep paragraphs filled at all times while typing (similar to what
aggressive-indent-mode does for indentation). It also needs to be smart enough to only fill comments (and maybe strings depending on the language).
Some things that I've tried are:
auto-fill-modeautomatically fills while you are typing new paragraphs but doesn't refill when you edit paragraphs.
refill-modedoes constantly refill paragraphs but it tries to wrap code into paragraphs as well as comments.
I tried adding
after-change-functionshook but it screws up undo and plenty of other things (this is probably all fixable but would take some effort).
Any better ideas?