my ($self, $eml) = @_;
if (my $xoids = $self->{lse}->xoids_for($eml) // # tries LeiMailSync
$self->{lei}->{ale}->xoids_for($eml)) {
- $self->{lei}->{sto}->ipc_do('update_xvmd', $xoids, $eml,
+ $self->{lei}->{sto}->wq_do('update_xvmd', $xoids, $eml,
$self->{vmd_mod});
} else {
++$self->{unimported};
return $lei->fail('no keywords or labels specified');
my $ops = {};
$lei->{auth}->op_merge($ops, $self) if $lei->{auth};
- my $j = $self->{-wq_nr_workers} = 1; # locked for now
- (my $op_c, $ops) = $lei->workers_start($self, $j, $ops);
+ (my $op_c, $ops) = $lei->workers_start($self, 1, $ops);
$lei->{wq1} = $self;
$lei->{-err_type} = 'non-fatal';
net_merge_all_done($self) unless $lei->{auth};
# Workaround bash word-splitting s to ['kw', ':', 'keyword' ...]
# Maybe there's a better way to go about this in
# contrib/completion/lei-completion.bash
-sub _complete_mark_common ($) {
+sub _complete_tag_common ($) {
my ($argv) = @_;
# Workaround bash word-splitting URLs to ['https', ':', '//' ...]
# Maybe there's a better way to go about this in
# FIXME: same problems as _complete_forget_external and similar
sub _complete_tag {
my ($self, @argv) = @_;
+ require PublicInbox::LeiImport;
+ my @in = PublicInbox::LeiImport::_complete_import(@_);
my @L = eval { $self->_lei_store->search->all_terms('L') };
- my @all = ((map { ("+kw:$_", "-kw:$_") } @PublicInbox::LeiInput::KW),
+ my @kwL = ((map { ("+kw:$_", "-kw:$_") } @PublicInbox::LeiInput::KW),
(map { ("+L:$_", "-L:$_") } @L));
- return @all if !@argv;
- my ($cur, $re) = _complete_mark_common(\@argv);
- map {
+ my ($cur, $re) = _complete_tag_common(\@argv);
+ my @m = map {
# only return the part specified on the CLI
# don't duplicate if already 100% completed
/\A$re(\Q$cur\E.*)/ ? ($cur eq $1 ? () : $1) : ();
- } grep(/$re\Q$cur/, @all);
+ } grep(/$re\Q$cur/, @kwL);
+ (@in, (@m ? @m : @kwL));
}
no warnings 'once'; # the following works even when LeiAuth is lazy-loaded