Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#3 fixed some FIXMEs

Latest git
closed-accepted
Misc (2)
5
2002-12-01
2002-11-10
Georg
No

Hello Ryan and Kris,

I made some small improvements for doxymacs and fixed
some FIXMEs.

1. new variable doxymacs-void-types
I am working with cod in which a type tVOID is
typedef'ed to void. Doxymacs
did not recognise that. So I changed the code a bit
so that the return type
and the argument is checked against the string in
doxygen-void-types. This
allows the add other type names which will be
treated just like `void'.

2. function string-match-whole
This function is not needed if the regexps in
doxymacs-extract-args-list is
extended. If these regexp start with \` and end
with \' the whole string is
always matched even if there are newlines involved.

3. function doxymacs-extract-args-list
The split-string function fails to split a
declaration list if a complicated
function pointer is involved like in
qsort(int (*comp)(void *, void *), int left, int
right)
I added the function doxymacs-save-split which takes
care of this problem.
Not a nice algorithm but it works.

4. function doxymacs-extract-args-list-helper
I modified the regexp and part of the function code
so that the case
void blah(int i, const char *fla[FOO] = NULL)
is correctly treated.

5. function doxymacs-find-next-func
Changed the regexp and added a part to correctly
extract the function's
declaration list even if it includes own pairs of
parentheses.
The return type name which is extracted by this
function can contain trailing
blanks. I added the function doxymacs-core-string
which gets rid of those
since this can interfere with the matching against
void types.

I checked my changed and the function
doxymacs-insert-function-comment with the
following test cases:

int f (int a);

int f (
const unsigned long a,
int b);

int f (
int a=0,
int b=1);

int f(int (*daytab)[5], int x);

int f(void (*daytab)(), int x);

int f();

tVOID f(tVOID);

tVOID * f(tVOID);

tVOID *f(tVOID);

void blah(int i, const char *fla[FOO] = NULL);

const
unsigned
int f(void* a);

int f(
void
*
a);

int f(
void
*a);

void qsort(int (*comp)(void *, void *), int left, int
right);

void f(
int
a,
int b,
int c,
void
(*testfunc)(int f));

void f(void);

It still fails for very complicated declarations like
this here:
void f(int (*g)(int (*h)(), int *), int a, int b);
but I never some something like that in real code.

I've included the patch against version 1.3.2 (CVS
1.56) which was tested with
gnu emacs 21.2.1. I hope I could help you since I use
doxymacs a lot and think
that it is an extremely useful minor mode.

Cheers
Georg

Discussion

  • Georg
    Georg
    2002-11-10

    patch

     
    Attachments
  • Logged In: YES
    user_id=152677

    Thanks Georg

    I hope to take a look at your patch as soon as possible and
    roll out a new version of doxymacs with your patch and some
    other stuff I've been meaning to do for a while... sometime
    this month, hopefully, if I don't get too busy with other stuff.

    Thanks again.

     
  • Logged In: YES
    user_id=152677

    Patch applied to rev 1.57 of lisp/doxymacs.el (with some
    minor cosmetic changes, and with the change you sent me in
    e-mail).

    Thanks.

     
    • status: open --> closed-accepted