First of all:
I´m using filladapt 2.12 (patched one, see below), cc-mode 5.26 and
jde 2.2.6 with Gnu Emacs 20.7. All my statements are related to this
versions (but i think the Emacs version is not so important,
all >= 20.3.1 should work)
First of all you should install cc-mode >= 5.26 (with Emacs 5.25 is shipped
i think!)!! (get it from http://cc-mode.sourceforge.net/index.php)
OK, you should add the following to you c-mode-common-hook (e.g. within a lambda
expression):
;; turn on adaptive auto-fill-mode for easy writing comments
(auto-fill-mode 1)
(c-setup-filladapt)
(turn-on-filladapt-mode)
In cc-mode >= 5.26 there is a special filladapt-handling included. On the cc-mode
Website there is a patched filladapt.el mentioned (You should use this one)
For this go to http://cc-mode.sourceforge.net/filladapt.php
Then you should add the javadoc-keywords to filladapt like i have xplained
in my previous posting.
This would fill comments like
/*
* kldjfglkjdflgj sdklfjg lksjdfg jskdfjg ksjdfg jsldkfjg klsjdflg j
* kldjfgjdfgkjsdlkfjgkl sjd
* @param firstParam: klsdjgf jdflkgj skdlfjg kljsdflkg jklsdjfg kljsdlfkg j
* kldjfklgjsd klfjg sldkfjg ksdjfg kljsdlfkg jksldjfg kjsdflg jdf
* dfkkdfghlöf
* @param secondParam: ...
*/
If you want a filling like you mentioned in your mail like
/*
* kldjfglkjdflgj sdklfjg lksjdfg jskdfjg ksjdfg jsldkfjg klsjdflg j
* kldjfgjdfgkjsdlkfjgkl sjd
* @param firstParam: klsdjgf jdflkgj skdlfjg kljsdflkg jklsdjfg kljsdlfkg j
* kldjfklgjsd klfjg sldkfjg ksdjfg kljsdlfkg jksldjfg k
* dfkkdfghlöf
* @param secondParam: ...
*/
you must change the
("@param[ \t]" bullet)
to
("@param[ \t][A-Za-z0-9_]+[ \t]" bullet)
I have tested this and it works fine. But IMHO the former one is better because if
you are using very long paramter-names you will waste a lot of space and your
comments can be difficult to read. But it´s your choice :-)
One hint:
You should add the keywords to 'filladapt-token-table' via customize and there NOT at
beginning of the already defined elements but at the end or even better somewhere
in the middle!
Do NOT use 'add-to-list'-function to add the keywords in your .emacs because this
adds them at the beginning! This is confusing filladapt!
Klaus
> -----Ursprüngliche Nachricht-----
> Von: Berche, Guillaume [mailto:[EMAIL PROTECTED]]
> Gesendet am: Freitag, 19. Januar 2001 13:59
> An: '[EMAIL PROTECTED]'
> Cc: '[EMAIL PROTECTED]'
> Betreff: RE: Paragraph filling...
>
> Klaus,
>
> I tried filladapt (I added the keywords as you mentionned,
> required it in my .emacs after byte compiling it, turned it
> on) and when it is turned on I don't get the filling feature
> on javadoc anymore, whereas it seems that when I turn it on,
> the META-Q (ie. fill-paragraph) does nothing (ie does not
> wrap my lines in a javadoc comment) Do you have any idea of
> what I missed?
>
> Can you tell me what benefits brings 'filladapt' over
> emacs20-7 in the javadoc wrapping?
>
> Here is what I get when I use the builtin version:
>
> /**
> * Creates an empty query
> * @param uid The unique identifier of the query. This uid
> should contain both the client Id and the query index. Use
> the <code>generateId</code> method to generate this Id, and
> the <code>getClientUid()<code> and <META-Q>
>
> gets transformed into:
>
> /**
> * Creates an empty query
> * @param uid The unique identifier of the query. This uid should
> * contain both the client Id and the query index. Use the
> * <code>generateId</code> method to generate this Id, and the
> * <code>getClientUid()<code> and
>
> What I would dream of having done automatically is the following:
>
> /**
> * Creates an empty query
> * @param uid The unique identifier of the query.
> This uid should contain
> * both the client Id and the query index.
> Use the <code>generateId</code>
> * method to generate this Id, and
>
> Do you know if 'filladapt' can be configured to do such formatting?
>
> Many thanks,
>
> Guillaume.
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, January 19, 2001 1:15 PM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: AW: Paragraph filling...
> >
> >
> > I recommend using filladapt.el (get it from
> http://wonderworks.com/)
> > which does a much better job of
> filling than the standard one.
> >
> > After installing this package you can modify the variable
> > 'filladapt-token-table'
> > like follows (add these elements to the variable):
> >
> > ("@param[ \t]" bullet)
> > ("@see[ \t]" bullet)
> > ("@return[ \t]" bullet)
> > ("@exception[ \t]" bullet)
> >
> > I´m sure you are able to add further javadoc-keywords if you
> > need them :-)
> >
> > After that all your JAVADOC comments wil be filled correct.
> >
> > Hope this helps,
> > Klaus
>