From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11986 invoked from network); 18 Dec 2020 04:31:15 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 18 Dec 2020 04:31:15 -0000 Received: from lists1.math.uh.edu ([129.7.128.208]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kq7Q5-00BXne-UF for ml@inbox.vuxu.org; Thu, 17 Dec 2020 22:31:09 -0600 Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.94) (envelope-from ) id 1kq7Q5-000QYO-Bw for ml@inbox.vuxu.org; Thu, 17 Dec 2020 22:31:09 -0600 Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kq7Q4-000QYJ-Fy for ding@lists.math.uh.edu; Thu, 17 Dec 2020 22:31:08 -0600 Received: from quimby.gnus.org ([95.216.78.240]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kq7Pz-00BXnR-4n for ding@lists.math.uh.edu; Thu, 17 Dec 2020 22:31:08 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:Mime-Version:References:Message-ID:Date:Subject: From:To:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=wIIe6L0vMRROloZe7c9ybgHByL82TggN4+vHorcHW18=; b=X4lRQ5ZNssIzihqBv8LpQPxQTL XV8udw+aLcM/dfuepN+g4RwY4RIuryEDs4BrqJ/9krqCPvD2ugoKaorQ+TcayB80g0R8H8GIZFFqu mv7l9SII1806ANtx8LGOpkjtBfoVBlRQL7fAwdsI8RVaaQ1BaG8fXVkA20c5KFPafzI8=; Received: from ciao.gmane.io ([116.202.254.214]) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kq7Pq-0005UM-S1 for ding@gnus.org; Fri, 18 Dec 2020 05:30:58 +0100 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kq7Po-0005fV-MZ for ding@gnus.org; Fri, 18 Dec 2020 05:30:52 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: ding@gnus.org From: Eric Abrahamsen Subject: Re: New "gnus-search" syntax and interface Date: Thu, 17 Dec 2020 20:30:45 -0800 Message-ID: <87tusjhh1m.fsf@ericabrahamsen.net> References: <87blgdavsb.fsf@ericabrahamsen.net> <86eekrrpfd.fsf@disroot.org> <87wnyixu87.fsf@ericabrahamsen.net> <86o8jp7dnx.fsf@disroot.org> <87eekltkt2.fsf@ericabrahamsen.net> <86lfel9z1b.fsf@yoctocell.xyz> <87sg8rsbij.fsf@ericabrahamsen.net> <86r1ob1coa.fsf@yoctocell.xyz> <87blfesqfx.fsf@ericabrahamsen.net> <86o8jege72.fsf@yoctocell.xyz> <87eek9lzp0.fsf@ericabrahamsen.net> <86zh2wznfg.fsf@yoctocell.xyz> <87a6ulglyu.fsf@ericabrahamsen.net> <86a6ukkc9h.fsf@yoctocell.xyz> <86360a57rc.fsf@yoctocell.xyz> <86tusq3q6b.fsf@yoctocell.xyz> <874kkpejnl.fsf@ericabrahamsen.net> <86sg89s93w.fsf@yoctocell.xyz> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cancel-Lock: sha1:FzwONXGNDYVzxUrFyRLcs4UPggY= List-ID: Precedence: bulk yoctocell writes: > On 13 December 2020 08:49, Eric Abrahamsen wrote: > >> Ah, it's possible that some search engine caching I put in there is >> misbehaving. What are the types and labels of your two accounts? > I am not sure I understand what you mean by types and labels. Sorry, I meant the combination of the nnmaildir symbol, and the string "address" or label that comes after it in the server definition. But I see that your servers are uniquely labeled, so that was a red herring. Actually, I have a suspicion of what's going on here: the nils mean that nnmaildir code is unable to convert the maildir file names to article numbers, and I think it's unable to do that because it is getting confused about which nnmaildir backend is "current". Would you eval the following function, and let me know if it lets you search back and forth between backends without error? And just to really push our luck, would you try marking groups from both backends and searching them at the same time? Thanks, Eric (cl-defmethod gnus-search-indexed-parse-output ((engine gnus-search-indexed) server query &optional groups) (let ((prefix (slot-value engine 'remove-prefix)) (group-regexp (when groups (mapconcat (lambda (x) (replace-regexp-in-string ;; Accept any of [.\/] as path separators. "[.\\/]" "[.\\\\/]" (gnus-group-real-name x))) groups "\\|"))) artlist vectors article group) (goto-char (point-min)) (while (not (eobp)) (pcase-let ((`(,f-name ,score) (gnus-search-indexed-extract engine))) (when (and (file-readable-p f-name) (null (file-directory-p f-name)) (or (null groups) (and (gnus-search-single-p query) (alist-get 'thread query)) (string-match-p group-regexp f-name))) (push (list f-name score) artlist)))) ;; Are we running an additional grep query? (when-let ((grep-reg (alist-get 'grep query))) (setq artlist (gnus-search-grep-search engine artlist grep-reg))) ;; Prep prefix. (when (and prefix (null (string-empty-p prefix))) (setq prefix (file-name-as-directory (expand-file-name prefix)))) ;; Turn (file-name score) into [group article score]. (pcase-dolist (`(,f-name ,score) artlist) (setq article (file-name-nondirectory f-name) group (file-name-directory f-name)) ;; Remove prefix. (when prefix (setq group (string-remove-prefix prefix group))) ;; Break the directory name down until it's something that ;; (probably) can be used as a group name. (setq group (replace-regexp-in-string "[/\\]" "." (replace-regexp-in-string "/?\\(cur\\|new\\|tmp\\)?/\\'" "" (replace-regexp-in-string "^[./\\]" "" group nil t) nil t) nil t)) (push (vector (gnus-group-full-name group server) (if (string-match-p "\\`[[:digit:]]+\\'" article) (string-to-number article) (nnmaildir-base-name-to-article-number (substring article 0 (string-match ":" article)) group (string-remove-prefix "nnmaildir:" server))) (if (numberp score) score (string-to-number score))) vectors)) vectors))