APPROVE COMMIT
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:
[original patch snipped]
2002-05-12 Matt Tucker <tuck(a)whistlingfish.net>
* cperl-mode.el (cperl-mode): buffer-localize fill-paragraph-function.
Index: cperl-mode.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/prog-modes/cperl-mode.el,v
retrieving revision 1.12
diff -a -u -a -u -r1.12 cperl-mode.el
--- cperl-mode.el 2001/12/10 10:02:34 1.12
+++ cperl-mode.el 2002/05/12 12:44:34
@@ -2619,6 +2619,9 @@
'(t (cperl-fontify-syntaxically))
'(t)))))
(make-local-variable 'cperl-old-style)
+ ;; XEmacs change: older versions of our fill.el don't buffer-localize
+ ;; fill-paragraph-function.
+ (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