Link threads from Org.
(with-eval-after-load 'org (defun my-org-notmuch-search-store-link () "Store a link to a Notmuch thread." (interactive) (when (eq major-mode 'notmuch-search-mode) (org-store-link-props :type "notmuch" :link (concat "notmuch-search:" (notmuch-search-find-thread-id t)) :description (notmuch-search-find-subject)))))
(with-eval-after-load 'org (defun my-org-notmuch-search-follow-link (path) (notmuch-search (concat "thread:" path))))
(with-eval-after-load 'org (org-link-set-parameters "notmuch-search" :store #'my-org-notmuch-search-store-link :follow #'my-org-notmuch-search-follow-link))