jed-users mailing list

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

Re: Re: Reindent an entire C code in one shot


On Mon, 18 Nov 2002 19:27:14 -0500 wrote "John E. Davis" <davis@xxxxxxxxxxxxx>:

 
> Yes, I thought that indent_region was already available.

Actually, we had the same discussion some yeas ago. I have since then
the following definition in my privat library:

% Indent line or (if defined) region 
public define indent_region_or_line ()
{  
   !if(is_visible_mark)
     indent_line;
   else
     {
        check_region (1);          % make sure the mark comes first, push_spot
        variable End_Line = what_line;
        pop_mark (1);              % now point is at start of region
        while (what_line <= End_Line)
          {indent_line; down_1;}
        pop_spot;                  % return to where we were before
      }
}

I bind this to the TAB key and this way have TAB doing both, indent_line or
indent_region context dependent (Saves me one keybinding, as I usually don't
want to indent a single line if I have a region defined.)

PS: You find a version of this (and several other (IMOHO) useful functions)
in the txtutils mode at the jed modes repository.

Günter

--
Milde at ife.et.tu-dresden.de


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