[PATCH 2/2] emacs: Fix broken showing of forwarded messages.

Adam Wolfe Gordon awg+notmuch at xvx.ca
Fri Feb 3 16:32:33 PST 2012


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



More information about the notmuch mailing list