[PATCH 2/2] emacs: make elide messages use notmuch-show for omitting messages.
authorMark Walters <markwalters1009@gmail.com>
Thu, 23 Feb 2012 21:41:34 +0000 (21:41 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:51 +0000 (09:44 -0800)
ea/c09d45ee259c8cb8fd67c5d9143cb0873bb67c [new file with mode: 0644]

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