From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 670F2429E27 for ; Sun, 3 Jul 2011 19:00:39 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K0jcwEqa0m85 for ; Sun, 3 Jul 2011 19:00:38 -0700 (PDT) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 396E0429E2C for ; Sun, 3 Jul 2011 19:00:35 -0700 (PDT) Received: by mail-bw0-f53.google.com with SMTP id 12so4396763bwg.26 for ; Sun, 03 Jul 2011 19:00:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=nhCvXIRCs02cK6O1qVptjrzeWYOjv3j0kYJze6F6zAc=; b=QExCphagbnT5ix0uHWQtdYjkZwro1cziUzIAjYJ8NY9H9ARM/HYfn0tP+94kWDuSY8 lVqmlaiceatM1WMeyH4IuIWOup+JE2fFqp3EEqEpFs8z9QseBbtCd4Ekmug892rT77C3 Ah1tpPHK1eEZbrV1c15XXeT4O/htXkXLPCXMQ= Received: by 10.204.171.65 with SMTP id g1mr4445874bkz.45.1309744834788; Sun, 03 Jul 2011 19:00:34 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id l24sm5104716bkw.15.2011.07.03.19.00.33 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Jul 2011 19:00:33 -0700 (PDT) From: Dmitry Kurochkin To: notmuch@notmuchmail.org Subject: [PATCH 3/3] test: add emacs test for hiding a message following an HTML part Date: Mon, 4 Jul 2011 05:59:03 +0400 Message-Id: <1309744743-8556-3-git-send-email-dmitry.kurochkin@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1309744743-8556-1-git-send-email-dmitry.kurochkin@gmail.com> References: <1309744743-8556-1-git-send-email-dmitry.kurochkin@gmail.com> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2011 02:00:39 -0000 Human-friendly scenario: * open a thread where a message which ends with an HTML part is followed by another message * make the first message visible * goto the beginning of the second message (first line, first colon) * hit "RET" Result: nothing happens except for "No URL at point" message Expected result: the second message is shown/hidden The root cause is that the HTML part has `keymap' text property set. In particular, "RET" is bound to visit a URL at point. The problem is that `keymap' property affects the next character following the region it is set to (see elisp manual [1]). Hence, the first character of the next message has a keymap inherited from the HTML part. [1] http://www.gnu.org/software/emacs/elisp/html_node/Special-Properties.html --- test/emacs | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/test/emacs b/test/emacs index f465e2b..8b627c7 100755 --- a/test/emacs +++ b/test/emacs @@ -342,4 +342,30 @@ test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail. (test-visible-output)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages +test_begin_subtest 'Hiding message following HTML part' +test_subtest_known_broken +id='html-message@notmuchmail.org' +emacs_deliver_message \ + 'HTML message' \ + '' \ + "(message-goto-eoh) + (insert \"Message-ID: <$id>\n\") + (message-goto-body) + (mml-insert-part \"text/html\") + (insert \"This is a test HTML message\")" +emacs_deliver_message \ + 'Reply to HTML message' \ + 'This is a reply to the test HTML message' \ + "(message-goto-eoh) + (insert \"In-Reply-To: <$id>\n\")" +test_emacs "(notmuch-show \"id:$id\") \ + (notmuch-show-next-message) \ + (command-execute (key-binding (kbd \"RET\"))) \ + (test-visible-output)" +test_emacs "(notmuch-show \"id:$id\") \ + (notmuch-show-next-message) \ + (notmuch-show-toggle-message) \ + (test-visible-output \"EXPECTED\")" +test_expect_equal_file OUTPUT EXPECTED + test_done -- 1.7.5.4