>> Should enter an infinite loop.
> I would like to simplify and fix octave's fill-paragraph and auto-fill
> feature.
Very good idea (when I moved octave to SMIE, I wanted to do that as
well, but ended up leaving it for later).
> Could you help fix or direct me how to fix this bug and bug#14303?
I think to fix/simplify them well, you'll need to touch some of the
generic code. For bug#14303, the first ting to do is to read the code
of comment-search-backward.
If I were you, I'd start with octave-auto-fill, trying to replace it
with something that hooks elsewhere, such as in fill-nobreak-predicate
and in comment-line-break-function.
For octave-fill-paragraph, I'm not sure what should be done there, but
the functionality looks like it could be useful in many
programming modes. So maybe it should be moved to prog-mode.
Stefan