From: Mark Walters <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH v2] emacs: show: refresh buffer did not remove overlays
Date: Wed, 5 Dec 2012 12:11:49 +0000 [thread overview]
Message-ID: <1354709509-22123-1-git-send-email-markwalters1009@gmail.com> (raw)
In-Reply-To: <20121203164730.GE1020@mit.edu>
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.
---
This version fixes the problems that Austin mentioned in his review. I
have not investigated whether the erase-buffer here can be removed: it
looks like it could be but the worst that this does is call
erase-buffer twice (slightly wasteful but no harm).
Best wishes
Mark
emacs/notmuch-show.el | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 4d6c014..20f8997 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -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
--
1.7.9.1
next prev parent reply other threads:[~2012-12-05 12:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Mark Walters [this message]
2012-12-05 15:59 ` [PATCH v2] " Austin Clements
2012-12-06 21:24 ` David Bremner
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=1354709509-22123-1-git-send-email-markwalters1009@gmail.com \
--to=markwalters1009@gmail.com \
--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).