Subject: Re: bug#75305: 31.0.50; gnus-refer-thread-use-search isn't exact enough about how the current group is searched

From: Björn Bidar <[email-masked]>
Date: Mon, 03 Feb 2025 11:57:33 +0200

Andrew Cohen <[email-masked]> writes:

>>>>>> "EZ" == Eli Zaretskii <[email-masked]> writes:
>
>     EZ> Ping! Ping!  Andrew and Eric, any comments on the patch?
>
> Sorry for not responding earlier.  I remain swamped with other things.
>
> I think I understand what Bjorn wants, but I don't think the code is
> quite correct. Bjorn, can you try the following and let me know if it
> does what you want (these should apply but probably with some offset).

That look about right. What wasn't correct about the code?

> diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
> index 8aba3605f5b..b46ecf3b666 100644
> --- a/lisp/gnus/gnus-search.el
> +++ b/lisp/gnus/gnus-search.el
> @@ -2224,7 +2224,11 @@ gnus-search-thread
>                        (list (cons 'search-query-spec query)
>                              (cons 'search-group-spec
>                                    (if (listp gnus-refer-thread-use-search)
> -                                      gnus-refer-thread-use-search
> +                                      (mapcar (lambda (x)
> +                                                (if (eq 'current x)
> +                                                    (list server group)
> +                                                  x))
> +                                              gnus-refer-thread-use-search)
>                                      (list (list server))))))))
>          (if (< (nnselect-artlist-length thread) 2)
>              (message "No other articles in thread")
>
> diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el
> index 3cf720a8784..0b4dc384c19 100644
> --- a/lisp/gnus/nnselect.el
> +++ b/lisp/gnus/nnselect.el
> @@ -737,7 +761,10 @@ nnselect-request-thread
>                    (if (not gnus-refer-thread-use-search)
>                        (list (list server artgroup))
>                      (if (listp gnus-refer-thread-use-search)
> -                        gnus-refer-thread-use-search
> +                        (mapcar (lambda (x)
> +                                  (if (eq 'current x)
> +                                      (list server artgroup) x))
> +                                gnus-refer-thread-use-search)
>                        (list (list server)))))
>                   (ids (cons (mail-header-id header)
>                              (split-string