Subject: Re: bug#46047: 28.0.50; Namazu-based mail searching not working anymore

From: Eric Abrahamsen <[email-masked]>
Date: Sun, 07 Feb 2021 14:02:42 -0800

Torsten Bronger <[email-masked]> writes:

> Hallöchen!
>
> Eric Abrahamsen writes:
>
>> Eric Abrahamsen <[email-masked]> writes:
>>
>>> Torsten Bronger <[email-masked]> writes:
>>>
>>>> Hallöchen!
>>>>
>>>> [...]
>>>>
>>>> Franky, I don’t understand all this really.  I'm driving
>>>> blindfolded a bit.  Anyway, I put
>>>>
>>>> (setq gnus-secondary-select-methods
>>>>       '((nnml "" (nnir-search-engine namazu
>>>>                                      (nnir-namazu-index-directory "/var/lib/namazu/")))))
>>>> (setq gnus-search-namazu-index-directory "/var/lib/namazu/")
>>>>
>>>> in my .gnus.
>>>
>>> Sorry if I wasn't clear -- I *can* provide backwards-compatible
>>> code to handle the above, but I haven't yet. If you don't care
>>> about downgrading Emacs, I would use the above, but take off the
>>> "nnir-namazu-" prefix, ie just:
>>>
>>> (index-directory "/var/lib/namazu/")
>
> This has no effect on how Namazu is called on my machine.  Only
> gnus-search-namazu-index-directory set the directory parameter of
> the Namazu call correctly.
>
>> [...]
>
> I have now
>
> (setq gnus-secondary-select-methods
>       '((nnml "" (nnir-search-engine namazu))))
> (setq gnus-search-namazu-index-directory "/var/lib/namazu/")

Yes, the bare 'index-directory and 'remove-prefix configuration keys will only be
honored if you're using the 'gnus-search-engine config, not the
'nnir-search-engine config. I thought about picking up mixed config, but
it's just going to turn into too much of a mess. So your completely
correct, should-work-every-time config would look like:

(setq gnus-secondary-select-methods
      '((nnml "" (gnus-search-engine
		  gnus-search-namazu
		  remove-prefix "/home/bronger/Mail"
		  index-directory "/var/lib/namazu/"))))

> in my.gnus, and with current Git Emacs, Namazu is correctly called!
> But it only works if no search results are found.  Otherwise,
> *Messages* contains:
>
> nnselect-run: gnus-search-run-query on ((search-query-spec (query .
> myquerystring) (raw)) (search-group-spec (nnml: nnml:Somegroup))) gave
> error (wrong-type-argument stringp nil)
> Group nnselect:nnselect-877do1l461.fsf contains no messages
>
> I have attached a shell script that you can use as a drop-in
> replacement for namazu proper for easy generation of search results
> that trigger this error for me.

Thanks for providing this. There was a bug in the parsing of namazu
output that should now be fixed. Please let me know if you can confirm!

Thanks,
Eric