--- /dev/null
+Return-Path: <dmitry.kurochkin@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 5F916429E5B\r
+ for <notmuch@notmuchmail.org>; Tue, 28 Jun 2011 22:10:27 -0700 (PDT)\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 T2-dGGSxgBtO for <notmuch@notmuchmail.org>;\r
+ Tue, 28 Jun 2011 22:10:26 -0700 (PDT)\r
+Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
+ [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id DFC1E429E55\r
+ for <notmuch@notmuchmail.org>; Tue, 28 Jun 2011 22:10:25 -0700 (PDT)\r
+Received: by bwg12 with SMTP id 12so813087bwg.26\r
+ for <notmuch@notmuchmail.org>; Tue, 28 Jun 2011 22:10:24 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+ h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
+ :mime-version:content-type;\r
+ bh=b2DzGBIJBJt5uCN0196YSwC9R6hTOytsC9AOCMey3bE=;\r
+ b=t6MyIzjPOFsB/w0Fr6OFwL+D0HQ1/6Js/iaVb8MFw1YQXUB8ynkITi+tOs6gyn572i\r
+ pe1D7rb0EBdQ4zSNDJx51by1JAeTJu1nlh3AxSHaZKBJ9RSrdxwYR4WOtk2GB3N5vnxI\r
+ QEMUmf25+RDB9mK2w+oIjQ2RFRh7W/hsIZ+TY=\r
+Received: by 10.204.171.1 with SMTP id f1mr287078bkz.194.1309324224530;\r
+ Tue, 28 Jun 2011 22:10:24 -0700 (PDT)\r
+Received: from localhost ([91.144.186.21])\r
+ by mx.google.com with ESMTPS id ek1sm795354bkb.9.2011.06.28.22.10.23\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Tue, 28 Jun 2011 22:10:23 -0700 (PDT)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 1/3] test: `notmuch-show-advance-and-archive' with\r
+ invisible signature\r
+In-Reply-To: <1309312132-14564-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+References: <1309312132-14564-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+User-Agent: Notmuch/0.5-297-gfb148d8 (http://notmuchmail.org) Emacs/23.3.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Wed, 29 Jun 2011 09:10:19 +0400\r
+Message-ID: <87pqlxw7d0.fsf@gmail.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, 29 Jun 2011 05:10:27 -0000\r
+\r
+On Wed, 29 Jun 2011 05:48:50 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:\r
+> Add Emacs test to check that `notmuch-show-advance-and-archive'\r
+> works for the last message in thread with invisible signature.\r
+> ---\r
+> \r
+> This patch series fixes the bug reported by Sebastien in [1]. I\r
+> was able to reproduce it and confirm that the second patch from\r
+> this series fixes the problem. Unfortunately, I can not explain\r
+> why it fixes it. The patch uses a cleaner approach for visible\r
+> text search. But the old approach should work fine as well.\r
+> Apparently, it does not work when `invisible' property is not a\r
+> single symbol but a list (which was changed in\r
+> 95ef8da29439f2e79115c36ab4d2a80aef1a1462). I suspect that it is\r
+> an Emacs bug. I plan to look at it later.\r
+> \r
+\r
+Turns out that `point-invisible-p' is a function from notmuch-lib.el, I\r
+did not realize that before. It implements a custom visibility check\r
+which is incomplete and does not work correctly when `invisible'\r
+property is a list. That is why the previous code (which used\r
+`point-invisible-p') had the bug. I sent another patch that removes\r
+`point-invisible-p' function.\r
+\r
+> Another issue is that the test does not demonstrate the bug.\r
+> Again, I do not really know why. It passes both before and after\r
+> the fix. Although if I run the test commands by hand I hit the\r
+> bug. I guess it has something to do with emacs daemon mode when\r
+> the buffer is not visible. I hope someone with a better elisp\r
+> knowledge can tell what is going on and how to make the test\r
+> work.\r
+> \r
+\r
+Now it is clear where the bug was. Remaining question is how to test\r
+it.\r
+\r
+Regards,\r
+ Dmitry\r
+\r
+> I believe patches 2 and 3 can be pushed after review even without\r
+> a working test.\r
+> \r
+> Regards,\r
+> Dmitry\r
+> \r
+> [1] id:"8739j5rn2d.fsf@cern.ch"\r
+> \r
+> test/emacs | 12 ++++++++++++\r
+> 1 files changed, 12 insertions(+), 0 deletions(-)\r
+> \r
+> diff --git a/test/emacs b/test/emacs\r
+> index e59de47..65a96a5 100755\r
+> --- a/test/emacs\r
+> +++ b/test/emacs\r
+> @@ -347,4 +347,16 @@ test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.\r
+> (test-visible-output)'\r
+> test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages\r
+> \r
+> +test_begin_subtest 'notmuch-show-advance-and-archive with invisible signature'\r
+> +message1='id:20091118010116.GC25380@dottiness.seas.harvard.edu'\r
+> +message2='id:1258491078-29658-1-git-send-email-dottedmag@dottedmag.net'\r
+> +test_emacs "(notmuch-search \"$message1 or $message2\")\r
+> + (notmuch-test-wait)\r
+> + (notmuch-search-show-thread)\r
+> + (notmuch-show-advance-and-archive)\r
+> + (test-output)"\r
+> +test_emacs "(notmuch-show \"$message2\")\r
+> + (test-output \"EXPECTED\")"\r
+> +test_expect_equal_file OUTPUT EXPECTED\r
+> +\r
+> test_done\r
+> -- \r
+> 1.7.5.4\r
+> \r