+(defun notmuch-pick-message-window-kill-hook ()
+ (let ((buffer (current-buffer)))
+ (when (and (window-live-p notmuch-pick-message-window)
+ (eq (window-buffer notmuch-pick-message-window) buffer))
+ ;; We do not want an error if this is the sole window in the
+ ;; frame and I do not know how to test for that in emacs pre
+ ;; 24. Hence we just ignore-errors.
+ (ignore-errors
+ (delete-window notmuch-pick-message-window)))))
+