Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: ding@gnus.org
Subject: Re: emacs 28 search not working with nnml
Date: Thu, 24 Jun 2021 08:21:31 -0700	[thread overview]
Message-ID: <87v9631e6c.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87h7hn3jf6.fsf@ku.dk>

Thomas Alexander Gerds <grb615@ku.dk> writes:

> Eric(1): thank you so much, this helped and solved my problem!
> Eric(2): you are right: the hack is not needed and my search functions work
>          smoothly without it. not sure what remaining bug there might
>          be,

The remaining bug is subtler: if you search a group whose name is a
substring of a different group, the code will also attempt to return
results from that other group, which will fail.

> but you may want to consider to change the default value here for
> people like me who use "mail" instead of "Mail":

Wait, which default value are you referring to here? `gnus-directory'?

> (defcustom gnus-search-notmuch-remove-prefix gnus-directory
>   "The prefix to remove from each file name returned by notmuch
> in order to get a group name (albeit with / instead of .).  This is a
> regular expression.
>
> This variable can also be set per-server."
>   :type 'regexp
>   :version "28.1")
>
> cheers Thomas
>
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>>
>>> On Wednesday, 23 Jun 2021 at 14:54, Thomas Alexander Gerds wrote:
>>>> I am using nnml and have all my email downloaded to my laptop using
>>>
>>> I have a similar configuration.  My settings look like this:
>>>
>>> #+begin_src emacs-lisp
>>>   (setq gnus-secondary-select-methods
>>>         '((nnml "work"
>>>                 (gnus-search-engine gnus-search-notmuch
>>>                                     (remove-prefix "/HOME/Mail")
>>>                                     (config-file "/HOME/.notmuch-config")
>>>                                     )
>>>                 (get-new-mail t))))
>>>
>>>   (add-to-list 'gnus-search-default-engines '(nnml . notmuch))
>>>   (setq gnus-search-notmuch-remove-prefix "/HOME/Mail")
>>>   (with-eval-after-load "gnus-search"
>>>     (cl-defmethod gnus-search-indexed-parse-output :around
>>>       ((e gnus-search-notmuch) s q groups)
>>>       (let ((gs (mapcar (lambda (g) (replace-regexp-in-string "\\." "/" g))
>>>                         groups)))
>>>         (cl-call-next-method e s q gs))))
>>> #+end_src
>>>
>>> where HOME in various places above should be replaced by your home
>>> directory.  I have gnus splitting email into various sub-directories of
>>> Mail/.
>>>
>>> The last bit was suggested by Jose A. Ortega Ruiz on the gnus newsgroup
>>> [1] sometime in late 2020 and proved to be necessary (at that time) to
>>> get the new search engine to work with nnml.  It basically changes the
>>> file paths from . to / separators.
>>
>> FWIW, this hack isn't necessary any more, if you're running a recent
>> Emacs from master (looks like since early February of this year).
>>
>> Thomas, the bug you're seeing is something I'm aware of, I just haven't
>> come up with a great solution for it yet (actually I'd forgotten about
>> it). I'll get that fixed soon, and report back here.
>>
>> Eric
>>
>>
>>
>>



  reply	other threads:[~2021-06-24 15:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-23 12:54 Thomas Alexander Gerds
2021-06-23 13:51 ` Eric S Fraga
2021-06-23 15:01   ` Eric Abrahamsen
2021-06-24  5:45     ` Thomas Alexander Gerds
2021-06-24 15:21       ` Eric Abrahamsen [this message]
2021-06-24 19:15         ` Thomas Alexander Gerds
2021-06-26  3:48           ` Eric Abrahamsen
2021-06-24 10:01     ` Eric S Fraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v9631e6c.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).