diff options
author | Mark Walters <markwalters1009@gmail.com> | 2013-08-22 18:10:16 +0100 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2013-08-24 11:15:23 +0200 |
commit | 1716edff9d18baf1f2eb7cff1c62d373592a967c (patch) | |
tree | 4d2203ae85e23d81b29539ce6bfd7b6d0ff8c4b7 /contrib | |
parent | 8c6b2e7e9d30bb3a9ef4fd8632cbf6d8d0673bb7 (diff) |
contrib: pick: override notmuch-show-get-prop
We override notmuch-show-get-prop so that many of the show functions
can be used in notmuch-pick without modification. The main use is that
it means notmuch-show-get-message-id `works' in pick. Thus we get all
the stash functions and several other `for free' in pick.
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/notmuch-pick/notmuch-pick.el | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index 7f5f729a..04e37ee5 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -238,6 +238,22 @@ Some useful entries are: (beginning-of-line) (get-text-property (point) :notmuch-message-properties))) +;; XXX This should really be a lib function but we are trying to +;; reduce impact on the code base. +(defun notmuch-show-get-prop (prop &optional props) + "This is a pick overridden version of notmuch-show-get-prop + +It gets property PROP from PROPS or, if PROPS is nil, the current +message in either pick or show. This means that several functions +in notmuch-show now work unchanged in pick as they just need the +correct message properties." + (let ((props (or props + (cond ((eq major-mode 'notmuch-show-mode) + (notmuch-show-get-message-properties)) + ((eq major-mode 'notmuch-pick-mode) + (notmuch-pick-get-message-properties)))))) + (plist-get props prop))) + (defun notmuch-pick-set-message-properties (props) (save-excursion (beginning-of-line) |