From: Mark Walters Date: Sun, 11 May 2014 08:34:42 +0000 (+0100) Subject: [PATCH 7/7] emacs: hello: add option to omit count for a search X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d8254457346abba1e29bdaa0404deeb2f6c3e6e4;p=notmuch-archives.git [PATCH 7/7] emacs: hello: add option to omit count for a search --- diff --git a/8d/da52637c80913acd21d800d950250042349cee b/8d/da52637c80913acd21d800d950250042349cee new file mode 100644 index 000000000..48a2a547c --- /dev/null +++ b/8d/da52637c80913acd21d800d950250042349cee @@ -0,0 +1,97 @@ +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 49B21431FD7 + for ; Sun, 11 May 2014 01:35:33 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.201 +X-Spam-Level: +X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=1, 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 vV69MtmwW9h9 for ; + Sun, 11 May 2014 01:35:28 -0700 (PDT) +Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com + [209.85.212.169]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 8F187431FD9 + for ; Sun, 11 May 2014 01:35:00 -0700 (PDT) +Received: by mail-wi0-f169.google.com with SMTP id hi2so4221099wib.4 + for ; Sun, 11 May 2014 01:34:59 -0700 (PDT) +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=UMqwpe4t+aF2yCjCNoplXTDz8InON8PL00jjhzxznLs=; + b=OOx1dLI8G9Vo5FrmFQVvWkNg87cSE5V4Anxsf6BJPqcTb0cIP+Fnm6jXnJy2UahxMC + wl1IXqitfF8xPfgcRUWIzWgD4ekjEmmjhspD9U6f3GaKSh46dj0TicijDVQ5QETP7GS6 + K25HQb+xxy8VPrAYEk+9dSKOp/UOrWxmDKeCoAY0rzi0W0D/hFJSwc/wWYUK5evnyIz+ + Wnhzp5YyDfEYs7TzFQwChQGQ09lMKTfojMTXtJM+4IbL+1eqzl/zbI79NiKaXUCo6pGZ + 5Xk7PxSHh3ENsLcsaqNjcu9FODIi9znFaM99YksBmnMbn870Z1xezVxvdDy1jEyW3ZcN + L5YQ== +X-Received: by 10.180.74.132 with SMTP id t4mr10562366wiv.30.1399797299436; + Sun, 11 May 2014 01:34:59 -0700 (PDT) +Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) + by mx.google.com with ESMTPSA id j3sm12738664wjw.38.2014.05.11.01.34.58 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Sun, 11 May 2014 01:34:58 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH 7/7] emacs: hello: add option to omit count for a search +Date: Sun, 11 May 2014 09:34:42 +0100 +Message-Id: <1399797282-20389-8-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: <1399797282-20389-1-git-send-email-markwalters1009@gmail.com> +References: <1399797282-20389-1-git-send-email-markwalters1009@gmail.com> +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: Sun, 11 May 2014 08:35:33 -0000 + +This omits the count for the specific search. This makes notmuch-hello +faster, particularly for large complex saved searches. +--- + emacs/notmuch-hello.el | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el +index 265b879..b3b539d 100644 +--- a/emacs/notmuch-hello.el ++++ b/emacs/notmuch-hello.el +@@ -94,6 +94,8 @@ (define-widget 'notmuch-saved-search-plist 'list + (const :format "" :display-function) + (choice :tag " Display function" + (const :tag "Default (messages)" nil) ++ (function-item :tag "omit count" ++ notmuch-hello-display-omit-count) + (function-item :tag "messages/threads" + notmuch-hello-display-count-threads-and-messages) + (function-item :tag "highlight newly arrived messages" +@@ -528,6 +530,11 @@ (defun notmuch-hello-display-new-messages (&rest args) + (plist-put current :count (notmuch-hello-nice-number (length new-list))) + (plist-put current :message-list new-list))) + ++(defun notmuch-hello-display-omit-count (&rest args) ++ "Omit the count." ++ (let* ((current (plist-get args :current))) ++ (plist-put current :count "---"))) ++ + (defun notmuch-hello-batch-message-count (elem-plist options) + "Update the message count for a saved search. + +-- +1.7.10.4 +