From cc87311e4bd6925b31bed14f7b571859f8fcb68b Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Thu, 23 Feb 2012 21:41:34 +0000 Subject: [PATCH] [PATCH 2/2] emacs: make elide messages use notmuch-show for omitting messages. --- ea/c09d45ee259c8cb8fd67c5d9143cb0873bb67c | 110 ++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 ea/c09d45ee259c8cb8fd67c5d9143cb0873bb67c diff --git a/ea/c09d45ee259c8cb8fd67c5d9143cb0873bb67c b/ea/c09d45ee259c8cb8fd67c5d9143cb0873bb67c new file mode 100644 index 000000000..5a795eea8 --- /dev/null +++ b/ea/c09d45ee259c8cb8fd67c5d9143cb0873bb67c @@ -0,0 +1,110 @@ +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 9026E431FD7 + for ; Thu, 23 Feb 2012 13:40:29 -0800 (PST) +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 4wXRXeVZneTN for ; + Thu, 23 Feb 2012 13:40:28 -0800 (PST) +Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com + [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 8F815431FC3 for ; Thu, 23 Feb 2012 13:40:27 -0800 + (PST) +Received: by wgbdt12 with SMTP id dt12so1340178wgb.2 + for ; Thu, 23 Feb 2012 13:40:26 -0800 (PST) +Received-SPF: pass (google.com: domain of markwalters1009@gmail.com designates + 10.180.92.71 as permitted sender) client-ip=10.180.92.71; +Authentication-Results: mr.google.com; spf=pass (google.com: domain of + markwalters1009@gmail.com designates 10.180.92.71 as permitted + sender) smtp.mail=markwalters1009@gmail.com; + dkim=pass header.i=markwalters1009@gmail.com +Received: from mr.google.com ([10.180.92.71]) + by 10.180.92.71 with SMTP id ck7mr430612wib.3.1330033226320 (num_hops = + 1); Thu, 23 Feb 2012 13:40:26 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; + bh=noVItqpIuPzOT7QTxwJZajjm7owBIqCzFrDF3S4ak8M=; + b=U8po1F9BBug2fTmtoBMhZLmkRDprJ+SkBTriHAxraaQmZbMjDUbvS5wgCuOpBN7mvc + 2wThnSpr/8b6cIDwrHp/ZMvXWAI8DstR6hRgWe3fd4K9Y9jaKhvkS5LLZ/CSixxAGFcR + BqjYrZFF+6+ju8VLVobuorQTEYKb1mzqPX6RM= +Received: by 10.180.92.71 with SMTP id ck7mr349988wib.3.1330033226264; + Thu, 23 Feb 2012 13:40:26 -0800 (PST) +Received: from localhost (94-192-233-223.zone6.bethere.co.uk. + [94.192.233.223]) by mx.google.com with ESMTPS id + ga1sm12335409wib.5.2012.02.23.13.40.24 (version=TLSv1/SSLv3 cipher=OTHER); + Thu, 23 Feb 2012 13:40:25 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH 2/2] emacs: make elide messages use notmuch-show for omitting + messages. +Date: Thu, 23 Feb 2012 21:41:34 +0000 +Message-Id: <1330033294-21980-3-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.2.3 +In-Reply-To: <1330033294-21980-1-git-send-email-markwalters1009@gmail.com> +References: <1330033294-21980-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: Thu, 23 Feb 2012 21:40:29 -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 | 10 ++++++---- + 1 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +index dcef3d5..e368363 100644 +--- a/emacs/notmuch-show.el ++++ b/emacs/notmuch-show.el +@@ -981,9 +981,10 @@ current buffer, if possible." + "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. ++ (if (eq (length tree) 2) ++ (notmuch-show-insert-msg msg depth) ++ (setq replies msg)) + (notmuch-show-insert-thread replies (1+ depth)))) + + (defun notmuch-show-insert-thread (thread depth) +@@ -1064,7 +1065,8 @@ function is used." + (append (list "\'") basic-args + (list "and (" notmuch-show-query-context ")\'")) + (append (list "\'") basic-args (list "\'")))) +- (cli-args (list "--entire-thread"))) ++ (cli-args (unless notmuch-show-elide-non-matching-messages ++ (list "--entire-thread")))) + (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. +-- +1.7.2.3 + -- 2.26.2