[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Insert function descriptor
From: |
wenbinye |
Subject: |
Re: Insert function descriptor |
Date: |
6 Aug 2006 02:21:28 -0700 |
User-agent: |
G2/0.2 |
maybe you can use skeleton to do it:
(define-skeleton skeleton-c-mode-func-desc
"" nil
> "/*
---------------------------------------------------------------------\n"
> (skeleton-read "Function name: ") "()\n"
>
"---------------------------------------------------------------------\n"
> "Description :\n"
>
"---------------------------------------------------------------------\n"
> "I :\n"
> "O :\n"
>
"---------------------------------------------------------------------
*/\n")
(define-abbrev-table 'c-mode-abbrev-table '(
("funcx" "" skeleton-c-mode-func-desc 1)
))
Kal wrote:
> Hello,
>
> When I write a function in C, I write it like this :
>
> /* ---------------------------------------------------------------------
> accind_ouvriraux()
> ---------------------------------------------------------------------
> Build file name and call fopen()
> ---------------------------------------------------------------------
> I : Char pointer
> I : Char pointer
> O : File pointer
> --------------------------------------------------------------------- */
> static FILE *
> accind_ouvriraux(char *prefixe, char *suffixe);
>
> My wish is to get the header description automatically. One way to do it
> is mapping a key sentence (expl : C-F1) to a lisp function which ask the
> name for the function :
>
> Name of the function : toto
>
> And build after that the header :
>
> /* ---------------------------------------------------------------------
> toto()
> ---------------------------------------------------------------------
> Description :
> ---------------------------------------------------------------------
> I :
> O :
> --------------------------------------------------------------------- */
>
> Is it possible ?
>
> --
> Kal