jed-users mailing list

[2002 Date Index] [2002 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: Reindent an entire C code in one shot


"John E. Davis" <davis@xxxxxxxxxxxxx> writes:

> Lloyd Zusman <ljz@xxxxxxxxxx> wrote:
>>This brings up a related question: is there an easy way in jed to
>>re-indent everything within a brace-delimited block, and nothing else?
>
> [ ... ]
>
> However, that will not work for you purposes because the indent
> routines need the extra context outside the region.  So, try this
> version:
>
>    define indent_region ()
>    {
>       check_region (1);
>       max_line = what_line ();
>       pop_mark_1 ();
>       
>       do
>         {
> 	   indent_line ();
> 	}
>       while (down_1 () and (what_line () <= max_line));
>       pop_spot ();
>    }

I had to make one small change to get this to work.  Once I did,
it worked great for me.  Thanks!

The change:  the 4th line needs a "variable" definition:

      variable max_line = what_line ();

Is there any chance that `indent_region' will end up being part of
the next jed release?

-- 
 Lloyd Zusman
 ljz@xxxxxxxxxx

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2002 date index] [2002 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]