Re: Duplicate tags in completion for notmuch-search-tag-all

Subject: Re: Duplicate tags in completion for notmuch-search-tag-all

Date: Thu, 04 Apr 2019 20:26:24 -0300

To: Sebastian Poeplau,


From: David Bremner

Sebastian Poeplau <> writes:

> I assume my problem arises from the combination of using
> `ivy-completing-read' as the `completing-read-function' and the list of
> candidates containing duplicates. Is there some sort of contract for
> `completing-read-function' requiring it to take care of duplicates? In
> that case, I guess it would be ivy's responsibility. Otherwise, do you
> see any problems with explicitly removing duplicates from the list of
> current tags in `notmuch-read-tag-changes'?

I noticed that completing-read can take a hash-table, so maybe
collecting tags as a hash-table in the first place would be an efficient
way to deduplicate them.  That would require more changes though, since
it would move the deduplication into the callers of notmuch-read-tag-changes.

I worry a bit about the movement of deduplication from the (brute
force) C code in minibuf.c into notmuch elisp, but I could be convinced,
e.g. with some profiling.

notmuch mailing list