[PATCH] emacs: make elide messages use notmuch-show for omitting messages.
authorMark Walters <markwalters1009@gmail.com>
Tue, 10 Apr 2012 20:48:04 +0000 (21:48 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:14 +0000 (09:46 -0800)
fc/8cd027f742c4bce86b4297f9a44b5256075674 [new file with mode: 0644]

diff --git a/fc/8cd027f742c4bce86b4297f9a44b5256075674 b/fc/8cd027f742c4bce86b4297f9a44b5256075674
new file mode 100644 (file)
index 0000000..85ef8aa
--- /dev/null
@@ -0,0 +1,121 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 820DC431FB6\r
+       for <notmuch@notmuchmail.org>; Tue, 10 Apr 2012 13:47:55 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id g1MxwFQtkQ17 for <notmuch@notmuchmail.org>;\r
+       Tue, 10 Apr 2012 13:47:55 -0700 (PDT)\r
+Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
+       [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id BDE7F431FAE\r
+       for <notmuch@notmuchmail.org>; Tue, 10 Apr 2012 13:47:54 -0700 (PDT)\r
+Received: by werm13 with SMTP id m13so151378wer.26\r
+       for <notmuch@notmuchmail.org>; Tue, 10 Apr 2012 13:47:53 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=fO/bx0mh1XPFW++kojX8QCp4rJh0d9Q9PO6UdkvZFMM=;\r
+       b=qnOWmzzmGIVl1RX6gKS4B2qXohAPysL2xUehN25aTbs0qE0U3IQXFJMZah/A1BJCF/\r
+       YKCI7GMYFi7t56gDES5rA63XNj8iaHmLh4Gd1cTZpDdc6+dQxmFUY3bB8yn/HqRB+My/\r
+       LvuXzt9GXmNrmEpjRB8v8IIwhfDdgkNdxulcZNEqcXYcuy/b7fnYh10ZjDyqvWw7Wf6I\r
+       1hEqIycn0bP0WgUiT9hBiezPUdypXmIhNjq52f0Pm+e8r7jBgqGTfl36tLgddFSAlw9x\r
+       rwVj2G6j27JvQe8/1AvtYDdDScqOwo1TyQwjGH2v8+cWDyuouqVDB3C8ti1VX62Gg6D2\r
+       lyPg==\r
+Received: by 10.216.133.96 with SMTP id p74mr7178580wei.30.1334090873331;\r
+       Tue, 10 Apr 2012 13:47:53 -0700 (PDT)\r
+Received: from localhost (94-192-233-223.zone6.bethere.co.uk.\r
+ [94.192.233.223])     by mx.google.com with ESMTPS id\r
+ fz9sm40090876wib.3.2012.04.10.13.47.50        (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Tue, 10 Apr 2012 13:47:51 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: make elide messages use notmuch-show for omitting\r
+       messages.\r
+Date: Tue, 10 Apr 2012 21:48:04 +0100\r
+Message-Id: <1334090884-13001-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1334077496-9172-3-git-send-email-markwalters1009@gmail.com>\r
+References: <1334077496-9172-3-git-send-email-markwalters1009@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 10 Apr 2012 20:47:55 -0000\r
+\r
+Previously the elide messages code got the entire-thread from\r
+notmuch-show.c and then threw away all non-matching messages. This\r
+version calls notmuch-show.c without the --entire-thread flag so\r
+it never receives the non-matching messages in the first place.\r
+\r
+This makes it substantially faster.\r
+---\r
+\r
+This replaces the patch [1] as that mistakenly did not \r
+set --exclude=false in the case when messages are not elided.\r
+\r
+ emacs/notmuch-show.el |   18 ++++++++++--------\r
+ 1 files changed, 10 insertions(+), 8 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 30b26d1..820bb41 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -976,9 +976,9 @@ current buffer, if possible."\r
+   "Insert the message tree TREE at depth DEPTH in the current thread."\r
+   (let ((msg (car tree))\r
+       (replies (cadr tree)))\r
+-    (if (or (not notmuch-show-elide-non-matching-messages)\r
+-          (plist-get msg :match))\r
+-      (notmuch-show-insert-msg msg depth))\r
++    ;; We test whether there is a message or just some replies.\r
++    (when msg\r
++      (notmuch-show-insert-msg msg depth))\r
+     (notmuch-show-insert-thread replies (1+ depth))))\r
\r
+ (defun notmuch-show-insert-thread (thread depth)\r
+@@ -1059,16 +1059,18 @@ function is used."\r
+            (args (if notmuch-show-query-context\r
+                      (append (list "\'") basic-args\r
+                              (list "and (" notmuch-show-query-context ")\'"))\r
+-                   (append (list "\'") basic-args (list "\'")))))\r
+-      (notmuch-show-insert-forest (notmuch-query-get-threads\r
+-                                   (cons "--exclude=false" args)))\r
++                   (append (list "\'") basic-args (list "\'"))))\r
++           (cli-args (cons "--exclude=false"\r
++                           (when notmuch-show-elide-non-matching-messages\r
++                             (list "--entire-thread=false")))))\r
++\r
++      (notmuch-show-insert-forest (notmuch-query-get-threads (append cli-args args)))\r
+       ;; If the query context reduced the results to nothing, run\r
+       ;; the basic query.\r
+       (when (and (eq (buffer-size) 0)\r
+                  notmuch-show-query-context)\r
+         (notmuch-show-insert-forest\r
+-         (notmuch-query-get-threads\r
+-          (cons "--exclude=false" basic-args)))))\r
++         (notmuch-query-get-threads (append cli-args basic-args)))))\r
\r
+       (jit-lock-register #'notmuch-show-buttonise-links)\r
\r
+-- \r
+1.7.9.1\r
+\r