unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Britt Anderson <britt@uwaterloo.ca>
Cc: Britt Anderson <britt@b3l.xyz>,
	"66885@debbugs.gnu.org" <66885@debbugs.gnu.org>
Subject: bug#66885: 29.1; gnus search with mu always returns empty
Date: Sun, 31 Dec 2023 18:53:28 -0800	[thread overview]
Message-ID: <87h6jxepcn.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87y1eto7a4.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sun, 19 Nov 2023 11:46:43 -0800")

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Britt Anderson <britt@uwaterloo.ca> writes:
>
>> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>>
>>> Your configuration looks correct (your configuration also reveals an
>>> annoying redundancy in gnus-search, which is that most nnmail
>>> backends have a "directory" value that can and should be used as the
>>> value of remove-prefix).
>>>
>>> Basically, if you're seeing "a maildir "y2023" that lives in archives"
>>> as a Gnus group, then this is just a bug in gnus-search's mu handling,
>>> plain and simple.
>>
>> I think the bug starts on line 1952 of gnus-search.el.gz (when opened in
>> emacs). It is in the definition of the method for
>
> (Thank you for continuing to bug-hunt, this looks promising, I've just
> gotten back from traveling and will set this up to test soon...)

Hi Britt, I'm finally getting around to testing this. I set up mu with a
local maildir, and so far I'm not able to reproduce the problem. I mark
two maildir groups and search for unread messages with "mark:unread".

The search arguments constructed by gnus-search look like:

("find" "--nocolor" "--muhome=/home/eric/.cache/mu" "" "" "flag:unread"
"and" "(" "maildir:/mails" "or" "maildir:/Welcome" ")" "--format=plain"
"--fields=l")

Putting that on the command line and running it gives 17 results, and I
see the same 17 results within the Gnus search buffer. With the search
engine's `remove-prefix` set to the full system file path up to the main
directory of the nnmaildir backend (under which the groups appear as
top-level directories) the results are shown correctly within Gnus.

The group handling code you noticed is necessary, the
`(concat "maildir:/" x)` code is mu-specific.

I'm not sure what else to try! Even if mu is returning results from
other Gnus backends, that shouldn't cause a failure. Though mu has the
"path:" key we can use with remove-prefix...

The last things to try would be: setting `gnus-verbose' to 10, trying
the search, and telling me what you find in *Message*, and...

eval'ing this version of the mu command method, that includes the
"path:" key. Does this fix the problem?

(cl-defmethod gnus-search-indexed-search-command ((engine gnus-search-mu)
						  (qstring string)
						  query &optional groups)
  (let ((limit (alist-get 'limit query))
	(thread (alist-get 'thread query)))
    (with-slots (switches config-directory remove-prefix) engine
      `("find" 			; command must come first
	"--nocolor"		; mu will always give colored output otherwise
	,(format "--muhome=%s" config-directory)
	,@switches
	,(if thread "-r" "")
	,(if limit (format "--maxnum=%d" limit) "")
	,qstring
	,@(if groups
	      `("and" "("
		,@(nbutlast (mapcan (lambda (x)
				      (list (concat "maildir:/" x) "or"))
				    groups))
		")")
	    "")
	,(format "path:%s" (file-name-as-directory
                    (expand-file-name remove-prefix "/")))
	"--format=plain"
	"--fields=l"))))





  reply	other threads:[~2024-01-01  2:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-01 15:01 bug#66885: 29.1; gnus search with mu always returns empty Britt Anderson
2023-11-01 19:19 ` Eric Abrahamsen
2023-11-01 19:28   ` Britt Anderson
2023-11-02 14:10     ` Eric Abrahamsen
2023-11-03 14:33       ` Britt Anderson
2023-11-03 23:32         ` Eric Abrahamsen
2023-11-06 21:33           ` Britt Anderson
2023-11-07  3:47             ` Eric Abrahamsen
2023-11-13 14:33               ` Britt Anderson
2023-11-19 19:46                 ` Eric Abrahamsen
2024-01-01  2:53                   ` Eric Abrahamsen [this message]
     [not found]                     ` <ZZgtJ8-cgJKEaE-D@joy>
2024-01-09 21:29                       ` Eric Abrahamsen

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=87h6jxepcn.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=66885@debbugs.gnu.org \
    --cc=britt@b3l.xyz \
    --cc=britt@uwaterloo.ca \
    /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.
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).