--- /dev/null
+Return-Path: <ethan.glasser.camp@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 1D6A9431FBC\r
+ for <notmuch@notmuchmail.org>; Tue, 13 Nov 2012 18:03:50 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_FROM=0.001, 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 1-Q4Uy0Dh4fY for <notmuch@notmuchmail.org>;\r
+ Tue, 13 Nov 2012 18:03:49 -0800 (PST)\r
+Received: from mail-qa0-f53.google.com (mail-qa0-f53.google.com\r
+ [209.85.216.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 9B723431FAF\r
+ for <notmuch@notmuchmail.org>; Tue, 13 Nov 2012 18:03:49 -0800 (PST)\r
+Received: by mail-qa0-f53.google.com with SMTP id k31so17301qat.5\r
+ for <notmuch@notmuchmail.org>; Tue, 13 Nov 2012 18:03:49 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
+ :mime-version:content-type;\r
+ bh=g1j4nO3wh8KVUPX+uVwRMNbfCWm3X9pGgJIyNwACcj8=;\r
+ b=UWMQyOX3+vvDBXxuOTUSD+zkpDfZhp9tTlJ35O4SXBEboW5T9Ep+SLeENedWzRHiLQ\r
+ U765Amksuz9L7JKkHTSbTWfRdfdRJO+Ms5Qp1oGMquWUUN5nkJk/560p0YiizWwY1BwO\r
+ Ynvb0xjNmXygCtT3yJpKbbHbWxrAHCiISHODxyg0l1sDXDaSEDYnf4P9EvC7dQ8bveYP\r
+ TMLKD7wlbq/dMKAnp7HPwwdPykRyktLyKWQE8Evko1Jmg+0fjeJP4FJYJTzuqfmX9ImA\r
+ UyjzOlyZKLeQg3WIpa9/xRYgN+oj8ilwkR81ozTgGi3625XHFQAKKVr8jK2i0lP666PG\r
+ MhXA==\r
+Received: by 10.224.109.199 with SMTP id k7mr1497183qap.66.1352858629039;\r
+ Tue, 13 Nov 2012 18:03:49 -0800 (PST)\r
+Received: from smtp.gmail.com (mca2d36d0.tmodns.net. [208.54.45.202])\r
+ by mx.google.com with ESMTPS id lk6sm1270337qeb.10.2012.11.13.18.03.47\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Tue, 13 Nov 2012 18:03:47 -0800 (PST)\r
+From: Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>\r
+To: Damien Cassou <damien.cassou@gmail.com>,\r
+ notmuch mailing list <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH v2] emacs: display tags in notmuch-show with links\r
+In-Reply-To: <1352565719-12397-1-git-send-email-damien.cassou@gmail.com>\r
+References: <1352565719-12397-1-git-send-email-damien.cassou@gmail.com>\r
+User-Agent: Notmuch/0.14+45~g6ea9330 (http://notmuchmail.org) Emacs/23.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Tue, 13 Nov 2012 21:03:44 -0500\r
+Message-ID: <87mwyl54an.fsf@betacantrips.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\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: Wed, 14 Nov 2012 02:03:50 -0000\r
+\r
+Damien Cassou <damien.cassou@gmail.com> writes:\r
+\r
+> +(defun notmuch-tagger-present-tags (tags &optional headerline)\r
+> + "Return a property list which nicely presents all TAGS.\r
+> +\r
+> +If HEADERLINE is non-nil the returned list will be ready for\r
+> +inclusion in the buffer's header-line. HEADERLINE must be nil in\r
+> +all other cases."\r
+> + (list\r
+> + "("\r
+> + (notmuch-tagger-separate-elems (notmuch-tagger-format-tags tags headerline) " ")\r
+> + ")"))\r
+\r
+It is kind of appalling that it takes 128 lines just to do this. It\r
+seems like there has to be an easier way, or several easier\r
+ways. Unfortunately, I don't see any.\r
+\r
+> diff --git a/test/emacs b/test/emacs\r
+> index 44f641e..ecdc841 100755\r
+> --- a/test/emacs\r
+> +++ b/test/emacs\r
+> @@ -820,5 +820,66 @@ Date: Fri, 05 Jan 2001 15:43:57 +0000\r
+> EOF\r
+> test_expect_equal_file OUTPUT EXPECTED\r
+>\r
+> +test_begin_subtest "Extracting all tags from a thread"\r
+> +add_message \\r
+> + '[subject]="Extracting all tags from a thread"' \\r
+> + '[body]="body 1"'\r
+> +parent=${gen_msg_id}\r
+> +add_message \\r
+> + '[subject]="Extracting all tags from a thread"' \\r
+> + '[body]="body 2"' \\r
+> + "[in-reply-to]=\<$parent\>"\r
+> +add_message \\r
+> + '[subject]="Extracting all tags from a thread"' \\r
+> + '[body]="body 3"' \\r
+> + "[in-reply-to]=\<$parent\>"\r
+> +latest=${gen_msg_id}\r
+> +# Extract the thread-id from one of the emails\r
+> +thread_id=$(notmuch search id:${latest} | sed -e "s/thread:\([a-f0-9]*\).*/\1/")\r
+\r
+I think the accepted idiom is to use "notmuch search\r
+--output=threads". This will output just a string like\r
+"thread:00000000000000b9", so if you really need just the ID, you could\r
+still use sed here...\r
+\r
+> +# Add tag "mytagfoo" to one of the emails\r
+> +notmuch tag +mytagfoo id:${latest}\r
+> +test_emacs_expect_t \\r
+> + "(notmuch-show \"thread:${thread_id}\")\r
+\r
+... but it seems like "thread:..." is good enough for you.\r
+\r
+> + (error \"We must be in notmch-show at this point but we are in %s.\" major-mode))\r
+> + (push-button) ;; simulate a press on the RET key\r
+> + (if (eq major-mode 'notmuch-search-mode)\r
+> + t\r
+> + (format \"We must be in notmch-search at this point but we are in %s.\" major-mode))"\r
+\r
+s/notmch/notmuch/ here.\r
+\r
+Otherwise I think the code looks fine. I think the design concerns\r
+raised by Mark Walters are probably valid, though.\r
+\r
+Ethan\r