Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Joseph Mingrone <jrm@ftfl.ca>
Cc: Alexandr Vityazev <avityazev@posteo.org>,  ding@gnus.org
Subject: Re: Help testing gnus-search fixups
Date: Thu, 05 Aug 2021 14:24:20 -0700	[thread overview]
Message-ID: <8735rn60vv.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <868s1fwsnk.fsf@phe.ftfl.ca> (Joseph Mingrone's message of "Thu, 05 Aug 2021 17:19:59 -0300")

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

Joseph Mingrone <jrm@ftfl.ca> writes:

> On Thu, 2021-08-05 at 19:54, Alexandr Vityazev <avityazev@posteo.org> wrote:
>
>> On 2021-08-05, 10:15 -0700, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
>
>>> Eric Abrahamsen <eric@ericabrahamsen.net> 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!


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-search-groups.diff --]
[-- Type: text/x-patch, Size: 1501 bytes --]

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

  reply	other threads:[~2021-08-05 21:24 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 16:42 Eric Abrahamsen
2021-06-28 18:00 ` Adam Sjøgren
2021-06-28 23:15   ` Eric Abrahamsen
2021-06-29  6:04     ` Thomas Alexander Gerds
2021-06-29  9:30     ` Adam Sjøgren
2021-06-29  9:55       ` Adam Sjøgren
2021-06-29 11:03         ` Thomas Alexander Gerds
2021-06-29 11:13           ` Adam Sjøgren
2021-06-29 11:25             ` Adam Sjøgren
2021-06-30 16:58               ` Eric Abrahamsen
     [not found]                 ` <87bl6tuqcb.fsf@posteo.org>
2021-07-23 15:18                   ` Eric Abrahamsen
     [not found]                     ` <87bl6sual8.fsf@posteo.org>
2021-07-24 22:16                       ` Eric Abrahamsen
2021-07-25 11:17                         ` Alexandr Vityazev
2021-07-25 22:11                           ` Eric Abrahamsen
2021-07-30 18:17                           ` Joseph Mingrone
2021-07-30 18:22                             ` Joseph Mingrone
2021-07-30 18:47                               ` Eric Abrahamsen
2021-07-30 19:29                                 ` Joseph Mingrone
2021-07-30 20:23                                   ` Eric Abrahamsen
2021-07-30 19:34                             ` Alexandr Vityazev
2021-07-30 20:25                               ` Eric Abrahamsen
2021-08-05 17:15                                 ` Eric Abrahamsen
2021-08-05 19:54                                   ` Alexandr Vityazev
2021-08-05 20:19                                     ` Joseph Mingrone
2021-08-05 21:24                                       ` Eric Abrahamsen [this message]
2021-08-05 21:38                                         ` Joseph Mingrone
2021-08-07 16:07                                           ` Eric Abrahamsen
2021-08-10  7:32                                             ` Daniel Jensen
2021-08-13 16:50                                               ` Eric Abrahamsen
2021-08-13 19:30                                                 ` Daniel Jensen
2021-08-13 19:37                                                   ` Eric Abrahamsen
2021-06-29 11:27 ` Eric S Fraga
2021-09-11 13:29 Sergey Makarov
2021-09-11 15:04 ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735rn60vv.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=avityazev@posteo.org \
    --cc=ding@gnus.org \
    --cc=jrm@ftfl.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.
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 NNTP newsgroup(s).