> auto-fill-mode uses comment-line-break-function which might be used to do just > that. Currently fill-paragraph does not offer any comparable hook, but that > could be changed if necessary. I can do with an after-change-hook as well, look at the attached patch. The code would get a bit more complicated if I had to do this without font-lock.