all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pedro Andres Aranda Gutierrez <paaguti@gmail.com>
To: Robert Pluim <rpluim@gmail.com>
Cc: 54381@debbugs.gnu.org, Lars Ingebrigtsen <larsi@gnus.org>
Subject: bug#54381: 29.0.50; Automatically load custom-file
Date: Tue, 15 Mar 2022 08:51:12 +0100	[thread overview]
Message-ID: <CAO48Bk98-9wHoDJEFKUqBZ5bZES6_eCWUonu9Xxg9QYFfLMQtw@mail.gmail.com> (raw)
In-Reply-To: <87pmmocted.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2853 bytes --]

OK, once again, one step back... maybe I'm completely wrong assuming things
based on my experience:
My full history step by step:

Background:
My first Emacs experience what on an HP700 where we had a 68020 HW emulator
and on a Sun SPARC where we had the schematic capture programs in the
1990... Always trying to have a single sys-independent initialisation
infra...

I've been using the variable `custom-file' (defined inside Emacs), setting
it to the path of the file where I want my customisation to reside.
After setting this variable, I've used (load custom-file) to load my
customisations (if they existed).
I have observed that the optimal place to put this (setq)(load) pair was at
the end of my init.el file, because some customisations came from packages
I loaded, etc.

Now, I have started encouraging my students to use Emacs and helping them
understand the basics of initialisation and customisation.
During this time, I have often been asked why the (setq)(load) pair is
needed. The reasoning behind this question mainly being that because
`custom-file' is defined in Emacs, it should be assumed that Emacs would
react to its being non-nil by loading it.

This question arose always when someone had not placed the (setq)(load)
pair at the end of init.el and a weird behaviour was observed.

Corner cases:
I do understand that someone may want to (setq)(load) somewhere in init.el
(ie not at the end) and I respect this by loading `custom-file' only once.

I do understand that someone can setq `custom-file' but not load it,
because customisations are session specific for this user and can be
discarded afterwards or because this user wants to try out things and then
integrate some of the customisations into init.el in a more permanent way.
This is what custom-file-load-p was included for.

I have tried to integrate all this (but just this) into the patch to make
Emacs an infinitesimal more beginner-friendly.

best, /PA

On Mon, 14 Mar 2022 at 18:53, Robert Pluim <rpluim@gmail.com> wrote:

> >>>>> On Mon, 14 Mar 2022 17:47:49 +0100, Pedro Andres Aranda Gutierrez <
> paaguti@gmail.com> said:
>
>     Pedro> Robert > No, I donʼt think that would be a good idea: thereʼs a
> "custom.el"
>     Pedro> in
>     Robert> the emacs sources already, and we should indicate somehow that
> this
>     Pedro> is
>     Robert> *data*, not code.
>
>     Pedro> Don't follow you here. My customization file
> '~/.emacs.d/custom.el' is
>     Pedro> code, isn't it?
>
> Yes, thereʼs no distinction between code and data in lisp. But your
> custom file should only contain `custom-set-variables' and
> `custom-set-faces', not any old lisp forms.
>
> Robert
> --
>


-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

[-- Attachment #2: Type: text/html, Size: 3724 bytes --]

  reply	other threads:[~2022-03-15  7:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-14  8:21 bug#54381: 29.0.50; Automatically load custom-file Pedro Andres Aranda Gutierrez
2022-03-14  9:47 ` Lars Ingebrigtsen
2022-03-14  9:48   ` Lars Ingebrigtsen
2022-03-14 15:14     ` bug#54381: [External] : " Drew Adams
2022-03-14 13:15   ` Eli Zaretskii
2022-03-14 15:26     ` Robert Pluim
2022-03-14 16:19       ` Pedro Andres Aranda Gutierrez
2022-03-14 16:36         ` Robert Pluim
2022-03-14 16:47           ` Pedro Andres Aranda Gutierrez
2022-03-14 17:53             ` Robert Pluim
2022-03-15  7:51               ` Pedro Andres Aranda Gutierrez [this message]
2022-03-14 13:58   ` Robert Pluim
2022-04-14 14:05     ` Lars Ingebrigtsen
2022-03-17  6:38 ` bug#54381: Handling a corner case Pedro Andres Aranda Gutierrez
2022-03-17  7:09   ` Pedro Andres Aranda Gutierrez

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

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

  git send-email \
    --in-reply-to=CAO48Bk98-9wHoDJEFKUqBZ5bZES6_eCWUonu9Xxg9QYFfLMQtw@mail.gmail.com \
    --to=paaguti@gmail.com \
    --cc=54381@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=rpluim@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.