[notmuch] Bulk message tagging

Jesse Rosenthal jrosenthal at jhu.edu
Thu Apr 15 13:04:38 PDT 2010


On Wed, 14 Apr 2010 17:59:01 -0700, Carl Worth <cworth at cworth.org> wrote:
> We could fix all[*] the bugs of "*" by changing it to simply call the
> new region-based tagging function. The only concern I have with that is
> that it might be significantly slower, (it will execute N "notmuch tag"
> commands to tag the N threads in the current buffer, rather than just
> one "notmuch tag" command with the same search).

Not quite true: the region command only executes one "notmuch tag"
command over "id:X or id:Y or id:Z or ...". 

It does have to iterate over the messages to get the ids, and again to
set the tags (i.e., write them in the buffer), but that's all in the
buffer -- there's only one xapian command. 

And anything that updates the buffer in real time would have to iterate
through the messages to rewrite the tag representation, so I'm not sure
if there's that much being lost here.

That being said, there might be a bit of redundancy (one save-excursion
trip through the buffer to get the tags for completion, another to get
the ids, and one more to rewrite the parenthetical tag
representation). But I'm not quite sure how to avoid that, or how
expensive it actually is.

Best,
Jesse


More information about the notmuch mailing list