Subject: Re: bug#21695: 25.0.50; Change most occurrences of `setq' in Emacs manual to `customize-set-variable'? Really?

From: Eli Zaretskii <[email-masked]>
Date: Mon, 13 Sep 2021 15:17:56 +0300

> Date: Mon, 13 Sep 2021 09:11:11 +0000
> From: Gregory Heytings <[email-masked]>
> Cc: [email-masked], [email-masked], [email-masked]
> 
> 
> >> +	if (!EQ (plist, Qnil) && !NILP (Fplist_get (plist, Qcustom_set)))
> >> +	  safe_call2 (Qdisplay_warning, Qsetq,
> >> +		      CALLN (Fformat,
> >> +			     build_string
> >> +			     ("`%s' should be set with `customize-set-variable'"),
> >> +			     sym));
> >
> > I haven't tried the patch, but won't this be triggered by the code 
> > that's handling the variables?  For instance, `latin1-display' has a 
> > :set, but the file itself does `(setq latin1-display t)' etc.  (This is 
> > a very common pattern.)
> >
> 
> No, (latin1-display 'latin-2) does not raise a warning with the patch, 
> because latin1-disp.el is bytecompiled, and Fsetq is not used when 
> bytecompiled code is executed (bytecompiled code only uses Fset).

So the warning will not be shown for byte-compiled code?  I think it
might be not a good idea, as many users byte-compile their init files.

> That being said, I would say that using (setq latin1-display t) when 
> latin1-display has a :set is always a bug, in the init file, 
> interactively, or in built-in code (bytecompiled or not), and that (set 
> 'latin1-display t) should be used instead.  WDYT?

I think forcing people to use 'set' instead is too much of a
punishment.