aboutsummaryrefslogtreecommitdiffhomepage
path: root/contrib
diff options
context:
space:
mode:
authorGravatar Mark Walters <markwalters1009@gmail.com>2013-08-22 18:10:20 +0100
committerGravatar David Bremner <bremner@debian.org>2013-08-24 11:16:58 +0200
commit1c591115d676b3e8238f9bf4c6c7204cccd51f67 (patch)
tree2286f9f8ab6e05d2aa67251eb5b991da0f8d1f90 /contrib
parent5728d178f7c525a57e1430e6e069b88e05196db8 (diff)
contrib: pick: add in to-message-window function
Diffstat (limited to 'contrib')
-rw-r--r--contrib/notmuch-pick/notmuch-pick.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
index 89e6d4b7..9c1864b2 100644
--- a/contrib/notmuch-pick/notmuch-pick.el
+++ b/contrib/notmuch-pick/notmuch-pick.el
@@ -187,6 +187,19 @@ if the user has loaded a different buffer in that window.")
(make-variable-buffer-local 'notmuch-pick-message-buffer)
(put 'notmuch-pick-message-buffer 'permanent-local t)
+(defun notmuch-pick-to-message-pane (func)
+ "Execute FUNC in message pane.
+
+This function returns a function (so can be used as a keybinding)
+which executes function FUNC in the message pane if it is
+open (if the message pane is closed it does nothing)."
+ `(lambda ()
+ ,(concat "(In message pane) " (documentation func t))
+ (interactive)
+ (when (window-live-p notmuch-pick-message-window)
+ (with-selected-window notmuch-pick-message-window
+ (call-interactively #',func)))))
+
(defvar notmuch-pick-mode-map
(let ((map (make-sparse-keymap)))
(define-key map [mouse-1] 'notmuch-pick-show-message)