[PATCH 3/3] test: add emacs test for hiding a message following an HTML part
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Mon, 4 Jul 2011 01:59:03 +0000 (05:59 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:56 +0000 (09:38 -0800)
73/277aa2d8b750aeb1ab3a74fc5ae4c42d0fe191 [new file with mode: 0644]

diff --git a/73/277aa2d8b750aeb1ab3a74fc5ae4c42d0fe191 b/73/277aa2d8b750aeb1ab3a74fc5ae4c42d0fe191
new file mode 100644 (file)
index 0000000..18764f1
--- /dev/null
@@ -0,0 +1,123 @@
+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 670F2429E27\r
+       for <notmuch@notmuchmail.org>; Sun,  3 Jul 2011 19:00:39 -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 K0jcwEqa0m85 for <notmuch@notmuchmail.org>;\r
+       Sun,  3 Jul 2011 19:00:38 -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 396E0429E2C\r
+       for <notmuch@notmuchmail.org>; Sun,  3 Jul 2011 19:00:35 -0700 (PDT)\r
+Received: by mail-bw0-f53.google.com with SMTP id 12so4396763bwg.26\r
+       for <notmuch@notmuchmail.org>; Sun, 03 Jul 2011 19:00:34 -0700 (PDT)\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=nhCvXIRCs02cK6O1qVptjrzeWYOjv3j0kYJze6F6zAc=;\r
+       b=QExCphagbnT5ix0uHWQtdYjkZwro1cziUzIAjYJ8NY9H9ARM/HYfn0tP+94kWDuSY8\r
+       lVqmlaiceatM1WMeyH4IuIWOup+JE2fFqp3EEqEpFs8z9QseBbtCd4Ekmug892rT77C3\r
+       Ah1tpPHK1eEZbrV1c15XXeT4O/htXkXLPCXMQ=\r
+Received: by 10.204.171.65 with SMTP id g1mr4445874bkz.45.1309744834788;\r
+       Sun, 03 Jul 2011 19:00:34 -0700 (PDT)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id l24sm5104716bkw.15.2011.07.03.19.00.33\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sun, 03 Jul 2011 19:00:33 -0700 (PDT)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 3/3] test: add emacs test for hiding a message following an\r
+       HTML part\r
+Date: Mon,  4 Jul 2011 05:59:03 +0400\r
+Message-Id: <1309744743-8556-3-git-send-email-dmitry.kurochkin@gmail.com>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <1309744743-8556-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+References: <1309744743-8556-1-git-send-email-dmitry.kurochkin@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, 04 Jul 2011 02:00:39 -0000\r
+\r
+Human-friendly scenario:\r
+\r
+* open a thread where a message which ends with an HTML part is\r
+  followed by another message\r
+\r
+* make the first message visible\r
+\r
+* goto the beginning of the second message (first line, first colon)\r
+\r
+* hit "RET"\r
+\r
+Result: nothing happens except for "No URL at point" message\r
+\r
+Expected result: the second message is shown/hidden\r
+\r
+The root cause is that the HTML part has `keymap' text property set.\r
+In particular, "RET" is bound to visit a URL at point.  The problem is\r
+that `keymap' property affects the next character following the region\r
+it is set to (see elisp manual [1]).  Hence, the first character of\r
+the next message has a keymap inherited from the HTML part.\r
+\r
+[1] http://www.gnu.org/software/emacs/elisp/html_node/Special-Properties.html\r
+---\r
+ test/emacs |   26 ++++++++++++++++++++++++++\r
+ 1 files changed, 26 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/test/emacs b/test/emacs\r
+index f465e2b..8b627c7 100755\r
+--- a/test/emacs\r
++++ b/test/emacs\r
+@@ -342,4 +342,30 @@ 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 'Hiding message following HTML part'\r
++test_subtest_known_broken\r
++id='html-message@notmuchmail.org'\r
++emacs_deliver_message \\r
++    'HTML message' \\r
++    '' \\r
++    "(message-goto-eoh)\r
++     (insert \"Message-ID: <$id>\n\")\r
++     (message-goto-body)\r
++     (mml-insert-part \"text/html\")\r
++     (insert \"<body>This is a test HTML message</body>\")"\r
++emacs_deliver_message \\r
++    'Reply to HTML message' \\r
++    'This is a reply to the test HTML message' \\r
++    "(message-goto-eoh)\r
++     (insert \"In-Reply-To: <$id>\n\")"\r
++test_emacs "(notmuch-show \"id:$id\") \\r
++            (notmuch-show-next-message) \\r
++            (command-execute (key-binding (kbd \"RET\"))) \\r
++            (test-visible-output)"\r
++test_emacs "(notmuch-show \"id:$id\") \\r
++            (notmuch-show-next-message) \\r
++            (notmuch-show-toggle-message) \\r
++            (test-visible-output \"EXPECTED\")"\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
+ test_done\r
+-- \r
+1.7.5.4\r
+\r