Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 6B16D431FB6 for ; Fri, 3 Feb 2012 16:32:45 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_NONE=-0.0001] 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 n5CcAG3Kmz1H for ; Fri, 3 Feb 2012 16:32:44 -0800 (PST) Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by olra.theworths.org (Postfix) with ESMTP id F18B1431FBD for ; Fri, 3 Feb 2012 16:32:41 -0800 (PST) Received: from pd2ml1so-ssvc.prod.shaw.ca ([10.0.141.139]) by pd3mo1so-svcs.prod.shaw.ca with ESMTP; 03 Feb 2012 17:32:40 -0700 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=2TvZ7eE48NdEYeaL5Xf58dNzJU178UzT+2lxUZ5Mhss= c=1 sm=1 a=OhxnqyL4MJ8A:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17 a=ZXeQhi9146TlpB7tSjEA:9 a=4ze6sY0TZOHs7T6yz-IA:7 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56]) by pd2ml1so-dmz.prod.shaw.ca with ESMTP; 03 Feb 2012 17:32:40 -0700 Received: by lagos.xvx.ca (Postfix, from userid 1000) id 9B2C1800C338; Fri, 3 Feb 2012 17:32:40 -0700 (MST) From: Adam Wolfe Gordon To: notmuch@notmuchmail.org Subject: [PATCH 2/2] emacs: Fix broken showing of forwarded messages. Date: Fri, 3 Feb 2012 17:32:33 -0700 Message-Id: <1328315554-16085-3-git-send-email-awg+notmuch@xvx.ca> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1328315554-16085-1-git-send-email-awg+notmuch@xvx.ca> References: <1328315554-16085-1-git-send-email-awg+notmuch@xvx.ca> 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: Sat, 04 Feb 2012 00:32:45 -0000 Fix the bug in showing forwarded messages with no new text by not hiding "original" messages if they are the entire message. --- emacs/notmuch-wash.el | 5 +++-- test/emacs | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el index 67143e5..2fe9e5d 100644 --- a/emacs/notmuch-wash.el +++ b/emacs/notmuch-wash.el @@ -176,8 +176,9 @@ insert before the button, probably for indentation." (let* ((msg-start (match-beginning 0)) (msg-end (point-max)) (msg-lines (count-lines msg-start msg-end))) - (notmuch-wash-region-to-button - msg msg-start msg-end "original" "\n"))) + (when (< msg-lines (count-lines (point-min) (point-max))) + (notmuch-wash-region-to-button + msg msg-start msg-end "original" "\n")))) (while (and (< (point) (point-max)) (re-search-forward notmuch-wash-citation-regexp nil t)) (let* ((cite-start (match-beginning 0)) diff --git a/test/emacs b/test/emacs index b8b13a7..52683dd 100755 --- a/test/emacs +++ b/test/emacs @@ -350,7 +350,6 @@ Thanks for the advice! I will be sure to put it to good use. test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "Non-hiding of forwarded message with no new text" -test_subtest_known_broken add_message [id]=forwarded-top-post \ '[subject]="FW: The problem with top-posting"' \ '[body]=" -- 1.7.5.4