contrib: pick: close window function

This commit is contained in:
Mark Walters 2013-08-22 18:10:23 +01:00 committed by David Bremner
parent d3924d5798
commit d3ef0f74cf

View file

@ -208,6 +208,18 @@ This function does not give an error if there is no button."
(let ((button (or button (button-at (point))))) (let ((button (or button (button-at (point)))))
(when button (button-activate button)))) (when button (button-activate button))))
(defun notmuch-pick-close-message-pane-and (func)
"Close message pane and execute FUNC.
This function returns a function (so can be used as a keybinding)
which closes the message pane if open and then executes function
FUNC."
`(lambda ()
,(concat "(Close message pane and) " (documentation func t))
(interactive)
(notmuch-pick-close-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)