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 820DC431FB6 for ; Tue, 10 Apr 2012 13:47:55 -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 g1MxwFQtkQ17 for ; Tue, 10 Apr 2012 13:47:55 -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 BDE7F431FAE for ; Tue, 10 Apr 2012 13:47:54 -0700 (PDT) Received: by werm13 with SMTP id m13so151378wer.26 for ; Tue, 10 Apr 2012 13:47:53 -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=fO/bx0mh1XPFW++kojX8QCp4rJh0d9Q9PO6UdkvZFMM=; b=qnOWmzzmGIVl1RX6gKS4B2qXohAPysL2xUehN25aTbs0qE0U3IQXFJMZah/A1BJCF/ YKCI7GMYFi7t56gDES5rA63XNj8iaHmLh4Gd1cTZpDdc6+dQxmFUY3bB8yn/HqRB+My/ LvuXzt9GXmNrmEpjRB8v8IIwhfDdgkNdxulcZNEqcXYcuy/b7fnYh10ZjDyqvWw7Wf6I 1hEqIycn0bP0WgUiT9hBiezPUdypXmIhNjq52f0Pm+e8r7jBgqGTfl36tLgddFSAlw9x rwVj2G6j27JvQe8/1AvtYDdDScqOwo1TyQwjGH2v8+cWDyuouqVDB3C8ti1VX62Gg6D2 lyPg== Received: by 10.216.133.96 with SMTP id p74mr7178580wei.30.1334090873331; Tue, 10 Apr 2012 13:47:53 -0700 (PDT) Received: from localhost (94-192-233-223.zone6.bethere.co.uk. [94.192.233.223]) by mx.google.com with ESMTPS id fz9sm40090876wib.3.2012.04.10.13.47.50 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 10 Apr 2012 13:47:51 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH] emacs: make elide messages use notmuch-show for omitting messages. Date: Tue, 10 Apr 2012 21:48:04 +0100 Message-Id: <1334090884-13001-1-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1334077496-9172-3-git-send-email-markwalters1009@gmail.com> References: <1334077496-9172-3-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: Tue, 10 Apr 2012 20:47:55 -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. --- This replaces the patch [1] as that mistakenly did not set --exclude=false in the case when messages are not elided. 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 30b26d1..820bb41 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -976,9 +976,9 @@ 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. + (when msg + (notmuch-show-insert-msg msg depth)) (notmuch-show-insert-thread replies (1+ depth)))) (defun notmuch-show-insert-thread (thread depth) @@ -1059,16 +1059,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