On Thu, 2002-04-25 at 00:52, 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:
Could somebody tell if this is still ok when/if fill.el would be fixed
to make fill-paragraph-function automatically buffer-local? If it is,
I'll commit this patch (with comments).
--- 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
--
Ville Skyttä
ville.skytta(a)xemacs.org