Help for this page

Select Code to Download


  1. or download this
    (defun refactor-extract ()
      "Change region into a subroutine"
    ...
    
      (shell-command-on-region (point) (mark) "./refactor-extract" t)
      )
    
  2. or download this
    #!/usr/bin/perl
    
    ...
    my $code = join '', <>;
    my $name = "refactored_" . sprintf( "%04d", rand() * 10000 );
    print join "\n", Devel::Refactor->new->extract_subroutine( $name, $cod
    +e );