From: Mark Walters Date: Thu, 22 Aug 2013 17:10:20 +0000 (+0100) Subject: contrib: pick: add in to-message-window function X-Git-Tag: 0.17_rc1~185 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1c591115d676b3e8238f9bf4c6c7204cccd51f67;p=notmuch.git contrib: pick: add in to-message-window function --- 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)