[RFC PATCH v3 10/11] emacs: notmuch-show.el just show the actual matching messages
authorMark Walters <markwalters1009@gmail.com>
Mon, 13 Feb 2012 01:20:14 +0000 (01:20 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:25 +0000 (09:44 -0800)
6c/59b76b63d96d04d0fb2b928cd6bf237c6b1d7b [new file with mode: 0644]

diff --git a/6c/59b76b63d96d04d0fb2b928cd6bf237c6b1d7b b/6c/59b76b63d96d04d0fb2b928cd6bf237c6b1d7b
new file mode 100644 (file)
index 0000000..b6600e3
--- /dev/null
@@ -0,0 +1,124 @@
+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 25305429E5B\r
+       for <notmuch@notmuchmail.org>; Sun, 12 Feb 2012 17:20:09 -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 fcINuPGSKcCL for <notmuch@notmuchmail.org>;\r
+       Sun, 12 Feb 2012 17:20:07 -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
+ 29F0441ED89   for <notmuch@notmuchmail.org>; Sun, 12 Feb 2012 17:19:35 -0800\r
+ (PST)\r
+Received: by mail-ww0-f45.google.com with SMTP id dt12so3923384wgb.2\r
+       for <notmuch@notmuchmail.org>; Sun, 12 Feb 2012 17:19:34 -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=bjPvB1mhZKhFbTwOQDABnBOGq9qBOylm7VNn7PMFCGQ=;\r
+       b=iA/9Fp/EbBVBDfMcHeME2lS9ULMDCaLnlLspBkqelUraq9mofsNTl5LvDziOCsjyrL\r
+       TkSPGnFQ7KeqznR8nvEU5/lG/CzIklrwADukjl8SZFu/7fQfsNPW6P0JAFr0e/OGoce6\r
+       QrbPxWa5SyXxZQQ4uylzUAJu0R8GdrxKH8/eA=\r
+Received: by 10.180.7.231 with SMTP id m7mr19367336wia.3.1329095974926;\r
+       Sun, 12 Feb 2012 17:19:34 -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
+ m16sm2450022wie.9.2012.02.12.17.19.33 (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sun, 12 Feb 2012 17:19:34 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [RFC PATCH v3 10/11] emacs: notmuch-show.el just show the actual\r
+       matching messages\r
+Date: Mon, 13 Feb 2012 01:20:14 +0000\r
+Message-Id: <1329096015-8078-11-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.2.3\r
+In-Reply-To: <1329072579-27340-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1329072579-27340-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: Mon, 13 Feb 2012 01:20:09 -0000\r
+\r
+Allow a parameter to notmuch-show to just show the matching\r
+messages. This is very similar to\r
+notmuch-show-elide-non-matching-messages but since it calls\r
+notmuch-show.c with the --thread=none parameter it does not keep any\r
+threading information.\r
+\r
+In particular the sort order is different: the elide-non-matching\r
+sorts by thread and just omits the non-matching messages, this option\r
+sorts by message.\r
+\r
+It is likely that the two should be unified.\r
+---\r
+ emacs/notmuch-show.el |   14 ++++++++++++--\r
+ 1 files changed, 12 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 8a8acf6..1adf964 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -152,6 +152,12 @@ indentation."\r
+ (make-variable-buffer-local 'notmuch-show-elide-non-matching-messages)\r
+ (put 'notmuch-show-elide-non-matching-messages 'permanent-local t)\r
+ \r
++;; This is very similar to the previous variable: they should be\r
++;; unified. MJW\r
++(defvar notmuch-show-just-matches nil)\r
++(make-variable-buffer-local 'notmuch-show-just-matches)\r
++(put 'notmuch-show-just-matches 'permanent-local t)\r
++\r
+ (defvar notmuch-show-indent-content t)\r
+ (make-variable-buffer-local 'notmuch-show-indent-content)\r
+ (put 'notmuch-show-indent-content 'permanent-local t)\r
+@@ -1014,7 +1020,7 @@ a corresponding notmuch search."\r
+                       'face goto-address-mail-face))))\r
+ \r
+ ;;;###autoload\r
+-(defun notmuch-show (thread-id &optional parent-buffer query-context buffer-name)\r
++(defun notmuch-show (thread-id &optional parent-buffer query-context buffer-name just-matches)\r
+   "Run \"notmuch show\" with the given thread ID and display results.\r
+ \r
+ The optional PARENT-BUFFER is the notmuch-search buffer from\r
+@@ -1047,7 +1053,9 @@ function is used."\r
+ \r
+     (setq notmuch-show-thread-id thread-id\r
+         notmuch-show-parent-buffer parent-buffer\r
+-        notmuch-show-query-context query-context)\r
++        notmuch-show-query-context query-context\r
++        notmuch-show-just-matches just-matches)\r
++\r
+     (notmuch-show-worker)\r
+     (current-buffer)))\r
+ \r
+@@ -1066,6 +1074,8 @@ function is used."\r
+                      (append (list "\'") basic-args\r
+                              (list "and (" notmuch-show-query-context ")\'"))\r
+                    (append (list "\'") basic-args (list "\'")))))\r
++      (if notmuch-show-just-matches\r
++          (setq args (append (list "--thread=none") args)))\r
+       (notmuch-show-insert-forest (notmuch-query-get-threads args))\r
+       ;; If the query context reduced the results to nothing, run\r
+       ;; the basic query.\r
+-- \r
+1.7.2.3\r
+\r