Re: Eww can't searx (?)

[email protected] Wed, 13 May 2026 11:33:17 -0400
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
Michael Heerdegen via Users list for the GNU Emacs text
editor <[email protected]> writes:

> Michael Heerdegen <[email protected]> writes:
>
>> It seems that one of the most often recommended ways to search the
>> internet - using "Searx" (a metasearch engine) cannot be used with the
>> built-in browser of Emacs - EWW.
>
> Unfortunately it is not as easy as
>
>   (setq url-user-agent "Something Welcome")
>
> I tried a lot of things to tweak the request, like changing
> `url-http-attempt-keepalives' or the used encoding, nothing helped.  The
> only thing that (obviously) makes a difference is setting
> `eww-retrieve-command', which delegates the task to a browser that
> doesn't share the same problem.
>

Note that the docstring for ‘url-user-agent’ says that the
variable can be customized.  Since Emacs 29, the "rule" for
changing a variable whose docstring says that it can be
customized is to use ‘setopt’ instead of ‘setq’.  ‘setopt’
has the same syntax as ‘setq’, but ‘setopt’ is preferred
because, as its docstring says,

   "...‘setopt’ will execute any ‘custom-set’ form
    associated with VARIABLE.

    Note that ‘setopt’ will emit a warning if the type of a
    VALUE does not match the type of the corresponding
    VARIABLE as declared by ‘defcustom’.  (VARIABLE will be
    assigned the value even if it doesn’t match the type.)"

Alternatively, ‘url-user-agent’ can be changed using the
Easy Customization interface.

(Using ‘setopt’ likely will not help resolve the problem you
are seeing, however.)

-- 
The lyf so short, the craft so long to lerne.
- Geoffrey Chaucer, The Parliament of Birds.