emacs: show: refresh buffer did not remove overlays
authorMark Walters <markwalters1009@gmail.com>
Wed, 5 Dec 2012 12:11:49 +0000 (12:11 +0000)
committerDavid Bremner <bremner@debian.org>
Thu, 6 Dec 2012 21:13:23 +0000 (17:13 -0400)
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-overlays.

emacs/notmuch-show.el

index 4d6c014b0690dc7a563dfa64286eb6c4aaedaee0..20f89970a00a7008fadf818e5873662c12c48c06 100644 (file)
@@ -1185,6 +1185,10 @@ reset based on the original query."
   (let ((inhibit-read-only t)
        (state (unless reset-state
                 (notmuch-show-capture-state))))
+    ;; erase-buffer does not seem to remove overlays, which can lead
+    ;; to weird effects such as remaining images, so remove them
+    ;; manually.
+    (remove-overlays)
     (erase-buffer)
     (notmuch-show-build-buffer)
     (if state