From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id E9D581F4D7 for ; Mon, 2 May 2022 18:10:07 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] lei import: add label completions (+L:$LABEL) Date: Mon, 2 May 2022 18:10:07 +0000 Message-Id: <20220502181007.541651-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This can probably be added for "lei q", too, but we typically import first. Labels can probably be made persistent on a per-folder basis in the future. --- lib/PublicInbox/LeiImport.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/PublicInbox/LeiImport.pm b/lib/PublicInbox/LeiImport.pm index b9865829..2d91e4c4 100644 --- a/lib/PublicInbox/LeiImport.pm +++ b/lib/PublicInbox/LeiImport.pm @@ -117,6 +117,8 @@ sub _complete_import { my ($lei, @argv) = @_; my ($re, $cur, $match_cb) = $lei->complete_url_prepare(\@argv); my @k = $lei->url_folder_cache->keys($argv[-1] // undef, 1); + my @L = eval { $lei->_lei_store->search->all_terms('L') }; + push(@k, map { "+L:$_" } @L); my @m = map { $match_cb->($_) } @k; my %f = map { $_ => 1 } (@m ? @m : @k); if (my $lms = $lei->lms) {