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 ADCE4429E29 for ; Sun, 3 Jul 2011 21:07:50 -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 eDgsk62nq813 for ; Sun, 3 Jul 2011 21:07:50 -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 BD299431FB6 for ; Sun, 3 Jul 2011 21:07:49 -0700 (PDT) Received: by mail-bw0-f53.google.com with SMTP id 12so4447816bwg.26 for ; Sun, 03 Jul 2011 21:07:49 -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=BrOA05zo0ubh7FPqs3aHaIaH65JXe/3H9gNUyAe4U24XUdXMiSua46cqdC9Io0zvLy cHfv5mxXFMraYOu5SvcXJTkDP7HDeDXSgwX4HE6BWDaczVISPWlm0fs1onH0ZYAGwyRj d0/GesWd871YI1zvMn+oc0wkpZSQw+lqw5KFE= Received: by 10.204.0.67 with SMTP id 3mr415343bka.37.1309752469448; Sun, 03 Jul 2011 21:07:49 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id e6sm5166171bka.23.2011.07.03.21.07.47 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Jul 2011 21:07:48 -0700 (PDT) From: Dmitry Kurochkin To: notmuch@notmuchmail.org Subject: [PATCH v2 3/3] test: add emacs test for hiding a message following an HTML part Date: Mon, 4 Jul 2011 08:07:21 +0400 Message-Id: <1309752441-10651-4-git-send-email-dmitry.kurochkin@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1309752441-10651-1-git-send-email-dmitry.kurochkin@gmail.com> References: <1309744743-8556-1-git-send-email-dmitry.kurochkin@gmail.com> <1309752441-10651-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 04:07:50 -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