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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15718 invoked from network); 5 Aug 2021 21:24:40 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 5 Aug 2021 21:24:40 -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.2) (envelope-from ) id 1mBkr0-009mzG-PB for ml@inbox.vuxu.org; Thu, 05 Aug 2021 16:24:38 -0500 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 1mBkr0-00DO11-88 for ml@inbox.vuxu.org; Thu, 05 Aug 2021 16:24:38 -0500 Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1mBkqx-00DO0t-Vt for ding@lists.math.uh.edu; Thu, 05 Aug 2021 16:24:36 -0500 Received: from quimby.gnus.org ([95.216.78.240]) by mx2.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1mBkqv-00HVMa-0G for ding@lists.math.uh.edu; Thu, 05 Aug 2021 16:24:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=d+OcOp59Z/kHUfkS8Avvsct7mUyaPn9YT7lheM6r+wg=; b=XJz6hJvk6oajaiQCk/fJrcFwA0 Tq432nanmJLLMx8iWiHINTXm3GenTPnM46LIQQpGCPOEM3JegXDBnt0QKxt6m+SBE8hJkNquf6gh1 O5a1LAUPpQlzxtT8BKTn92IH/p2czfBYdgv2xUKLFBOhJfjWL7ijQd7sOmJlDTiFO0CI=; Received: from mail.ericabrahamsen.net ([52.70.2.18]) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mBkqn-0001MQ-6Q for ding@gnus.org; Thu, 05 Aug 2021 23:24:27 +0200 Received: from localhost (c-71-197-184-122.hsd1.wa.comcast.net [71.197.184.122]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id B9CE6FA02D; Thu, 5 Aug 2021 21:24:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1628198662; bh=d+OcOp59Z/kHUfkS8Avvsct7mUyaPn9YT7lheM6r+wg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=NpA0iwSmzoviEEtvG1TwRR0iT9TAaac/cIsO+F/JupAqTI173JLc9COn1ROhAeRCR y0QWflYYHtyP7ua7480fmeyeoIYXW4+TNPVtvZSfM7RKFiLKjhvdY+1D/CmQMissQS 8hqoW0DMpRiVeFCQ+dqlCqcsxS7MFeBDAXMrry0M= From: Eric Abrahamsen To: Joseph Mingrone Cc: Alexandr Vityazev , ding@gnus.org Subject: Re: Help testing gnus-search fixups References: <87sg12uejj.fsf@ericabrahamsen.net> <87fsx1g98n.fsf@tullinup.koldfront.dk> <877didvavo.fsf@ericabrahamsen.net> <87eeclnhl5.fsf@tullinup.koldfront.dk> <87a6n9ov0e.fsf@tullinup.koldfront.dk> <87zgv97x1u.fsf@ku.dk> <87pmw4ly9a.fsf@tullinup.koldfront.dk> <87k0mclxo8.fsf@tullinup.koldfront.dk> <87zgv7thls.fsf@ericabrahamsen.net> <87bl6tuqcb.fsf@posteo.org> <87mtqd83f7.fsf@ericabrahamsen.net> <87bl6sual8.fsf@posteo.org> <87h7gj9x2w.fsf@ericabrahamsen.net> <87fsw21w3k.fsf@posteo.org> <86bl6j650f.fsf@phe.ftfl.ca> <87r1ffoatn.fsf@posteo.org> <87lf5ntupj.fsf@ericabrahamsen.net> <87pmur4xuk.fsf@ericabrahamsen.net> <87a6lvu0oo.fsf@posteo.org> <868s1fwsnk.fsf@phe.ftfl.ca> Date: Thu, 05 Aug 2021 14:24:20 -0700 In-Reply-To: <868s1fwsnk.fsf@phe.ftfl.ca> (Joseph Mingrone's message of "Thu, 05 Aug 2021 17:19:59 -0300") Message-ID: <8735rn60vv.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-ID: Precedence: bulk --=-=-= Content-Type: text/plain Joseph Mingrone writes: > On Thu, 2021-08-05 at 19:54, Alexandr Vityazev wrote: > >> On 2021-08-05, 10:15 -0700, Eric Abrahamsen wrote: > >>> Eric Abrahamsen writes: > > >>> [...] > >>>> I'm getting to it! I just need to find a moment to sit down and set up >>>> some dummy data and test the various possible configurations. It >>>> shouldn't be to hard to unilaterally force prefixed group names where >>>> that's needed, and force unprefixed names elsewhere, I just need to >>>> find the time. I'd like to get this fixed once and for all. > >>> Okay, I think I've finally got it. The incoming group names are indeed >>> prefixed or not depending on whether the server is primary or not >>> (arguably this should be fixed to always unprefixed in nnselect, but >>> I'll worry about that later), so this patch enforces unprefixed group >>> names within the function body, and prefixed group names in the return >>> value. Please give it a shot! > >>> Eric > > > >> The patch was applied to the master branch and it doesn't work for me. >> In my case because of line 1388 with the code: > >> #+begin_src elisp >> (setq group (gnus-group-full-name group server)) >> #+end_src > > >> code on 1395 line: > >> #+begin_src elisp >> (nnmaildir-base-name-to-article-number >> (substring article 0 (string-match ":" article)) >> group (string-remove-prefix "nnmaildir:" server)) >> #+end_src > > >> always return nil, because the group on line 1397 always gets something >> like "nnmaildir+gmail:Inbox" and not "Inbox". > >> And in the code on 1400 line: > >> #+begin_src elisp >> (member group groups) >> #+end_src > > >> also requires the group similar to "Inbox", so it can only be solved by >> deleting line 1388: > >> #+begin_src elisp >> (setq group (gnus-group-full-name group server)) >> #+end_src > > I see the same as you Alexandr, i.e., with the patch applied to a recent > commit from the master branch, still no search results, but after > removing line 1388, results are returned. Grr, sorry, I sent the wrong diff -- the original call to `gnus-group-full-name' was still in there. I promise I'm sending the correct, freshly-tested diff this time! --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=gnus-search-groups.diff diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 53af2f6fe6..8182630dfe 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1358,6 +1358,7 @@ gnus-search-indexed-parse-output server query &optional groups) (let ((prefix (or (slot-value engine 'remove-prefix) "")) + (groups (mapcar #'gnus-group-short-name groups)) artlist article group) (goto-char (point-min)) ;; Prep prefix, we want to at least be removing the root @@ -1384,7 +1385,6 @@ gnus-search-indexed-parse-output nil t) nil t) nil t)) - (setq group (gnus-group-full-name group server)) (setq article (file-name-nondirectory f-name) article ;; TODO: Provide a cleaner way of producing final @@ -1404,10 +1404,12 @@ gnus-search-indexed-parse-output (setq artlist (gnus-search-grep-search engine artlist grep-reg))) ;; Munge into the list of vectors expected by nnselect. (mapcar (pcase-lambda (`(,_ ,article ,group ,score)) - (vector group article - (if (numberp score) - score - (string-to-number score)))) + (vector + (gnus-group-full-name group server) + article + (if (numberp score) + score + (string-to-number score)))) artlist))) (cl-defmethod gnus-search-indexed-extract ((_engine gnus-search-indexed)) --=-=-=--