From 43c43f785aa53607a0dd050989da5d7fd0dcfff4 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 26 Mar 2021 06:29:37 +0200 Subject: lei: add some labels support "lei q" now displays labels in JSON output, "lei mark" can add or remove labels for any messages. "lei ls-label" is supported, too. Unfortunately, "lei q" won't hande "kw:" or "L:" for external messages, they must be imported, first. --- lib/PublicInbox/LeiMark.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/LeiMark.pm') diff --git a/lib/PublicInbox/LeiMark.pm b/lib/PublicInbox/LeiMark.pm index 9d77f4b4..7a2ccf77 100644 --- a/lib/PublicInbox/LeiMark.pm +++ b/lib/PublicInbox/LeiMark.pm @@ -60,7 +60,7 @@ sub vmd_mod_extract { sub input_eml_cb { # used by PublicInbox::LeiInput::input_fh my ($self, $eml) = @_; if (my $xoids = $self->{lei}->{ale}->xoids_for($eml)) { - $self->{lei}->{sto}->ipc_do('update_xvmd', $xoids, + $self->{lei}->{sto}->ipc_do('update_xvmd', $xoids, $eml, $self->{vmd_mod}); } else { ++$self->{missing}; @@ -168,7 +168,9 @@ sub _complete_mark_common ($) { # FIXME: same problems as _complete_forget_external and similar sub _complete_mark { my ($self, @argv) = @_; - my @all = map { ("+kw:$_", "-kw:$_") } @KW; + my @L = eval { $self->_lei_store->search->all_terms('L') }; + my @all = ((map { ("+kw:$_", "-kw:$_") } @KW), + (map { ("+L:$_", "-L:$_") } @L)); return @all if !@argv; my ($cur, $re) = _complete_mark_common(\@argv); map { -- cgit v1.2.3-24-ge0c7