about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiMark.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-03-26 06:29:37 +0200
committerEric Wong <e@80x24.org>2021-03-26 19:59:34 +0000
commit43c43f785aa53607a0dd050989da5d7fd0dcfff4 (patch)
treef9fd037a837f4e38c654d7bb450f22b9473147dc /lib/PublicInbox/LeiMark.pm
parent37dfb2c0d3c60277567325c15d5695b2dee03ad1 (diff)
downloadpublic-inbox-43c43f785aa53607a0dd050989da5d7fd0dcfff4.tar.gz
"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.
Diffstat (limited to 'lib/PublicInbox/LeiMark.pm')
-rw-r--r--lib/PublicInbox/LeiMark.pm6
1 files changed, 4 insertions, 2 deletions
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 {