From 1c591115d676b3e8238f9bf4c6c7204cccd51f67 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Thu, 22 Aug 2013 18:10:20 +0100 Subject: [PATCH] contrib: pick: add in to-message-window function --- contrib/notmuch-pick/notmuch-pick.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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) -- 2.43.0