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

From: Roland Winkler <[email-masked]>
Date: Sun, 20 Jul 2025 01:03:49 -0500

On Sat, Jul 19 2025, Eli Zaretskii wrote:
>> From: MAN ONE <[email-masked]>
>> CC: "[email-masked]" <[email-masked]>, Eli Zaretskii
>> 	<[email-masked]>, "[email-masked]" <[email-masked]>
>> Date: Wed, 9 Jul 2025 03:43:40 +0000
>> 
>> Perhaps this one is better?
>
> Roland?

I installed a patch, but I was surprised that it turned out rather
complicated.  Maybe I am missing something.

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.

Also, for bibtex-generate-url-list it makes sense to have a buffer-local
value, so that the setfunction (when called "by hand") should either set
the default or the buffer-local value of bibtex-font-lock-url-regexp.