diff options
author | Austin Clements <amdragon@MIT.EDU> | 2013-06-03 11:17:59 -0400 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2013-06-04 08:39:42 -0300 |
commit | 109a0355d681b82715cf6fd6ca051c6b5b2c6714 (patch) | |
tree | 44a6f8f545d2635cef7a0e81e1b81b873f1e7f71 /emacs/notmuch-show.el | |
parent | 5306b2b1e598e944a7e08cb9df8356acfb162f09 (diff) |
emacs: Fix applying stickiness to the :notmuch-part property
Previously, we simply called pushnew to add :notmuch-part to the
front-sticky and rear-nonsticky text property lists. This works if
these are nil or lists, but they can also have the value t, meaning
that all properties are front-sticky/rear-nonsticky. In this case,
pushnew will signal an error because t is not a list. We never set
these properties to t ourselves, but since we apply these property
changes over arbitrary renderer output, we have to deal with this
possibility.
Diffstat (limited to 'emacs/notmuch-show.el')
-rw-r--r-- | emacs/notmuch-show.el | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 57719506..83bb9ad5 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -846,11 +846,18 @@ If HIDE is non-nil then initially hide this part." (notmuch-map-text-property beg (point) :notmuch-part (lambda (v) (or v part))) ;; Make :notmuch-part front sticky and rear non-sticky so it stays - ;; applied to the beginning of each line when we indent the message. + ;; applied to the beginning of each line when we indent the + ;; message. Since we're operating on arbitrary renderer output, + ;; watch out for sticky specs of t, which means all properties are + ;; front-sticky/rear-nonsticky. (notmuch-map-text-property beg (point) 'front-sticky - (lambda (v) (pushnew :notmuch-part v))) + (lambda (v) (if (listp v) + (pushnew :notmuch-part v) + v))) (notmuch-map-text-property beg (point) 'rear-nonsticky - (lambda (v) (pushnew :notmuch-part v))))) + (lambda (v) (if (listp v) + (pushnew :notmuch-part v) + v))))) (defun notmuch-show-insert-body (msg body depth) "Insert the body BODY at depth DEPTH in the current thread." |