Subject: bug#49507: 28.0.50; macOS: Symbol’s value as variable is void: lock-file-name-transforms

From: Eli Zaretskii <[email-masked]>
Date: Sun, 11 Jul 2021 15:28:59 +0300

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: Naofumi Yasufuku <[email-masked]>,  [email-masked]
> Date: Sun, 11 Jul 2021 13:52:24 +0200
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > Lars, why did you use this :initialize tag here?
> 
> I was just cargo-culting from the defcustom of
> auto-save-file-name-transforms above.

The initial value of auto-save-file-name-transforms uses
temporary-file-directory, so it's reasonable to delay its
initialization until Emacs starts up, as opposed to initializing it
when Emacs is dumped (which could be on a different system).  But
lock-file-name-transforms's initial value is a constant, so we can
safely initialize it at dump time.

So I think we should simply remove the :initialize tag from that
variable.

However, given this incident, I'm worried that others could trip on
this subtlety.  So I wonder whether we should describe it in the ELisp
manual.  I think we should generally advise against using this tag for
defcustom's that might affect the startup code itself.  For 100%
safety, one should probably use it only with variables defined in C.
Stefan, do you agree?