> (defun inwit/notmuch-search-authors-or-to (format-string result)
>   (let* ((headers (plist-get result :headers))
>          (to (plist-get headers :To))
>          (author (plist-get headers :From)))
>    (format format-string
>         (if (string-match "inwit" author)
>         (concat "To: " (notmuch-tree-clean-address to))
>                       author))))
> Any help would be greatly appreciated.

Your problem is that the result argument has this sort of form:

(:thread "00000000000029c5"
 :timestamp 1658007025
 :date_relative "Sat. 22:30"
 :matched 3
 :total 5
 :authors "David Bremner, Jon Hurst| inwit"
 :subject "Feature request: show destination in tree view when
 appropriate"
 :query ("id:[email protected] id:[email protected]
         id:[email protected]" "id:[email protected]
         id:CLJIU9081RIS.3M4YBKDJ2UJ3O@bisio")
 :tags ("inbox" "replied")
 :orig-tags ("inbox" "replied"))

So there is no :headers and :authors has multiple entries. I guess what
you are looking for is that if the only author is yourself, replace the
author with the "To: ..." version, in which case you would have to use
the :query section to find that.
_______________________________________________
notmuch mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to