Emacs Elisp macro for generating GObject from template

Everyone who has worked with GObjects knows how time consuming is to create a new GObject. In order to make it working you have to generate lot of boilerplate code which is more or less the same for all the objects.
In most of the cases people tend to use templates and make several find-replace substitutions to generate the output GObject.

To simplify everything and to learn more about Elisp I decided to build simple Elisp macros for generating GObjects directly from the Emacs command line. The script prompts for some basic info, like name of the final object (ex. MyExtremelyUselessObject), the output directory where the object is to be generated and some brief description of the object (for Doxygen purpose). While preparing templates I tried to follow GObjects name conventions and used Doxygen for documenting the source code (I know that probably GTK-Doc would be better but in all my current projects I use Doxygen so I know it better). The the set of macros can be downloaded from here: emacs-gobject-macros.tar.gz , a detailed installation instruction is inside the Elisp script. Note, that this script can also generate some kind of C-Objects based on normal C-struct’s.
If you happen to make some useful modification to the script, please let me know!

My first Elisp script

It’s already been one year since I switched from Vim to Emacs (thanks Aleksander;) I heard a lot about how powerful the Elisp is, but I didn’t have much motivation in learning it. I started playing with Elisp last weekend and I must say that is much different from everything I used before. Anyway because I work a lot with GObjects and Glib I decided to create some useful script which will speed up my coding. My first script is trivial but it helps to create GList iterator, it acts as a simple code snippet with this difference, that the initial position of the iterator is assigned with the identifier under the cursor.

Elisp script:

(defun azt-glist-iterate-all()
    "Creates a GList iterator for
      the list under the cursor"
    (setq itr_template "GList *node_itr = vvv;
while (node_itr != NULL)
    /* GType *data = (GType *)node_itr->data; */
    node_itr = g_list_next(node_itr);
    ; Replace patter with a word at point
    (setq initializer
             (replace-regexp-in-string "\*" "" 
                   (thing-at-point 'symbol)))
    (setq itr_template 
             (replace-regexp-in-string "vvv" 
                     initializer itr_template))
    (forward-line 1)
    (insert itr_template)

When the script is loaded into Emacs and you start typing something like “GList *my_list = priv->_list” , put your cursor on my_list identifier and M-x azt-glist-iterate-all you will generate the snipper below:

GList *node_itr = my_list;
while (node_itr != NULL)
    /* GType *data = (GType *)node_itr->data; */
    node_itr = g_list_next(node_itr);