info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nnir notmuch search on specific groups?


From: Eric Abrahamsen
Subject: Re: nnir notmuch search on specific groups?
Date: Tue, 23 Oct 2018 11:01:28 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

"Andreas Goesele" <goesele@hfph.mwn.de> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>>> For subfolders it only would be necessary to replace the "." by a
>>> slash "/". So instead of searching "mail.subfolder" (as subfolders are
>>> shown in the group buffer) it should search "mail/subfolder".
>>
>> Well that's where I'm a little hesitant. I'm not really familiar with
>> how this path transformation stuff usually works, and don't want to
>>
>> I suppose we could add an option that's either nil (don't use groups and
>> paths at all), t (use untransformed paths), or a function that munges
>> the group names appropriately. Then it would just be a matter of finding
>> a reasonable default behavior.
>
> I think that would be a great solution, which could solve the backslash
> vs. forward slash problem!

Okay, I've reported this with a patch as bug#33122. The new option name
is called `nnir-notmuch-filter-group-names-function'.

In the end I decided a t value didn't make a lot of sense -- if users
want to pass the group names through unchanged (which is almost
certainly a bad idea), they can set the above option to #'identity.

By default (assuming this patch is accepted with no change), the
filtering *doesn't* do the transform you wanted. You can add your
desired behavior (the docstring mentions this) like so:

(add-function :filter-return nnir-notmuch-filter-group-names-function
  (lambda (g) (replace-regexp-in-string "\\." "/" g)))

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]