contrib: pick: add in to-message-window function

This commit is contained in:
Mark Walters 2013-08-22 18:10:20 +01:00 committed by David Bremner
parent 5728d178f7
commit 1c591115d6

View file

@ -187,6 +187,19 @@ if the user has loaded a different buffer in that window.")
(make-variable-buffer-local 'notmuch-pick-message-buffer) (make-variable-buffer-local 'notmuch-pick-message-buffer)
(put 'notmuch-pick-message-buffer 'permanent-local t) (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 (defvar notmuch-pick-mode-map
(let ((map (make-sparse-keymap))) (let ((map (make-sparse-keymap)))
(define-key map [mouse-1] 'notmuch-pick-show-message) (define-key map [mouse-1] 'notmuch-pick-show-message)