From bcbc5556aac6e9c21c11eb89a97a8f0e2f6af4a0 Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Mon, 9 Apr 2018 10:46:09 +0200 Subject: [PATCH] improve address book and rename nextctype to nextpart --- config/alot/config | 7 ++++--- local/bin/notmuch-abook.sh | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/config/alot/config b/config/alot/config index 66a6af4..3aff9d9 100644 --- a/config/alot/config +++ b/config/alot/config @@ -23,7 +23,7 @@ editor_cmd = "st -e vis" [[[abook]]] type = shellcommand command = 'notmuch-abook.sh' - regexp = '\[?{"name": "(?P.*)", "address": "(?P.+)", "name-addr": ".*"}[,\]]?' + regexp = (?P.*) <(?P.+)> shellcommand_external_filtering = True @@ -41,7 +41,7 @@ editor_cmd = "st -e vis" [[[abook]]] type = shellcommand command = 'notmuch-abook.sh' - regexp = '\[?{"name": "(?P.*)", "address": "(?P.+)", "name-addr": ".*"}[,\]]?' + regexp = (?P.*) <(?P.+)> shellcommand_external_filtering = True [bindings] @@ -56,4 +56,5 @@ editor_cmd = "st -e vis" [[thread]] a = tag archived ; fold A = untag archived ; unfold - n = nextctype + n = nextpart + p = prevpart diff --git a/local/bin/notmuch-abook.sh b/local/bin/notmuch-abook.sh index 2b8e32e..2d8b4d1 100755 --- a/local/bin/notmuch-abook.sh +++ b/local/bin/notmuch-abook.sh @@ -1,2 +1,5 @@ #!/bin/sh -notmuch address --format=json --output=recipients --output=sender --deduplicate=address from:"$*" OR to:"$*" | rg -i "$*" +notmuch address --output=recipients --output=sender --deduplicate=address from:'*'"$*"'*' OR to:'*'"$*"'*' \ + | grep -i "$*" \ + | grep -v noreply \ + | sort | uniq