]> git.notmuchmail.org Git - notmuch/commitdiff
contrib: pick: close window function
authorMark Walters <markwalters1009@gmail.com>
Thu, 22 Aug 2013 17:10:23 +0000 (18:10 +0100)
committerDavid Bremner <bremner@debian.org>
Sat, 24 Aug 2013 09:18:01 +0000 (11:18 +0200)
contrib/notmuch-pick/notmuch-pick.el

index 3b1f85c13997333612b0f356c7c270eac2ae10ff..6d73269eb42782f3f197df3a227d825850491d4f 100644 (file)
@@ -208,6 +208,18 @@ This function does not give an error if there is no button."
   (let ((button (or button (button-at (point)))))
     (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
   (let ((map (make-sparse-keymap)))
     (define-key map [mouse-1] 'notmuch-pick-show-message)