From 5c5fada75437f35d6bd26bb86d6e7de4dd924cc9 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sat, 16 Jun 2012 11:21:46 +0100 Subject: [PATCH] [Patch v8 5/6] emacs: make elide messages use notmuch-show for omitting messages. --- e2/4c7dea477efeb4da20c70679bde8a8193f2647 | 117 ++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 e2/4c7dea477efeb4da20c70679bde8a8193f2647 diff --git a/e2/4c7dea477efeb4da20c70679bde8a8193f2647 b/e2/4c7dea477efeb4da20c70679bde8a8193f2647 new file mode 100644 index 000000000..25e247b59 --- /dev/null +++ b/e2/4c7dea477efeb4da20c70679bde8a8193f2647 @@ -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 B861C431FCF + for ; Sat, 16 Jun 2012 03:22:14 -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 RlYIo8Dt6qEL for ; + Sat, 16 Jun 2012 03:22:14 -0700 (PDT) +Received: from mail-we0-f181.google.com (mail-we0-f181.google.com + [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id A592E431FAE + for ; Sat, 16 Jun 2012 03:22:13 -0700 (PDT) +Received: by werj55 with SMTP id j55so3134807wer.26 + for ; Sat, 16 Jun 2012 03:22:12 -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=8V1x7Z78srfnDvC5UAcBvMLsjrORjAA0MUefFB7Qgyk=; + b=B0KG0CMpeq8KCd0lCZzDmSvBeoqVdRJblicyZ0y4k3kwNvknf4VKTsMsPS8cinwD82 + P8aV+qpvIFwJ8F2iB/6dI8aqJ0le3J+bZ09cdeauYTCjeDGhwy+rMoknGunDlln1j3wM + yR4yM2YIZXdt1MFQOtAmDjrCO7naCxjjTpnV6TXIv0lUfhDNjClPiDHoRzRoUhRKSuiM + 2jqZFpGhWbBRkKIyyX84Jcff5aEq77O1zPsWU/DdofJJRgOGkfwnwEmqMkHTg9+S1uKw + 6Mioh3UnRYSh8Q5tHaz5oN2YsTanp/42I7D6nwG7PHWnO0NxgJbz93oSCwjBY0xAteza + pfmQ== +Received: by 10.180.92.69 with SMTP id ck5mr10588754wib.14.1339842132428; + Sat, 16 Jun 2012 03:22:12 -0700 (PDT) +Received: from localhost (94-192-233-223.zone6.bethere.co.uk. + [94.192.233.223]) by mx.google.com with ESMTPS id + z8sm16613333wiy.1.2012.06.16.03.22.11 (version=TLSv1/SSLv3 cipher=OTHER); + Sat, 16 Jun 2012 03:22:11 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [Patch v8 5/6] emacs: make elide messages use notmuch-show for + omitting messages. +Date: Sat, 16 Jun 2012 11:21:46 +0100 +Message-Id: <1339842107-10632-6-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1339842107-10632-1-git-send-email-markwalters1009@gmail.com> +References: <1339842107-10632-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, 16 Jun 2012 10:22:15 -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 36cad93..b8fc9ef 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