* Have Customize always use `custom-file`
@ 2022-01-03 16:13 Drew Adams
0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2022-01-03 16:13 UTC (permalink / raw)
To: Drew Adams, Sean Whitton, Stefan Kangas, xenodasein@tutanota.de
Cc: emacs-devel@gnu.org
[Renaming this part of the setup-wizard thread.]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Have Customize always use `custom-file`
@ 2022-01-03 16:15 Drew Adams
2022-01-03 16:20 ` xenodasein--- via Emacs development discussions.
0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2022-01-03 16:15 UTC (permalink / raw)
To: Drew Adams, xenodasein@tutanota.de, Stefan Kangas
Cc: Sean Whitton, emacs-devel@gnu.org
[Moving to new Subject line.]
> > >>>> Customize should not write to your init file ...
> > >>>> That's a bad Emacs design choice, IMO.
> > >>>> It especially should not be the default behavior.
> >
> > I'd prefer the current behavior TBH, because the real
> > issue is not where it is written, it is when it's read.
>
> No. The real issue is who is writing it, and where.
>
> Users can control the location of `custom-file'
> and when it's read.
>
> And we can provide a default location and time
> of reading.
>
> > Currently it is easy to place custom-set-variables
> > where you want either inside init file or to place it into another
> > file.
>
> That would of course still be the case. Nothing
> prevents you from doing anything in your init or
> another file - including calling custom* functions.
>
> > Timing is important,
>
> It's absolutely important, and needs to remain
> under user control.
>
> > because Customize also has problems with
> > autoloads, and who knows what else.
>
> Dunno what problems you envision - please be
> specific.
>
> The only real change is to prevent Customize
> from writing to your init file. Nothing else.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Have Customize always use `custom-file`
2022-01-03 16:15 Drew Adams
@ 2022-01-03 16:20 ` xenodasein--- via Emacs development discussions.
0 siblings, 0 replies; 5+ messages in thread
From: xenodasein--- via Emacs development discussions. @ 2022-01-03 16:20 UTC (permalink / raw)
To: drew.adams; +Cc: emacs-devel
Jan 3, 2022, 19:04 by drew.adams@oracle.com:
>> >>>> Customize should not write to your init file ... That's a bad Emacs
>> >>>> design choice, IMO. It especially should not be the default behavior.
>> >> Hmm, then where should it write to?
>> > IMO, something like
>> > (setq custom-file (locate-user-emacs-file "custom-file.el"))
>>
>> I'd prefer the current behavior TBH, because the real
>> issue is not where it is written, it is when it's read.
>>
>
> No. The real issue is who is writing it, and where.
>
> Users can control the location of `custom-file'
> and when it's read.
>
> And we can provide a default location and time
> of reading.
>
>> Currently it is easy to place custom-set-variables
>> where you want either inside init file or to place it into another
>> file.
>>
>
> That would of course still be the case. Nothing
> prevents you from doing anything in your init or
> another file - including calling custom* functions.
>
>> Timing is important,
>>
>
> It's absolutely important, and needs to remain
> under user control.
>
>> because Customize also has problems with
>> autoloads, and who knows what else.
>>
>
> Dunno what problems you envision - please be
> specific.
>
> The only real change is to prevent Customize
> from writing to your init file. Nothing else.
>
I am fine with this behavior, as long as we can place the
(load custom-file) anywhere we want.
My line of thinking was, if someone is aware of init.el
and what Customize writes to it, then it is already very
easy for them to do what they like, and stop it from
writing. It is of course better to do the proper thing
from beginning.
For problems:
https://stackoverflow.com/questions/32693757/emacs-package-customization-and-autoloads
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Have Customize always use `custom-file`
@ 2022-01-03 17:55 Drew Adams
2022-01-03 18:31 ` xenodasein--- via Emacs development discussions.
0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2022-01-03 17:55 UTC (permalink / raw)
To: xenodasein@tutanota.de, emacs-devel@gnu.org
> > For problems:
> >
> https://urldefense.com/v3/__https://stackoverflow.com/questions/32693757/ema
> cs-package-customization-and-
> autoloads__;!!ACWV5N9M2RV99hQ!ch4K0byKujWHfMCY7DyWs5dx-
> 3h5iPQestwjvN1CHmMk0tDfWAo_lOk7FaJddxMS$
>
> Sorry for nonfree link. TLDR: Stefan mentions existence quirks and corner
> cases on some interactions of autoloading and Customize. Experto credite.
As I said, I answered the question posed at that link,
there.
What the user asking that question did was reasonable.
Users can control the behavior. If you put a defcustom
sexp in an autoloads file, then you need to know, and
perhaps pay attention to, when that file gets loaded.
There's nothing mystical about this. The behavior of
a defcustom sexp, like any other Lisp code, can depend
on code that's been previously evaluated (e.g. loaded).
That applies to a defcustom that's autoloaded as much
as to one that's loaded/evaluated in some other way.
If a defcustom expects things to exist, or things to
have happened already, when it's evaluated, then you
need to make sure those things exist or have happened.
Stefan's advice to not autoload defcustom sexps is
perfectly fine to follow. It can also be fine to
autoload some defcustoms - but in that case you of
course need to pay attention to evaluation/load order
etc.
Emacs Lisp gives you plenty of rope to hang yourself
with. You're not obliged to hang yourself, however.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Have Customize always use `custom-file`
2022-01-03 17:55 Drew Adams
@ 2022-01-03 18:31 ` xenodasein--- via Emacs development discussions.
0 siblings, 0 replies; 5+ messages in thread
From: xenodasein--- via Emacs development discussions. @ 2022-01-03 18:31 UTC (permalink / raw)
To: drew.adams; +Cc: emacs-devel
Jan 3, 2022, 20:55 by drew.adams@oracle.com:
>> > For problems:
>> >
>> https://urldefense.com/v3/__https://stackoverflow.com/questions/32693757/ema
>> cs-package-customization-and-
>> autoloads__;!!ACWV5N9M2RV99hQ!ch4K0byKujWHfMCY7DyWs5dx-
>> 3h5iPQestwjvN1CHmMk0tDfWAo_lOk7FaJddxMS$
>>
>> Sorry for nonfree link. TLDR: Stefan mentions existence quirks and corner
>> cases on some interactions of autoloading and Customize. Experto credite.
>>
>
> As I said, I answered the question posed at that link,
> there.
>
Oh, I've read it, didn't want to imply otherwise. I sent the correction
for others. I used emacs-devel as To:, did I make a mail mistake?
> What the user asking that question did was reasonable.
>
> Users can control the behavior. If you put a defcustom
> sexp in an autoloads file, then you need to know, and
> perhaps pay attention to, when that file gets loaded.
>
> There's nothing mystical about this. The behavior of
> a defcustom sexp, like any other Lisp code, can depend
> on code that's been previously evaluated (e.g. loaded).
>
> That applies to a defcustom that's autoloaded as much
> as to one that's loaded/evaluated in some other way.
>
> If a defcustom expects things to exist, or things to
> have happened already, when it's evaluated, then you
> need to make sure those things exist or have happened.
>
> Stefan's advice to not autoload defcustom sexps is
> perfectly fine to follow. It can also be fine to
> autoload some defcustoms - but in that case you of
> course need to pay attention to evaluation/load order
> etc.
>
> Emacs Lisp gives you plenty of rope to hang yourself
> with. You're not obliged to hang yourself, however.
>
I stumbled upon that post when my hand got burned from messing with
manual packages, customize, and autoloads. I understand your perspective,
but you're basically an Emacs legend. For me this was yet another set
of pitfalls to dance around, caused by a package whose main purpose is
to make life easier for n00bs.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-01-03 18:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-03 16:13 Have Customize always use `custom-file` Drew Adams
-- strict thread matches above, loose matches on Subject: below --
2022-01-03 16:15 Drew Adams
2022-01-03 16:20 ` xenodasein--- via Emacs development discussions.
2022-01-03 17:55 Drew Adams
2022-01-03 18:31 ` xenodasein--- via Emacs development discussions.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).