From b24a93c599a0080125a0251fed2ca6764a0f8374 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sat, 26 May 2012 16:54:54 +0100 Subject: [PATCH] [PATCH v5 5/5] emacs: make elide messages use notmuch-show for omitting messages. --- 1a/6178031b395a9658332b6e7491a6ec836f0976 | 117 ++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 1a/6178031b395a9658332b6e7491a6ec836f0976 diff --git a/1a/6178031b395a9658332b6e7491a6ec836f0976 b/1a/6178031b395a9658332b6e7491a6ec836f0976 new file mode 100644 index 000000000..ae9c5daa9 --- /dev/null +++ b/1a/6178031b395a9658332b6e7491a6ec836f0976 @@ -0,0 +1,117 @@ +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 D691C429E28 + for ; Sat, 26 May 2012 08:55:19 -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 HWUDvJVlXRlB for ; + Sat, 26 May 2012 08:55:18 -0700 (PDT) +Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com + [209.85.212.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id CEFA8429E43 + for ; Sat, 26 May 2012 08:55:15 -0700 (PDT) +Received: by wibhr14 with SMTP id hr14so358916wib.2 + for ; Sat, 26 May 2012 08:55:14 -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:x-mailer:in-reply-to:references; + bh=q6At0WV4tzgoTgKbToXVTDKhW7cwIn5JuKJsn5MeByI=; + b=ITr7PbPflBcVCQwQiotsszGTux/L3Fkg565J932p8NG0n6HTRCDAtiAxbxFYRGuCwS + TX85V1IXUmJFFES960EY2iYdu7oEcuiCRye9Z1pXN6xG2rnwET+3DVSvh9Cq7gGIccPG + uMSQz6A6eUjjf10CJq3h6NdDdcNmrn7tW9MVhCftxGcrnVLQ3FF8YDvhMKalJ0ygXE1u + wjSRZ6acdk/6jVnVJ4AEORhtGHvNl0WzvFCZPK6TDlf/J7n9ZwosxygL4a5SFwCU5ZhZ + khVjIkYGFc4G9774KzRPFQ0mVKKqeQFj1uAYRjbauOr0iRAiHFUROgwu0xKGHN/EkL7N + h9/g== +Received: by 10.180.88.194 with SMTP id bi2mr4164104wib.20.1338047714626; + Sat, 26 May 2012 08:55:14 -0700 (PDT) +Received: from localhost (94-192-233-223.zone6.bethere.co.uk. + [94.192.233.223]) by mx.google.com with ESMTPS id + ei4sm9275348wid.5.2012.05.26.08.55.12 (version=TLSv1/SSLv3 cipher=OTHER); + Sat, 26 May 2012 08:55:13 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH v5 5/5] emacs: make elide messages use notmuch-show for + omitting messages. +Date: Sat, 26 May 2012 16:54:54 +0100 +Message-Id: <1338047694-32548-6-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1338047694-32548-1-git-send-email-markwalters1009@gmail.com> +References: <1338047694-32548-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: Sat, 26 May 2012 15:55:20 -0000 + +Previously the elide messages code got the entire-thread from +notmuch-show.c and then threw away all non-matching messages. This +version calls notmuch-show.c without the --entire-thread flag so +it never receives the non-matching messages in the first place. + +This makes it substantially faster. +--- + emacs/notmuch-show.el | 18 ++++++++++-------- + 1 files changed, 10 insertions(+), 8 deletions(-) + +diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +index d318430..9cc68be 100644 +--- a/emacs/notmuch-show.el ++++ b/emacs/notmuch-show.el +@@ -958,9 +958,9 @@ message at DEPTH in the current thread." + "Insert the message tree TREE at depth DEPTH in the current thread." + (let ((msg (car tree)) + (replies (cadr tree))) +- (if (or (not notmuch-show-elide-non-matching-messages) +- (plist-get msg :match)) +- (notmuch-show-insert-msg msg depth)) ++ ;; We test whether there is a message or just some replies. ++ (when msg ++ (notmuch-show-insert-msg msg depth)) + (notmuch-show-insert-thread replies (1+ depth)))) + + (defun notmuch-show-insert-thread (thread depth) +@@ -1041,16 +1041,18 @@ function is used." + (args (if notmuch-show-query-context + (append (list "\'") basic-args + (list "and (" notmuch-show-query-context ")\'")) +- (append (list "\'") basic-args (list "\'"))))) +- (notmuch-show-insert-forest (notmuch-query-get-threads +- (cons "--exclude=false" args))) ++ (append (list "\'") basic-args (list "\'")))) ++ (cli-args (cons "--exclude=false" ++ (when notmuch-show-elide-non-matching-messages ++ (list "--entire-thread=false"))))) ++ ++ (notmuch-show-insert-forest (notmuch-query-get-threads (append cli-args args))) + ;; If the query context reduced the results to nothing, run + ;; the basic query. + (when (and (eq (buffer-size) 0) + notmuch-show-query-context) + (notmuch-show-insert-forest +- (notmuch-query-get-threads +- (cons "--exclude=false" basic-args))))) ++ (notmuch-query-get-threads (append cli-args basic-args))))) + + (jit-lock-register #'notmuch-show-buttonise-links) + +-- +1.7.9.1 + -- 2.26.2