unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: show: refresh buffer did not remove overlays
@ 2012-12-03 13:11 Mark Walters
  2012-12-03 16:47 ` Austin Clements
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Walters @ 2012-12-03 13:11 UTC (permalink / raw)
  To: notmuch

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-12-06 21:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-03 13:11 [PATCH] emacs: show: refresh buffer did not remove overlays Mark Walters
2012-12-03 16:47 ` Austin Clements
2012-12-05 12:11   ` [PATCH v2] " Mark Walters
2012-12-05 15:59     ` Austin Clements
2012-12-06 21:24     ` David Bremner

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).