X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=contrib%2Fnotmuch-pick%2Fnotmuch-pick.el;h=9c1864b2c115f7b7750ea2f9fcfb16195489017e;hp=89e6d4b7965d79d41f01ec21e52466ec62f3f954;hb=1c591115d676b3e8238f9bf4c6c7204cccd51f67;hpb=5728d178f7c525a57e1430e6e069b88e05196db8 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)