Notmuch is an email system enjoying an advanced integration with Emacs. It is based on assigning arbitrary number of tags to particular emails. The tags and full-text search can then be used for defining various search queries. Notmuch can handle thousands and thousands of emails thanks to the underlying Xapian database.

When showing search results in Emacs, color of the whole line and particular tags can be configured based on their values. Tags can be colored or their content overridden by notmuch-tag-formats:

(setq notmuch-tag-formats
      '(("lists\\(\/.*\\)?" ()) ;; hide lists/* tags
        ("pr" (propertize tag 'face '(:foreground "magenta" :weight bold)))
        ("issue" (propertize tag 'face '(:foreground "aquamarine" :weight bold)))
        ("bitcoin" (propertize tag 'face '(:foreground "#f7931a" :weight bold)))
        ("rust" (propertize tag 'face 'notmuch-tag-face) "🦀")
        ("ln" (propertize tag 'face 'notmuch-tag-face) "⚡")))

This configuration renders (green is the default):

Lines can be colored by notmuch-search-line-faces, for example:

(setq notmuch-search-line-faces
        '(("unread" . notmuch-search-unread-face)
          ("lists/bitcoin" :foreground "#ffbd71")
          ("bdk" :foreground "#b591de")
          ("rust-bitcoin" :foreground "#b591de")
          ("ops" :foreground "#ff00ff")
          ("bitcoin" :foreground "#f7931a")
          ("closed" :strike-through t)
          ("merged" :strike-through t)))

Applying this settings results in:

Unfortunately, the line face is applied to the entire line, overriding coloring of tags. In order to have both tag formats and line faces applied independently, the rendering function notmuch-search-show-result has to be overridden:

(defun jj-notmuch-search-show-result (result pos)
  "Insert RESULT at POS."
  ;; Ignore excluded matches
  (unless (= (plist-get result :matched) 0)
    (save-excursion
      (goto-char pos)
      (let (before-tags)
        (dolist (spec notmuch-search-result-format)
          (when (equal (car spec) "tags") (setq before-tags (point)))
          (notmuch-search-insert-field (car spec) (cdr spec) result))
        (notmuch-search-color-line pos
                                   (or before-tags (point))
                                   (plist-get result :tags)))
      (insert "\n")
      (put-text-property pos (point) 'notmuch-search-result result))))

(advice-add 'notmuch-search-show-result :override #'jj-notmuch-search-show-result)

The result: