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


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?

I was going to suggest that you mark the region, but I see it is not 
defined.  Here is a definition:

   define indent_region ()
   {
      check_region (1);
      narrow ();
      indent_buffer ();
      widen ();
      pop_spot ();
   }

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 ();
   }

--John

--------------------------
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]