On Mon, Jun 09 2025, Christian Moe wrote:

> Kristoffer Balintona <krisbalint...@gmail.com> writes:
>
>> (N.B. Christian Moe elsewhere in this thread something that gave me
>> inspiration. As a notmuch user, I think it wouldn’t be too hard to add a
>> visual indicator on individual emails for whether there is a todo that
>> links to it. The same could be done for threads in thread views like
>> notmuch-search-mode. This way, as one browses their email they can be
>> reminded of the existence of todos that might become stale if they e.g.
>> archive the thread. This seems at first like a low-tech but effective
>> solution.[1])
> ...
>> [1] Although there is the problem of how long it would take to scrape
>>      one’s org-agenda files for todos associated for each email.
>
> 1--2 microseconds to process ~1000 email links in 15 agenda files on a
> hand-me-down laptop, according to benchmark. A little more when Org
> stores links setting ID properties.e I find that hard to believe, but in
> any case it's quite fast. Unsure what the best strategy would be for
> when to trigger updates, but it looks like it can be done fairly
> frequently. (Also looks like I should maybe clean up my agenda files a
> bit.)

Oh yeah, I guess normal regexps on the org files should be perfectly
fine (duh). My first thought was going through org’s element API and
whatnot, which is why I brought up performance.

> This is from some proof-of-concept code for mu4e, where I have a
> dedicated function to just scan the agenda files for a regular
> expression tailored for `mu4e:msgid:' links, storing entries in a hash
> table keyed to message-ids. It currently only supports backlinks to
> individual messages, not backlinks that query for a set of messages.
>
> I'll post some code soon.

Looking forward to it!

N.B. Notmuch has a search term for email threads and individual message
IDs, so it’s why I brought it up: querying individual messages is just
as easy as groups of messages. I don’t know mu4e so I don’t know what
the equivalent to that would be over there, if any.

-- 
Kind regards,
Kristoffer

Reply via email to