From: Franz Fellner Date: Thu, 22 Jan 2015 12:52:47 +0000 (+0100) Subject: [PATCH v2] VIM: Exclude mails tagged with any tag specified in 'notmuch config get... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=72a4bfd81f53624973901bf76c0695334041420f;p=notmuch-archives.git [PATCH v2] VIM: Exclude mails tagged with any tag specified in 'notmuch config get search.exclude_tags' in folders list and search list. --- diff --git a/1e/742c6f14404f0da1e12cc065f4168e6efae99b b/1e/742c6f14404f0da1e12cc065f4168e6efae99b new file mode 100644 index 000000000..86b996cf4 --- /dev/null +++ b/1e/742c6f14404f0da1e12cc065f4168e6efae99b @@ -0,0 +1,112 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 00FD2431FC9 + for ; Thu, 22 Jan 2015 04:52:52 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 1.639 +X-Spam-Level: * +X-Spam-Status: No, score=1.639 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + DNS_FROM_AHBL_RHSBL=2.438, FREEMAIL_FROM=0.001, + RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id ksD95YEkKCvl for ; + Thu, 22 Jan 2015 04:52:48 -0800 (PST) +Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com + [74.125.82.50]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 86543431FBC for ; Thu, 22 Jan 2015 04:52:48 -0800 + (PST) +Received: by mail-wg0-f50.google.com with SMTP id b13so1525099wgh.9 + for ; Thu, 22 Jan 2015 04:52:47 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:in-reply-to:references; + bh=z27BLIItK08XIIhVks+AWV9mpddQEr9y9hYZjhytXyc=; + b=xNMadCg8ku3bkBLd/GvEZ+juQFARFjwe9jHsjjSLWEm71hOdGK5Y8HcG7gQ8dVbqUp + kkCmNPNH+N4KFBKlGRiv8Jmz6Pnqgyz8VVZznpsj7ifIeLSoQ11twwLcSNkxJjM6Gjkd + 412baQRVHMdC3w8Q2boIjG1otQ6KtoYpd3+lRq3PvMIJm3n8XdD4QLCsKG3zFdjEpKPn + PL9n+dD+DIat+1F4mw9DyXht/uT0cwxTWTNfi1KD9kwZQxWQoiKvwldUMvuFfXcPq3DM + qrhTpaT1QGXgW/GHCG+ULqSyF7rA2jNACwjVIYcNYP49zlLTAT241Nvuf8zXmUIGpaX/ + Ek2w== +X-Received: by 10.180.13.7 with SMTP id d7mr4929455wic.57.1421931167285; + Thu, 22 Jan 2015 04:52:47 -0800 (PST) +Received: from localhost (p4FFB8A19.dip0.t-ipconnect.de. [79.251.138.25]) + by mx.google.com with ESMTPSA id ej10sm2952621wib.2.2015.01.22.04.52.45 + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Thu, 22 Jan 2015 04:52:45 -0800 (PST) +From: Franz Fellner +To: notmuch@notmuchmail.org +Subject: [PATCH v2] VIM: Exclude mails tagged with any tag specified in + 'notmuch config get search.exclude_tags' in folders list and + search list. +Date: Thu, 22 Jan 2015 13:52:47 +0100 +Message-Id: <1421931167-22066-1-git-send-email-alpine.art.de@gmail.com> +X-Mailer: git-send-email 2.2.1 +In-Reply-To: <20141017180750.GE20696@TP_L520.localdomain> +References: <20141017180750.GE20696@TP_L520.localdomain> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 22 Jan 2015 12:52:52 -0000 + +--- + vim/notmuch.vim | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/vim/notmuch.vim b/vim/notmuch.vim +index cad9517..cb6695a 100644 +--- a/vim/notmuch.vim ++++ b/vim/notmuch.vim +@@ -477,6 +477,7 @@ ruby << EOF + + $db_name = nil + $email = $email_name = $email_address = nil ++ $exclude_tags = [] + $searches = [] + $threads = [] + $messages = [] +@@ -496,6 +497,8 @@ ruby << EOF + $email_address = get_config_item('user.primary_email') + $email_name = get_config_item('user.name') + $email = "%s <%s>" % [$email_name, $email_address] ++ ignore_tags = get_config_item('search.exclude_tags') ++ $exclude_tags = ignore_tags.split("\n") + end + + def vim_puts(s) +@@ -637,6 +640,9 @@ ruby << EOF + $searches.clear + folders.each do |name, search| + q = $curbuf.query(search) ++ $exclude_tags.each { |t| ++ q.add_tag_exclude(t) ++ } + $searches << search + count = count_threads ? q.search_threads.count : q.search_messages.count + b << "%9d %-20s (%s)" % [count, name, search] +@@ -648,6 +654,9 @@ ruby << EOF + date_fmt = VIM::evaluate('g:notmuch_date_format') + q = $curbuf.query(search) + q.sort = Notmuch::SORT_NEWEST_FIRST ++ $exclude_tags.each { |t| ++ q.add_tag_exclude(t) ++ } + $threads.clear + t = q.search_threads + +-- +2.2.1 +