From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#66885: 29.1; gnus search with mu always returns empty Date: Sun, 31 Dec 2023 18:53:28 -0800 Message-ID: <87h6jxepcn.fsf@ericabrahamsen.net> References: <87sf5ppkx9.fsf@b3l.xyz> <877cn19t93.fsf@ericabrahamsen.net> <87jzr18e5z.fsf@b3l.xyz> <871qd89rft.fsf@ericabrahamsen.net> <878r7egb4v.fsf@uwaterloo.ca> <87il6i8lbc.fsf@ericabrahamsen.net> <87ttpymuib.fsf@b3l.xyz> <87msvq6x8n.fsf@ericabrahamsen.net> <87il65g1uz.fsf@uwaterloo.ca> <87y1eto7a4.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16986"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Britt Anderson , "66885@debbugs.gnu.org" <66885@debbugs.gnu.org> To: Britt Anderson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 01 03:54:24 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rK8Rc-0004D1-Bl for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jan 2024 03:54:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rK8RI-00058r-PL; Sun, 31 Dec 2023 21:54:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rK8RF-00058T-LJ for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2023 21:54:01 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rK8RF-0007X2-Bd for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2023 21:54:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rK8RG-0001i5-Fm for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2023 21:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Jan 2024 02:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66885 X-GNU-PR-Package: emacs Original-Received: via spool by 66885-submit@debbugs.gnu.org id=B66885.17040776216544 (code B ref 66885); Mon, 01 Jan 2024 02:54:02 +0000 Original-Received: (at 66885) by debbugs.gnu.org; 1 Jan 2024 02:53:41 +0000 Original-Received: from localhost ([127.0.0.1]:47227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rK8Qu-0001hT-GW for submit@debbugs.gnu.org; Sun, 31 Dec 2023 21:53:40 -0500 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]:58102) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rK8Qs-0001hG-8M for 66885@debbugs.gnu.org; Sun, 31 Dec 2023 21:53:39 -0500 Original-Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id E1347FA0D9; Mon, 1 Jan 2024 02:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1704077610; bh=B/OOKcCW1OhVmTwqicWuwsibMDhQQLNliDfBfXc0uII=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=IX6N3aX8yaWezaQMUp7IESJqYCwmsVf3dDMP8hveTFynobKCKM5xeGtpMdkrZyi+e 5J8wGC/KnEoI7g+VxXu1PV0ajW9zyvUoTluyddFH3FgqTVuywfr0kzarWvOAvvPClO 8vTUXnFaUPRn5uwrdMvXCos+e3a4gjSF3caeyh90= In-Reply-To: <87y1eto7a4.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sun, 19 Nov 2023 11:46:43 -0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277168 Archived-At: Eric Abrahamsen writes: > Britt Anderson writes: > >> Eric Abrahamsen 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"))))