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