unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Adam Wolfe Gordon <awg+notmuch@xvx.ca>
To: notmuch@notmuchmail.org
Subject: [PATCH 2/2] emacs: Fix broken showing of forwarded messages.
Date: Fri,  3 Feb 2012 17:32:33 -0700	[thread overview]
Message-ID: <1328315554-16085-3-git-send-email-awg+notmuch@xvx.ca> (raw)
In-Reply-To: <1328315554-16085-1-git-send-email-awg+notmuch@xvx.ca>

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

  parent reply	other threads:[~2012-02-04  0:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-04  0:32 [PATCH 0/2] Bug and potential fix: forwarded messages Adam Wolfe Gordon
2012-02-04  0:32 ` [PATCH 1/2] test: Add broken test for showing " Adam Wolfe Gordon
2012-02-04  0:32 ` Adam Wolfe Gordon [this message]
2012-02-04  6:01 ` [PATCH 0/2] Bug and potential fix: " Adam Wolfe Gordon
2012-02-04  6:10   ` Dmitry Kurochkin
2012-02-04 16:51     ` Adam Wolfe Gordon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1328315554-16085-3-git-send-email-awg+notmuch@xvx.ca \
    --to=awg+notmuch@xvx.ca \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).