emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: FW: [External] : Re: Propose to add setup-wizard.el to ELPA


From: Drew Adams
Subject: RE: FW: [External] : Re: Propose to add setup-wizard.el to ELPA
Date: Sun, 2 Jan 2022 21:29:57 +0000

> >> Using customize-set-variable from Elisp is simply a hack, IIRC
> >> it has weird unwanted effects like when saving customizations
> >> from interface, it writes everything back into managed
> >> custom-set-variables.
> >
> > What you say there isn't too clear, to me.
> > `customize-set-variable' doesn't save...
> > Just what is the problem of saving option
> > and face settings to a particular place?
> >
> > Code written by code (when you say "save")
> > should be kept in its own place - separate
> > from code that users twiddle manually.
> > That's the purpose of variable `custom-file'.
> 
> When I used customize-set-variable to set some options,
> inside init.el, instead of setq, then used the interface to set
> some other options, and used the button saying "save for future
> sessions," not only options I set in the interface, but also the
> ones set before from init.el got written into the
> (custom-set-variables) form, effectively causing them to get
> duplicated and evaluated twice on the next start of Emacs.

Of course.  That's one reason I say that Customize
should not write to your init file.  That's the
problem behind your problem.  That's a bad Emacs
design choice, IMO.  It especially should not be
the default behavior.

Customize (whether UI or from any code) doesn't
interfere with any settings you yourself code
using its functions, provided either (1) you
don't code those in your init file or (2) you
use `custom-file', which prevents Customize
from writing to your init file.

While waiting (a few more decades perhaps?) for
Emacs to stop letting Customize write to your
init file, you can at least prevent the problem
you note by simply doing #1 or #2.  For #1, you
can just have your init file load some file
where you put such hand-crafted customize code.
For #2 you need just set variable `custom-file'
and load that file from your init file.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]