unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47096: 28.0.50; gnus-search notmuch can't find files when using nnimap
@ 2021-03-12 10:49 Kevin Brubeck Unhammer
  2021-03-13 23:02 ` Eric Abrahamsen
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin Brubeck Unhammer @ 2021-03-12 10:49 UTC (permalink / raw)
  To: 47096

If I have a gnus backend for a local dovecot instance like

                          '(nnimap "mbsync"
                                         (nnimap-address "localhost")
                                         (gnus-search-engine notmuch
                                                             (config-file "/home/me/.notmuch-config")
                                                             (remove-prefix "/home/me/.Maildir/"))
                                         (nnimap-shell-program "MAIL=maildir:$HOME/.Maildir /usr/lib/dovecot/imap")
                                         (nnimap-stream shell))

then Gnus isn't able to translate the filenames returned from notmuch
(e.g. inbox/cur/1615384505.697011_1.laptop,U=5667)
into article numbers. It seems to look up using a function that assumes
you're using nnmaildir:

(if (string-match-p "\\`[[:digit:]]+\\'" article)
			(string-to-number article)
		      (nnmaildir-base-name-to-article-number
		       (substring article 0 (string-match ":" article))
		       group nil))

Here the string-match fails because the filename includes hostname and
U= parts, so we get sent to nnmaildir-base-name-to-article-number which
tries to look up current nnmaildir server which is nil and the end
result is that the computed article number is nil and we get no search
results.

I don't know what the correct way to do this is;
there's https://www.emacswiki.org/emacs/NotMuch#h5o-1 which goes via
message-id's, but maybe there's some better way.


In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)
 of 2020-12-03 built on laptop
Repository revision: cf448f6bcc7ab3f8ea03bcb8868a67cf0b39d412
Repository branch: feature/native-comp-erc-network-symbol-harfbug2
Windowing system distributor 'The X.Org Foundation', version 11.0.12009000
System Description: Ubuntu 20.04.2 LTS

Configured using:
 'configure --prefix=/home/me/PREFIX/emacs --with-libsystemd
 --with-pop=yes --with-sound=alsa --without-gconf --with-mailutils
 --with-json --with-cairo --with-nativecomp --with-x=yes
 --with-x-toolkit=lucid'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB
NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT
LIBOTF ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES NATIVE_COMP
THREADS LIBSYSTEMD JSON PDUMPER LCMS2

Important settings:
  value of $LANG: nn_NO.UTF-8
  locale-coding-system: utf-8






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#47096: 28.0.50; gnus-search notmuch can't find files when using nnimap
  2021-03-12 10:49 bug#47096: 28.0.50; gnus-search notmuch can't find files when using nnimap Kevin Brubeck Unhammer
@ 2021-03-13 23:02 ` Eric Abrahamsen
  2021-03-14  8:44   ` Kevin Brubeck Unhammer
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Abrahamsen @ 2021-03-13 23:02 UTC (permalink / raw)
  To: Kevin Brubeck Unhammer; +Cc: 47096

Kevin Brubeck Unhammer <unhammer@fsfe.org> writes:

> If I have a gnus backend for a local dovecot instance like
>
>                           '(nnimap "mbsync"
>                                          (nnimap-address "localhost")
>                                          (gnus-search-engine notmuch
>                                                              (config-file "/home/me/.notmuch-config")
>                                                              (remove-prefix "/home/me/.Maildir/"))
>                                          (nnimap-shell-program "MAIL=maildir:$HOME/.Maildir /usr/lib/dovecot/imap")
>                                          (nnimap-stream shell))
>
> then Gnus isn't able to translate the filenames returned from notmuch
> (e.g. inbox/cur/1615384505.697011_1.laptop,U=5667)
> into article numbers. It seems to look up using a function that assumes
> you're using nnmaildir:

Thanks for the report. Just to be clear, is this something that used to
work before gnus-search landed, and now doesn't? My understanding is
that this part of the code hasn't changed, and this wouldn't have ever
worked, but I'd very much like to know if that's not true.

Basically, there is an ugly bit of heuristics when looking at search
results, and guessing how to handle them. As you've noticed, if the file
name looks like a maildir message, the search code will assume there's
an nnmaildir server involved, and try to find it.

There should be a dedicated method in place to handle a single search
result, which is able to take both the server and the search engine into
account. I've been gnawing on what that might look like, but haven't
implemented it yet.

Eric





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#47096: 28.0.50; gnus-search notmuch can't find files when using nnimap
  2021-03-13 23:02 ` Eric Abrahamsen
@ 2021-03-14  8:44   ` Kevin Brubeck Unhammer
  2021-03-14 17:17     ` Eric Abrahamsen
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin Brubeck Unhammer @ 2021-03-14  8:44 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: 47096

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

Eric Abrahamsen <eric@ericabrahamsen.net> čálii:

> Just to be clear, is this something that used to
> work before gnus-search landed, and now doesn't? My understanding is
> that this part of the code hasn't changed, and this wouldn't have ever
> worked, but I'd very much like to know if that's not true.

I only just tried it now, so I don't know if it worked before.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#47096: 28.0.50; gnus-search notmuch can't find files when using nnimap
  2021-03-14  8:44   ` Kevin Brubeck Unhammer
@ 2021-03-14 17:17     ` Eric Abrahamsen
  2022-06-24 12:46       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Abrahamsen @ 2021-03-14 17:17 UTC (permalink / raw)
  To: Kevin Brubeck Unhammer; +Cc: 47096

Kevin Brubeck Unhammer <unhammer@fsfe.org> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> čálii:
>
>> Just to be clear, is this something that used to
>> work before gnus-search landed, and now doesn't? My understanding is
>> that this part of the code hasn't changed, and this wouldn't have ever
>> worked, but I'd very much like to know if that's not true.
>
> I only just tried it now, so I don't know if it worked before.

Okay, no, I don't think this is something that works, nor would it
without some effort. I think it might also just be faster to let your
imap server do the searching itself, if you turn full-text indexing on.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#47096: 28.0.50; gnus-search notmuch can't find files when using nnimap
  2021-03-14 17:17     ` Eric Abrahamsen
@ 2022-06-24 12:46       ` Lars Ingebrigtsen
  2022-06-24 17:16         ` Eric Abrahamsen
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-24 12:46 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: Kevin Brubeck Unhammer, 47096

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Okay, no, I don't think this is something that works, nor would it
> without some effort. I think it might also just be faster to let your
> imap server do the searching itself, if you turn full-text indexing on.

If I understand things correctly, this is something that we're not going
to implement?  So I'm closing this bug report; if I misunderstood,
please respond to the debbugs address and we'll reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#47096: 28.0.50; gnus-search notmuch can't find files when using nnimap
  2022-06-24 12:46       ` Lars Ingebrigtsen
@ 2022-06-24 17:16         ` Eric Abrahamsen
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Abrahamsen @ 2022-06-24 17:16 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Kevin Brubeck Unhammer, 47096

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Okay, no, I don't think this is something that works, nor would it
>> without some effort. I think it might also just be faster to let your
>> imap server do the searching itself, if you turn full-text indexing on.
>
> If I understand things correctly, this is something that we're not going
> to implement?  So I'm closing this bug report; if I misunderstood,
> please respond to the debbugs address and we'll reopen.

No, I don't think this is something we'd expect to implement. IMAP and
notmuch are just two separate systems.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-24 17:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12 10:49 bug#47096: 28.0.50; gnus-search notmuch can't find files when using nnimap Kevin Brubeck Unhammer
2021-03-13 23:02 ` Eric Abrahamsen
2021-03-14  8:44   ` Kevin Brubeck Unhammer
2021-03-14 17:17     ` Eric Abrahamsen
2022-06-24 12:46       ` Lars Ingebrigtsen
2022-06-24 17:16         ` Eric Abrahamsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).