On Tue, 19 Mar 2002, Angus Leeming wrote:

> On Tuesday 19 March 2002 6:16 pm, Jean-Marc Lasgouttes wrote:
> > Angus> Ok. So do you hit tab on every line or is there a command to
> > Angus> format the whole thing prettily?
> >
> > For a {} block, I put the cursor on the opening { and use M-C-q.
> >
> > For a whole region, use the menu entry C++>Indent line of region.
> >
> > Difficult, isn't it?
>
> If you don't know the command, yes...
>
> Incidentally, highlighting a region and typing M-x indent-region works fine,
> but it doesn't remove whitespace from otherwise empty lines. Know the command
> for that?

Have you tried M-x tabify? (you need to select a region first)

You might consider writing a macro that does something like:
        mark-whole-buffer
        tabify
        mark-whole-buffer
        indent-region

I think tabify also squashes spaces on an otherwise empty line but I
could be wrong.

Allan. (ARRae)

Reply via email to