diff options
author | Austin Clements <amdragon@MIT.EDU> | 2013-05-29 21:13:44 -0400 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2013-05-31 22:00:44 -0300 |
commit | 6bbb91f8b64c20a491cc3501b625753f97e52882 (patch) | |
tree | d8f7d0723f0e6e2a3fe377480224cee85c12c046 /emacs/notmuch-wash.el | |
parent | 195aaa623261cc877889a27bc4804a37593656a6 (diff) |
emacs: Retain text properties when toggling buttons
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.
Diffstat (limited to 'emacs/notmuch-wash.el')
-rw-r--r-- | emacs/notmuch-wash.el | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el index 8a68819c..8fe91e14 100644 --- a/emacs/notmuch-wash.el +++ b/emacs/notmuch-wash.el @@ -104,9 +104,11 @@ lower).") (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)) |