public
Last active

Start Emacs.app from CLI

  • Download Gist
Emacs_starter.pl
Perl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#!/usr/bin/perl
 
# Emacs starter for Emacs mac port
 
# Thanks to Aquamacs Project and David Reitter
 
my $args = "";
my $tmpfiles = "";
 
for my $f (@ARGV) {
$args .= '"'.$f.'" ';
$tmpfiles .= '"'.$f.'" ' if (! -e $f);
}
 
system("touch $args") if ($tmpfiles);
system("open -a /Applications/Emacs.app $args");
 
# delay deletion because AE drag&drop doesn't work with non-existing documents
system("(sleep 3; rm $tmpfiles) &") if ($tmpfiles);
exit;

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.