Vaclav Barta <vbar(a)comp.cz> writes:
> You have to eval it in a buffer because
> fill-paragraph-function is a buffer local variable. Switch
> buffer to where you are visiting perl program and then type
> M-: (setq fill-paragraph-function 'cperl-fill-paragraph)
> It is OK that M-q calls fill-paragraph-or-region. If you
No, it's not - fill-paragraph-or-region ruins the code (even after
I set it explicitly as described above). I also note that cc-mode
does not use fill-paragraph-function either - the decision is
explicitly commented, but the comment is rather vague (it's
surprisingly hard to write a useful comment... :-) ).
I'm attaching a patch as a dry run - this is what does *not* work.
Putting the point into the multi-line comment (say, on ':') of the test
file (also attached) and pressing M-q will format all
the rest of the file as a comment (with or without the patch).
Thanks for the patch and test.pl. I tested it and it
doesn't work here either. The problem is that
fill-paragraph-function should return non-nil when it does
actual filling work but cperl-fill-paragraph always returns
nil. Probably the function is only designed for replacing
M-q and not for fill-paragraph-function. But binding
fill-paragraph-function is the right way to achieve the same
goal so I suggest you also change that function to return t.
> Even if it is a single line change, it is always good to
> have more people involved in the development. Also, if you
I know *every* change should be reviewed - but this is the first
time I see it in practice... Not having a budget does have its
Yeah, but we need more volunteers to review and apply all of
the patches. ;-)