Previously, we lost any text properties applied to part buttons or
wash buttons when they were toggled because `insert' directly copies
the text properties of the string being inserted. Fix this by
capturing the properties applied to the button beforehand and
re-applying them after inserting the new text.
(new-start (button-start button))
(button-label (button-get button :base-label))
(old-point (point))
+ (properties (text-properties-at (point)))
(inhibit-read-only t))
(overlay-put overlay 'invisible (not show))
(goto-char new-start)
(insert "[ " button-label (if show " ]" " (hidden) ]"))
+ (set-text-properties new-start (point) properties)
(let ((old-end (button-end button)))
(move-overlay button new-start (point))
(delete-region (point) old-end))
(overlay (button-get cite-button 'overlay))
(button-label (notmuch-wash-button-label overlay))
(old-point (point))
+ (properties (text-properties-at (point)))
(inhibit-read-only t))
(goto-char new-start)
(insert button-label)
+ (set-text-properties new-start (point) properties)
(let ((old-end (button-end cite-button)))
(move-overlay cite-button new-start (point))
(delete-region (point) old-end))