notmuch-search-get-tags unique candidates

classic Classic list List threaded Threaded
2 messages Options
Nicolò Balzarotti Nicolò Balzarotti
Reply | Threaded
Open this post in threaded view
|

notmuch-search-get-tags unique candidates

Hi, I'm using notmuch with emacs and I'm loving it. One thing I don't
like is that in `notmuch-search`, when applying a tag to a selection the
tab completition return multiple copies of the same tag. Example:

> -inbox
> -lists/aaa
> -lists
> -inbox
> -lists/aaa
> -lists

I changed `notmuch-search-get-tags-region` to:
```(defun notmuch-search-get-tags-region (beg end)
  (let (output)
    (notmuch-search-foreach-result beg end
      (lambda (pos)
        (setq output (append output (notmuch-search-get-tags pos)))))
    (delete-dups output)));; add delete-dups before returning
    ```

Why is the current one the default behavior?

Thanks, Nicolò
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Jani Nikula Jani Nikula
Reply | Threaded
Open this post in threaded view
|

Re: notmuch-search-get-tags unique candidates

On Wed, Mar 21, 2018 at 11:21 PM, Nicolò Balzarotti
<[hidden email]> wrote:

> Hi, I'm using notmuch with emacs and I'm loving it. One thing I don't
> like is that in `notmuch-search`, when applying a tag to a selection the
> tab completition return multiple copies of the same tag. Example:
>
>> -inbox
>> -lists/aaa
>> -lists
>> -inbox
>> -lists/aaa
>> -lists
>
> I changed `notmuch-search-get-tags-region` to:
> ```(defun notmuch-search-get-tags-region (beg end)
>   (let (output)
>     (notmuch-search-foreach-result beg end
>       (lambda (pos)
>         (setq output (append output (notmuch-search-get-tags pos)))))
>     (delete-dups output)));; add delete-dups before returning
>     ```
>
> Why is the current one the default behavior?

FWIW, I can't reproduce the behaviour you describe.

BR,
Jani.
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch