X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-wash.el;h=e8134bf77c5002d16b590ad00590c3d915006232;hp=8455eee0998f05e6e22bd2b81ee050cdcc29f698;hb=b6862c7eb9bfb00183e568b40d77ea25ade21db2;hpb=31b7c04ae1f239c463bc6dcb838acbe4d94c3e2e diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el index 8455eee0..e8134bf7 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))