unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: "Pedro Andres Aranda Gutierrez" <paaguti@gmail.com>,
	"Colin Baxter 😺" <m43cap@yandex.com>
Cc: Robert Pluim <rpluim@gmail.com>,
	"emacs-devel@gnu.org" <emacs-devel@gnu.org>,
	Po Lu <luangruo@yahoo.com>,
	Stefan Kangas <stefankangas@gmail.com>,
	Eli Zaretskii <eliz@gnu.org>
Subject: RE: [External] : Re: Default custom file was: Re: Propose to add setup-wizard.el to ELPA
Date: Wed, 5 Jan 2022 19:02:15 +0000	[thread overview]
Message-ID: <SJ0PR10MB54885C5DAB11C4E6AA6DBBF4F34B9@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <CAO48Bk_uKvbD0=MdOAfPfrhE7yCLzcUAGZRYdc8sq2DMW3r0og@mail.gmail.com>

[Please use plain-text email for the list.]

> Say we go a conservative approach and we only load custom-file automatically if set by the user. We wait to see if people like it and then include a message when custom-file was already loaded by the user. And finally we attempt the 'revolution' setting a default value for custom-file and requiring users to set it to nil if they want the original emacs behaviour.

This is a bit long, but I think it's relatively succinct.

1. Whether to load `custom-file' automatically after the init file is an open question.

2. That should never be done if it's already been loaded.  In that case, it's clear that the user, one way or another, is controlling when to load it.

3. If, after loading the init file, `custom-file' has not yet been loaded, `custom-file' is loaded (automatically).  (Obviously this can only be the case when it's not the same file as the init file.) 

#3 is a no-op if the `custom-file' is empty.  If you never use Customize (or its functions) to save customize changes - e.g., you use `custom(ize)-set-variable(s)' only in your init file etc. - then Customize is out of the picture wrt writing.

4. There would be a new variable that you can set or test, which will prevent #3: no automatic loading of `custom-file'.  

Why?  Just as you might want to explicitly control where/when, and how many times, you load `custom-file', so you might want to prevent loading it altogether in some (probably uncommon) situations.

5. `emacs -q' and `emacs -Q' should not load the `custom-file'.  That is, the (conditional) automatic loading after the init file should happen only when the init file is actually loaded.

In addition, we should add a new switch that suppresses (only) loading of the `custom-file', i.e., does the same thing as the variable of #4.  It wouldn't prevent loading the init file, and it wouldn't prevent loading `custom-file' explicitly from the init file.

6. `custom-file' should have a default value/location. E.g. 

 (defcustom custom-file "~/.emacs-custom.el" ...)

This change would make it so that even _users doing nothing_ get a separate `custom-file'.  That's the right thing as the default behavior.

Any users who really want/need to have Customize use their init file would need to make a tiny change, yes.

Currently a nil value of `custom-file' has the effect of using the init file.  That's the situation to be avoided as the default scenario.

We could, however, keep the longstanding nil-means-use-init-file behavior, so that if you _explicitly_ set `custom-file' to nil it's the same as setting it to the value of `user-init-file'. 

Would that be a good idea?  It's maybe not as clear as explicitly specifying the init file location, but it would work.

Explicitly setting to nil means, of course, that users who want to continue having Customize use their init file would still need to make a change: set `custom-file' to either nil or the init file location.

7. Suppose a longtime user doesn't read the NEWS etc., and _does nothing_.  What happens then?  Is there a problem?

a. Any `custom*' stuff in the init file is respected when that file is loaded.

b. If the init file doesn't load `custom-file', then it gets loaded automatically (from its default location).  If that file doesn't exist, this step is a no-op.

c. If the user then makes some custom* changes and saves them, they're saved to the default `custom-file' location, _not_ to the init file.

d. In the next Emacs session, steps (a) and (b) are repeated.  This time, the `custom-file' exists, so that any saved changes for custom vars and faces are respected.

If the init file still contains some custom* setting, it's still respected, unless that same var/face was saved to `custom-file' with a different value.  In effect, `custom-file' settings override any for the same vars/faces in the init file.

8. #7 is the case some people have howled about.  Is it really a problem?  It could be, in this scenario:

Suppose that at some point in the past you set option `foo' to 10 in your init file.  And you later used Customize to change `foo' to 42 and save it (to your `custom-file' - the new default behavior).  You might have been thinking that Customize was still saving to your init file, replacing that previous setting of 10.

Still later (e.g. from habit) you edit your init file, to change the value of `foo' from 10 to 314.  Next session, `foo' is 42, not 314 (assuming `custom-file' still gets loaded automatically after the init file).

That's what comes from possibly having two locations where you set custom* stuff.  At that point (once you figure out what happened), you can do either of the following, to get straight:

a. Move your custom* stuff from your init file to your `custom-file' (or just delete it from your init file).

From now on, you use only `custom-file' for saving custom* stuff.

b. Set `custom-file' to your init file (or to nil, if we allow that to give the same behavior).

From now on, you use only your init file for custom* stuff, just as you did in the past.

  parent reply	other threads:[~2022-01-05 19:02 UTC|newest]

Thread overview: 157+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-03  6:13 Default custom file was: Re: Propose to add setup-wizard.el to ELPA Pedro Andres Aranda Gutierrez
2022-01-03 14:47 ` Robert Pluim
2022-01-04  6:13   ` Pedro Andres Aranda Gutierrez
2022-01-04  6:45     ` tomas
2022-01-04  7:29       ` Stefan Kangas
2022-01-04 10:10         ` tomas
2022-01-04 16:44           ` [External] : " Drew Adams
2022-01-04 17:09             ` tomas
2022-01-04 17:30               ` Drew Adams
2022-01-04 18:03                 ` tomas
2022-01-04 18:27                   ` Drew Adams
2022-01-04 18:41                     ` tomas
2022-01-05  9:14                   ` Stefan Kangas
2022-01-04 16:44       ` Drew Adams
2022-01-04  7:14     ` Stefan Kangas
2022-01-04 10:11       ` Robert Pluim
2022-01-04 10:30         ` Po Lu
2022-01-04 10:46           ` Robert Pluim
2022-01-04 10:59             ` Po Lu
2022-01-04 13:02               ` Robert Pluim
2022-01-04 11:11         ` Stefan Kangas
2022-01-04 12:23           ` LdBeth
2022-01-04 16:44         ` [External] : " Drew Adams
2022-01-04 13:08       ` Eli Zaretskii
2022-01-04 15:17         ` Stefan Kangas
2022-01-04 15:48           ` Robert Pluim
2022-01-04 15:57             ` Pedro Andres Aranda Gutierrez
2022-01-04 15:54           ` Pedro Andres Aranda Gutierrez
2022-01-04 16:44         ` [External] : " Drew Adams
2022-01-04 16:49           ` Robert Pluim
2022-01-04 17:14             ` Drew Adams
2022-01-04 17:32               ` Pedro Andres Aranda Gutierrez
2022-01-04 17:45                 ` Drew Adams
2022-01-04 17:55                 ` Robert Pluim
2022-01-04 18:24                   ` Pedro Andres Aranda Gutierrez
2022-01-04 17:30             ` Eli Zaretskii
2022-01-04 17:35               ` Pedro Andres Aranda Gutierrez
2022-01-04 17:47                 ` Eli Zaretskii
2022-01-04 17:57                   ` Robert Pluim
2022-01-05  9:14                     ` Stefan Kangas
2022-01-05  1:01             ` Po Lu
2022-01-05  7:03               ` Pedro Andres Aranda Gutierrez
2022-01-05  7:10                 ` Pedro Andres Aranda Gutierrez
2022-01-05  7:22                 ` Po Lu
2022-01-05  7:47                   ` Drew Adams
2022-01-05  7:59                     ` Po Lu
2022-01-05  9:17                       ` LdBeth
2022-01-05  9:26                         ` Robert Pluim
2022-01-05 10:54                           ` Colin Baxter 😺
2022-01-05 11:24                             ` Po Lu
2022-01-05 11:45                             ` Pedro Andres Aranda Gutierrez
2022-01-05 12:09                               ` Colin Baxter 😺
2022-01-05 13:04                               ` Po Lu
2022-01-05 19:10                                 ` Drew Adams
2022-01-05 19:02                               ` Drew Adams [this message]
2022-01-05 19:13                                 ` Eli Zaretskii
2022-01-05 19:36                                   ` Drew Adams
2022-01-05  9:35                         ` Po Lu
2022-01-05  9:58                           ` Pedro Andres Aranda Gutierrez
2022-01-05 10:58                             ` xenodasein--- via Emacs development discussions.
2022-01-05 12:09                           ` LdBeth
2022-01-05 12:57                             ` Po Lu
2022-01-05 13:06                         ` Eli Zaretskii
2022-01-05 15:58                           ` Pedro Andres Aranda Gutierrez
2022-01-06  0:37                             ` Po Lu
2022-01-06  7:21                               ` Pedro Andres Aranda Gutierrez
2022-01-06  7:23                                 ` Po Lu
2022-01-06  7:33                                   ` Pedro Andres Aranda Gutierrez
2022-01-06  7:39                                     ` Po Lu
2022-01-06  8:58                                   ` Eli Zaretskii
2022-01-06  9:40                                     ` Po Lu
2022-01-06  9:45                                       ` Robert Pluim
2022-01-06 12:28                                         ` Colin Baxter 😺
2022-01-06 17:20                                           ` Drew Adams
2022-01-06 17:19                                     ` Drew Adams
2022-01-06 20:11                                       ` Tim Cross
2022-01-06 22:09                                         ` Drew Adams
2022-01-06 22:33                                           ` Tim Cross
2022-01-07  4:05                                             ` Drew Adams
2022-01-07  7:13                                               ` Tim Cross
2022-01-07 17:18                                                 ` Drew Adams
2022-01-08  0:29                                                   ` Tim Cross
2022-01-10 22:01                                                     ` Drew Adams
2022-01-11  6:23                                                       ` Tim Cross
2022-01-11 12:01                                                         ` xenodasein--- via Emacs development discussions.
2022-01-11 12:10                                                           ` Po Lu
2022-01-11 12:25                                                             ` xenodasein--- via Emacs development discussions.
2022-01-11 12:42                                                               ` tomas
     [not found]                                                                 ` <dbc302f1-a769-24d4-294d-e291b015229b@mnet-mail.de>
     [not found]                                                                   ` <Yd2W5BaccjjbJ6+q@tuxteam.de>
2022-01-11 15:23                                                                     ` xenodasein--- via Emacs development discussions.
     [not found]                                                                       ` <Yd2kAPRoYd37qCaN@tuxteam.de>
2022-01-11 16:05                                                                         ` xenodasein--- via Emacs development discussions.
2022-01-11 16:11                                                                           ` tomas
2022-01-12  0:46                                                               ` Po Lu
2022-01-11 12:35                                                           ` Tim Cross
2022-01-11 15:05                                                             ` xenodasein--- via Emacs development discussions.
2022-01-11 20:57                                                               ` Tim Cross
2022-01-11 13:27                                                           ` Jean Louis
2022-01-07  0:52                                           ` Po Lu
2022-01-07  4:09                                             ` Drew Adams
2022-01-07  4:46                                               ` Po Lu
2022-01-07  5:58                                                 ` Drew Adams
2022-01-07  7:04                                                   ` Po Lu
2022-01-07 18:06                                                     ` Drew Adams
2022-01-08  0:54                                                       ` Po Lu
2022-01-08  3:13                                                         ` LdBeth
2022-01-08  3:26                                                           ` Po Lu
2022-01-08  7:19                                                           ` Eli Zaretskii
2022-01-08 13:32                                                             ` Add list of useful settings to setup wizard was: Re: Default custom file LdBeth
2022-01-08 14:12                                                               ` Eli Zaretskii
2022-01-08 14:50                                                                 ` LdBeth
2022-01-08 14:39                                                               ` Stefan Kangas
2022-01-08 15:30                                                                 ` LdBeth
2022-01-08 15:05                                                               ` John Yates
2022-01-08  8:03                                                         ` [External] : Re: Default custom file was: Re: Propose to add setup-wizard.el to ELPA tomas
2022-01-08  9:38                                                           ` Po Lu
2022-01-08 10:39                                                             ` xenodasein--- via Emacs development discussions.
2022-01-08 11:14                                                               ` Po Lu
2022-01-08 12:35                                                                 ` xenodasein--- via Emacs development discussions.
2022-01-08 12:44                                                                   ` Po Lu
2022-01-08 12:59                                                                     ` xenodasein--- via Emacs development discussions.
2022-01-08 13:16                                                                       ` Po Lu
2022-01-08 13:24                                                                         ` xenodasein--- via Emacs development discussions.
2022-01-08 13:33                                                                           ` Po Lu
2022-01-08 13:44                                                                             ` xenodasein--- via Emacs development discussions.
2022-01-08 14:32                                                                               ` tomas
2022-01-08 14:46                                                                                 ` xenodasein--- via Emacs development discussions.
2022-01-08 17:17                                                                                   ` Corwin Brust
2022-01-08 18:26                                                                                     ` xenodasein--- via Emacs development discussions.
     [not found]                                                                                       ` <MtgbBbx--B-2@tutanota.de>
     [not found]                                                                                         ` <MtqtDSN--3-2@tutanota.de>
2022-01-20 14:25                                                                                           ` Corwin Brust
2022-01-10 19:20                                                                                     ` [External] : " Drew Adams
2022-01-09  0:48                                                                               ` Po Lu
2022-01-08 13:35                                                                           ` =?gb18030?B?u9i4tKO6IFtFeHRlcm5hbF0gOiBSZTogRGVmYXVsdCBjdXN0b20gZmlsZSB3YXM6IFJlOiBQcm9wb3NlIHRvIGFkZCBzZXR1cC13aXphcmQuZWwgdG8gRUxQQQ==?= =?gb18030?B?emVyb2xlZQ==?=
2022-01-08 14:28                                                                       ` [External] : Re: Default custom file was: Re: Propose to add setup-wizard.el to ELPA tomas
2022-01-08 14:48                                                                         ` xenodasein--- via Emacs development discussions.
2022-01-08 11:42                                                               ` tomas
2022-01-08 12:28                                                                 ` xenodasein--- via Emacs development discussions.
2022-01-10 19:17                                                           ` Drew Adams
2022-01-10 22:02                                                         ` Drew Adams
2022-01-12  4:55                                                           ` Richard Stallman
2022-01-12  8:58                                                             ` xenodasein--- via Emacs development discussions.
2022-01-12 13:18                                                               ` Eli Zaretskii
2022-01-12  5:09                                                           ` Po Lu
2022-01-07  0:49                                       ` Po Lu
2022-01-07  4:09                                         ` Drew Adams
2022-01-07  4:42                                           ` Po Lu
2022-01-07  6:38                                             ` Pedro Andres Aranda Gutierrez
2022-01-07  8:43                                               ` Robert Pluim
2022-01-07  9:38                                                 ` Pedro Andres Aranda Gutierrez
2022-01-07 17:17                                                 ` Drew Adams
2022-01-07 17:12                                               ` Drew Adams
2022-01-06 17:19                                   ` Drew Adams
2022-01-07  0:48                                     ` Po Lu
2022-01-07  4:09                                       ` Drew Adams
2022-01-07  6:18                                         ` tomas
2022-01-07 18:06                                           ` Drew Adams
2022-01-06 16:17                                 ` Drew Adams
2022-01-05  7:43                 ` Drew Adams
2022-01-04 16:43     ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB54885C5DAB11C4E6AA6DBBF4F34B9@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=m43cap@yandex.com \
    --cc=paaguti@gmail.com \
    --cc=rpluim@gmail.com \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).