Shouldn't we just fix fill-paragraph-function in fill.el?
andy
At 02:52 PM 4/24/2002 -0700, Matt Tucker wrote:
-- vijayr <vijayr(a)yahoo-inc.com> spake thusly:
> c-fill-paragraph is not working in c++ mode, with the // style
> comments:
>
> Signaling: (args-out-of-range #<buffer "DataSource.h"> 0 2)
> cperl-fill-paragraph(nil)
> fill-paragraph(nil)
> c-fill-paragraph(nil)
> call-interactively(c-fill-paragraph)
This bug appears to be in cperl-mode, which does:
(setq fill-paragraph-function 'cperl-fill-paragraph)
However, fill-paragraph-function is not buffer-local, so this affects
all buffers. This function doesn't break when dealing with c-style
comments, but does with c++-style. This patch seems to fix it on my
system, and I believe is the right thing to do:
--- cperl-mode.el.orig Wed Apr 24 14:49:43 2002
+++ cperl-mode.el Wed Apr 24 14:50:20 2002
@@ -2619,6 +2619,7 @@
'(t (cperl-fontify-syntaxically))
'(t)))))
(make-local-variable 'cperl-old-style)
+ (make-local-variable 'fill-paragraph-function)
(setq fill-paragraph-function 'cperl-fill-paragraph)
(or (fboundp 'cperl-old-auto-fill-mode)
(progn