Yoshiki Hayashi wrote:
Vaclav Barta <vbar(a)comp.cz> writes:
> You mean like (setq fill-paragraph-function
> 'cperl-fill-paragraph) ? That doesn't work (M-q still calls
> fill-paragraph-or-region)... Perhaps I'm putting it in the
Did you eval setq in scratch buffer? Then it won't work.
No, I changed
cperl-mode.el and restarted (bad Windows
habits:-) ) xemacs. With (setq fill-paragraph-function
'cperl-fill-paragraph) in cperl-mode.el, fill-paragraph-function
*is* 'cperl-fill-paragraph after I open a Perl file.
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).
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
advantages...:-)
Bye
Vasek
--- cperl-mode.el Mon Dec 3 20:57:07 2001
+++ xemacs-packages/lisp/prog-modes/cperl-mode.el Tue Dec 4 19:57:06 2001
@@ -2108,6 +2108,7 @@
[(control meta |)])
;;(cperl-define-key "\M-q" 'cperl-fill-paragraph)
;;(cperl-define-key "\e;" 'cperl-indent-for-comment)
+ (setq fill-paragraph-function 'cperl-fill-paragraph)
(if cperl-xemacs-p
(progn
(cperl-define-key 'backspace 'cperl-electric-backspace)