Re: Tool to rename a GObject written in C?



On Thu, Sep 10, 2015 at 10:41:20AM -0700, Germán Poo-Caamaño wrote:
Builder?

AFAIK it's not present in gnome-builder, but it would be a useful
feature. More generally, having higher-level refactoring tools other
than what the basic Unix commands provide.

[...]
In any case, it should be scriptable, to re-indent a list of files in
one command, for example after changing the namespace of a group of
GObjects.

For function definitions, I've already written a script:
https://github.com/swilmet/gnome-c-utils

It seems you are re-inventing the good old indent(1) utility.

http://linux.die.net/man/1/indent

GNU indent cannot line-up parameters _names_ in a function definition,
like this:

void
function_definition (gint         arg1,
                     const gchar *arg2)
{
}

That's why I've written the lineup-parameters script (two years ago).

Now, to align parameters for a function call, it looks like the indent
option --continue-at-parentheses is what I need, but it seems that there
is no way to tell GNU indent to do only that. And for the gedit coding
style, from what I've tested some months ago I didn't find the right
combination of options to indent correctly the code, there are always
some strange behaviors at corner cases.

But I would be glad to be proven wrong.

Sébastien


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]