[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnu-arch-users] Re: tla update
From: |
Miles Bader |
Subject: |
Re: [Gnu-arch-users] Re: tla update |
Date: |
Sat, 13 Sep 2003 17:48:28 -0400 |
User-agent: |
Mutt/1.3.28i |
On Sat, Sep 13, 2003 at 11:22:59PM +0200, Michael Teichgr?ber wrote:
> > The changes would be fairly pervasive though, I think (there are a lots
> > of places that print stuff, and it currently all uses simple print
> > statements). Hello patch conflicts... :-)
>
> There could be an indentation function related to printfmt, that would add
> information about the indent to the file descriptor. A modified
> printfmt_va_list() then would print an indent every time it is located in
> column 0. This approach would not require changing much code, only at some
> places in the cmd-*.c files, where the top messages are printed.
Hmmm, I didn't realize Tom's libraries kept their own stream state...
That could be a good place to put this sort of thing.
> , modifying printfmt_va_list as explained, and enclosing three
> printfmt occurences in cmd-update.c like this:
>
> printfmt_set_indent (1 /* fd */, 0);
> safe_printfmt (1, "\n* reapplying local changes\n");
> printfmt_set_indent (1, 2);
Probably shouldn't use absolute indentation setting though (because sometimes
`top-level' commands are in fact called from within other commands).
Just add something like `printfmt_indent(FD, OFFS)' that adds OFFS to the
current indentation level (preface calls to sub-commands with indent +N and
follow them with indent -N).
Even if you have the indentation (and column-0 tracking) apply only to
printfmt, it still might not be entirely straight-forward; for instance, what
about newlines embedded in fmt strings? Those are not simple to handle
without low-level printf support (you can't just split up the fmt string in a
wrapper because of the value arguments), and tla often seems to use such fmts
for error messages.
-Miles
--
`Suppose Korea goes to the World Cup final against Japan and wins,' Moon said.
`All the past could be forgiven.' [NYT]