in reply to Perl IDE and New Foreign APIs
I'm using nedit (http://www.nedit.org) as my standard editor since 1997 at least. However I didn't expanded it much (using macros, etc) until recently. here's what I've done :
Well that's all for now, I don't really feel the need for any other tool right now, I'll try to get paramater completion if possible when I have some spare time...
In case anyone's inteested in the nedit stuff, here's the "refactor" macro and script:
$code = get_selection() if ( $code != "" ) { $subname = string_dialog( "New sub name:", "OK" ) # fichier temporaire $processnum = shell_command("echo $$", "") $processnum = replace_in_string($processnum, "\n", "") $tmpfile = "/tmp/nedit" $processnum write_file( $code, $tmpfile ) $codestring = "/home/emmanuel/bin/refactor.pl " $subname " " $tmpf +ile if ( $subname != "" ) { $subgen = shell_command( $codestring, "" ) if ( $subgen != "" ) { replace_selection( $subgen ) } } # delete temp file shell_command( "rm " $tmpfile, "") }
#!/usr/bin/perl use strict; use warnings; use Devel::Refactor; my $subname = shift @ARGV; my $codefile = shift @ARGV; open my $fh, $codefile or die ("Arrrrgh: $!"); my $old_code =join( "\n", <$fh>); close $fh; my $refactory = Devel::Refactor->new; my ($new_sub_call,$new_code) = $refactory->extract_subroutine($subname +,$old_code); print "\n# sub call\n",$new_sub_call, "\n\n#sub definition\n", $new_co +de;
|
|---|