+sub _complete_add_external { # for bash, this relies on "compopt -o nospace"
+ my ($self, @argv) = @_;
+ my $cfg = $self->_lei_cfg(0);
+ my ($cur, $re) = _complete_url_common(\@argv);
+ require URI;
+ map {
+ my $u = URI->new(substr($_, length('external.')));
+ my ($base) = ($u->path =~ m!((?:/?.*)?/)[^/]+/?\z!);
+ $u->path($base);
+ $u = $u->as_string;
+ $u =~ /\A$re(\Q$cur\E.*)/ ? ($cur eq $1 ? () : $1) : ();
+ } grep(m!\Aexternal\.https?://!, @{$cfg->{-section_order}});
+}
+