- (if (eq (plist-get saved-search :search-type) 'tree)
- `(lambda () (notmuch-tree ',query))
- `(lambda () (notmuch-search ',query ',oldest-first))))
+ (cond
+ ((eq (plist-get saved-search :search-type) 'tree)
+ `(lambda () (notmuch-tree ',query)))
+ ((eq (plist-get saved-search :search-type) 'unthreaded)
+ `(lambda () (notmuch-unthreaded ',query)))
+ (t
+ `(lambda () (notmuch-search ',query ',oldest-first)))))