unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Alexis Praga <alexis.praga@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Gnus and notmuch
Date: Thu, 10 Jun 2021 14:05:43 -0700	[thread overview]
Message-ID: <875yylsa54.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <86zgvxwnit.fsf@mailoo.org> (Alexis Praga's message of "Thu, 10 Jun 2021 21:03:06 +0200")

[-- Attachment #1: Type: text/plain, Size: 2255 bytes --]

Alexis Praga <alexis.praga@gmail.com> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>> Well, one problem at a time :)
>>
>> While it should be possible to use a single notmuch installation to
>> search two nnmaildir servers, as you're doing, it's also possible that
>> this is the source of the problem. Could you also show me your
>> ~/.notmuch-config?
>>
>> These two lines are the source of the problem: gnus-search was able to
>> find the article numbers from search hits in the "archive" group, but
>> was not able to turn search hits in the "home.alex.mail.free.archive"
>> group into article numbers. Usually this means it wasn't actually able
>> to locate the files on disk, which usually means there's a mismatch with
>> the 'remove-prefix setting.
>>
>> From the traceback, it looks like you were only searching the
>> nnmaildir+gmail:archive group. Do you have any idea why you were getting
>> results from home.alex.mail.free.archive?
> I don'tt really know why it is searching for the other maildir. That's
> why I have been restarting emacs and removing ~/.newrrc.el*, hoping it
> would resolve some conflict with my previous attempts.

I think see the problem, it's yet more fragility in parsing the output
of search results.

Notmuch is returning all results in all directories, and Gnus filters
out the results it wants depending on which paths match the group name.
Because "archive" is a substring of "home.alex.mail.free.archive", it
thinks it's a relevant search result.

I guess I'm not entirely sure why it fails to find the articles from
that group -- I would expect the articles from the other group to be
located correctly -- but this is probably still the source of the
problem.

This stuff is so fragile that I dread to think of what else might break
with this change, but... If you're comfortable patching and
re-evaluating, would you please apply the attached, then re-evaluate the
`gnus-search-indexed-parse-output' method, and see if that fixes the
problem?

Another proper solution (in addition to this) would be to figure out how
to pass the groups parameter to notmuch in either its folder: or path:
key. That would avoid duplicate work, and presumably run faster. I'll
put this on the todo list.

Eric



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-search-groups.diff --]
[-- Type: text/x-patch, Size: 971 bytes --]

diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index fc9f8684f6..71a65ab95d 100644
--- a/lisp/gnus/gnus-search.el
+++ b/lisp/gnus/gnus-search.el
@@ -1347,15 +1347,18 @@ gnus-search-indexed-parse-output
 						server query &optional groups)
   (let ((prefix (slot-value engine 'remove-prefix))
 	(group-regexp (when groups
-			(mapconcat
-			 (lambda (group-name)
-			   (mapconcat #'regexp-quote
-				      (split-string
-				       (gnus-group-real-name group-name)
-				       "[.\\/]")
-				      "[.\\\\/]"))
-			 groups
-			 "\\|")))
+                        (concat
+                         "\\`"
+			 (mapconcat
+			  (lambda (group-name)
+			    (mapconcat #'regexp-quote
+				       (split-string
+				        (gnus-group-real-name group-name)
+				        "[.\\/]")
+				       "[.\\\\/]"))
+			  groups
+			  "\\|")
+                         "\\'")))
 	artlist vectors article group)
     (goto-char (point-min))
     (while (not (or (eobp)

  reply	other threads:[~2021-06-10 21:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10  8:35 Gnus and notmuch Alexis Praga
2021-06-10 16:21 ` Eric Abrahamsen
     [not found]   ` <865yyly6bn.fsf@mailoo.org>
     [not found]     ` <87fsxpsgpk.fsf@ericabrahamsen.net>
2021-06-10 19:03       ` Alexis Praga
2021-06-10 21:05         ` Eric Abrahamsen [this message]
2021-06-10 21:09           ` Eric Abrahamsen
2021-06-11  8:05             ` Alexis Praga
2021-06-11 16:06               ` Eric Abrahamsen
2021-06-11 16:01 ` Alexandr Vityazev
2021-06-11 18:00   ` Alexis Praga
2021-06-11 18:06     ` Eric Abrahamsen
2021-06-12 14:45       ` Alexis Praga
2021-06-12 16:50         ` Alexandr Vityazev
2021-06-14  7:14           ` Alexis Praga

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=875yylsa54.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=alexis.praga@gmail.com \
    --cc=help-gnu-emacs@gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).