App-ShellCompleter-emacs

 view release on metacpan or  search on metacpan

bin/_emacs  view on Meta::CPAN

use Complete::Util qw(complete_array_elem combine_answers);
use Getopt::Long::Complete qw(GetOptionsWithCompletion);

die "This script is for shell completion only\n"
    unless $ENV{GETOPT_LONG_DUMP} || $ENV{COMP_LINE} || $ENV{COMMAND_LINE};

my $noop = sub {};

$Getopt::Long::Complete::opt_bundling = 0;

# this is gathered from emacs manpage and should be updated from time to time.
GetOptionsWithCompletion(
    sub {
        my %args  = @_;
        my $type      = $args{type};
        my $word      = $args{word};
        if ($type eq 'arg') {
            #$log->tracef("Completing arg");
            return complete_file(word => $word);
            # XXX +number
            # XXX +line:column



( run in 0.226 second using v1.01-cache-2.11-cpan-05444aca049 )