aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emacs/notmuch-wash.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index 8455eee..e8134bf 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -82,13 +82,14 @@ collapse the remaining lines into a button.")
(let* ((new-start (button-start cite-button))
(overlay (button-get cite-button 'overlay))
(button-label (notmuch-wash-button-label overlay))
+ (old-point (point))
(inhibit-read-only t))
- (save-excursion
- (goto-char new-start)
- (insert button-label)
- (let ((old-end (button-end cite-button)))
- (move-overlay cite-button new-start (point))
- (delete-region (point) old-end))))
+ (goto-char new-start)
+ (insert button-label)
+ (let ((old-end (button-end cite-button)))
+ (move-overlay cite-button new-start (point))
+ (delete-region (point) old-end))
+ (goto-char (min old-point (1- (button-end cite-button)))))
(force-window-update)
(redisplay t))