From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/18904 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.gnus.user Subject: Re: nnir notmuch search on specific groups? Date: Tue, 23 Oct 2018 11:01:28 +0800 Message-ID: <87woq9e587.fsf@ericabrahamsen.net> References: <87a7n8s2np.fsf@hfph.mwn.de> <87o9bohsdw.fsf@ericabrahamsen.net> <87k1mbege2.fsf@tullinup.koldfront.dk> <87bm7ni6sy.fsf@ericabrahamsen.net> <87a7n79ojs.fsf@tullinup.koldfront.dk> <878t2rjde8.fsf@hfph.mwn.de> <87va5vhudu.fsf@hfph.mwn.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1540263695 12117 195.159.176.226 (23 Oct 2018 03:01:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 23 Oct 2018 03:01:35 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Tue Oct 23 05:01:31 2018 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gEmwk-000339-ID for gegu-info-gnus-english@m.gmane.org; Tue, 23 Oct 2018 05:01:30 +0200 Original-Received: from localhost ([::1]:37828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEmyq-0001YD-UL for gegu-info-gnus-english@m.gmane.org; Mon, 22 Oct 2018 23:03:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEmym-0001Y4-D0 for info-gnus-english@gnu.org; Mon, 22 Oct 2018 23:03:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEmyg-0003Di-Fp for info-gnus-english@gnu.org; Mon, 22 Oct 2018 23:03:35 -0400 Original-Received: from [195.159.176.226] (port=49006 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gEmye-00034y-Ef for info-gnus-english@gnu.org; Mon, 22 Oct 2018 23:03:29 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gEmwQ-0002gG-4r for info-gnus-english@gnu.org; Tue, 23 Oct 2018 05:01:10 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:BUk47GbK39SKwh1xHUs8V8aOdOo= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: "info-gnus-english" Xref: news.gmane.org gmane.emacs.gnus.user:18904 Archived-At: "Andreas Goesele" writes: > Eric Abrahamsen 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