This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Hack to allow git-deltatool to spawn 'emacsclient -t'
authorFlorian Ragwitz <rafl@debian.org>
Sat, 26 Feb 2011 07:58:16 +0000 (08:58 +0100)
committerFlorian Ragwitz <rafl@debian.org>
Sat, 26 Feb 2011 07:58:16 +0000 (08:58 +0100)
My $EDITOR is 'emacsclient -t'. system('emacsclient -t', 'more', 'args') won't
do the right thing.

Porting/git-deltatool

index 3c413ff..2216037 100644 (file)
@@ -219,7 +219,7 @@ sub edit_text {
   $args //= {};
   my $tempfh = File::Temp->new;
   $tempfh->printflush( $text );
-  if ( my (@editor) = $ENV{VISUAL} || $ENV{EDITOR} ) {
+  if ( my @editor = split /\s+/, ($ENV{VISUAL} || $ENV{EDITOR}) ) {
     push @editor, "-f" if $editor[0] =~ /^gvim/;
     system(@editor, "$tempfh");
   }