Subject: Re: bug#78798: bibtex-font-lock-url-regexp should re-eval after setting bibtex-generate-url-list

From: Roland Winkler <[email-masked]>
Date: Sat, 26 Jul 2025 14:52:25 -0500

On Sun, Jul 20 2025, Eli Zaretskii wrote:
>> If the value of a user variable foo is used to initialize a helper
>> variable bar, then defcustom for foo can define a setfunction that will
>> set bar.  But this function must be defined before the defcustom.  But
>> this makes the compiler complain that the setfunction uses the undefined
>> var foo.  And if bar is declared after foo, this gives more warnings.
>
> The usual way of working around that is to have
>
>   (defvar foo)
>
> before defining the set-function.

Of cource, thanks!  I do not know why I did not remember this in the
context of actually defining / settting foo.  I changed the patch
accordingly.

> There's also another way: the set-function gets as its 1st argument
> the symbol of the variable, so it doesn't need to refer to the
> variable by its explicit name, it could do that via the symbol
> instead.

I want to keep set-function as simple as possible if this is something
users may want to call in their init file.  So I think your first
suggestions is better suited.