[PATCH] emacs: show: refresh buffer did not remove overlays
authorMark Walters <markwalters1009@gmail.com>
Mon, 3 Dec 2012 13:11:00 +0000 (13:11 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:51:22 +0000 (09:51 -0800)
47/efd3eec03fa603c31d6ab8d11f4fee3a8b2d37 [new file with mode: 0644]

diff --git a/47/efd3eec03fa603c31d6ab8d11f4fee3a8b2d37 b/47/efd3eec03fa603c31d6ab8d11f4fee3a8b2d37
new file mode 100644 (file)
index 0000000..6579c4b
--- /dev/null
@@ -0,0 +1,105 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9E937431FBC\r
+       for <notmuch@notmuchmail.org>; Mon,  3 Dec 2012 05:11:05 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id pQZjcwT4wON6 for <notmuch@notmuchmail.org>;\r
+       Mon,  3 Dec 2012 05:11:05 -0800 (PST)\r
+Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
+       [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 0EE1C431FAE\r
+       for <notmuch@notmuchmail.org>; Mon,  3 Dec 2012 05:11:04 -0800 (PST)\r
+Received: by mail-wi0-f181.google.com with SMTP id hm9so1011810wib.2\r
+       for <notmuch@notmuchmail.org>; Mon, 03 Dec 2012 05:11:04 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer;\r
+       bh=rf2JUMYk3zwhrNc+f/0R3cU1dFQvRlKq4jUv1Vz7KdQ=;\r
+       b=KIUJl5ZiALuGEhn+6IFx81kh5jPMsrA35Eo6uqaoKkebLCj5UV6fg09vawmgsPpwhe\r
+       C+MUTnCnpIOZyEVkmlgSdNCHLJXZhfZQGgqdVomZEbKCnwMEIgDB+mYfxqVFWkJ9zDAk\r
+       mBGzblfWmP/nlelouk8K142C799AWEt/SB0U0R3cphDiFYqq6VyKvdsvOmwzJrs3Yg0x\r
+       tz8qNxTi3WLc1A8/nEy/qTi8SJTmBcv3CSrCPciL60svO6h0cYlHUupnKFG1q9SQCF1q\r
+       mj03KAcwWfe9a/qdRxoKm9mHF4P4UIZolgLPJuwOr96bCHrjcBji1uZecBBP5OZq6Neh\r
+       uWKw==\r
+Received: by 10.216.206.152 with SMTP id l24mr3290838weo.93.1354540263889;\r
+       Mon, 03 Dec 2012 05:11:03 -0800 (PST)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPS id cf6sm12492971wib.3.2012.12.03.05.11.01\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Mon, 03 Dec 2012 05:11:02 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: show: refresh buffer did not remove overlays\r
+Date: Mon,  3 Dec 2012 13:11:00 +0000\r
+Message-Id: <1354540260-21814-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 03 Dec 2012 13:11:05 -0000\r
+\r
+Previously refreshing the notmuch show buffer did not remove overlays\r
+which meant that if the user refreshed a message with images the\r
+images would remain and then the new text was added after.\r
+\r
+One might have guessed that erase-buffer would have removed them but\r
+it seems not.  Thus force the removal of overlays with remove-overlay.\r
+---\r
+The new toggle-parts code makes this bug much more likely to trigger\r
+(as the user is quite likely to toggle a part in a message with an\r
+image). However, it was already present if anyone tried refreshing a\r
+show buffer with an image in it.\r
+\r
+It would be good if someone could check whether there is anything else\r
+that also needs to be manually removed. But, for me at least, this\r
+seems to fix the problem.\r
+\r
+Many thanks to Jani for finding the bug and helping with the diagnosis.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+\r
+\r
+ emacs/notmuch-show.el |    3 +++\r
+ 1 files changed, 3 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index c8c1657..e89dba2 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -1214,6 +1214,9 @@ reset based on the original query."\r
+                  (setq notmuch-show-message-multipart/alternative-display-parts nil)\r
+                (notmuch-show-capture-state))))\r
+     (erase-buffer)\r
++    ;; erase-buffer does not seem to remove overlays so do it manually.\r
++    ;; This can lead to weird effects such as remaining images.\r
++    (remove-overlays)\r
+     (notmuch-show-build-buffer)\r
+     (if state\r
+       (notmuch-show-apply-state state)\r
+-- \r
+1.7.9.1\r
+\r