unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: ola.x.nilsson@axis.com, 45857@debbugs.gnu.org, 30994@debbugs.gnu.org
Subject: bug#30994: bug#45857: 28.0.50; Not possible to set package-user-dir in early-init.el
Date: Thu, 14 Jan 2021 14:32:13 -0500	[thread overview]
Message-ID: <jwvczy7s4uy.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83o8hrbbv6.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 14 Jan 2021 20:40:45 +0200")

> Is there any place where all these complications are described, so
> that people (and we ourselves) could have a complete, comprehensive
> overview of this stuff and the various problems it needs to solve?  If
> not, how about taking this opportunity to describe that?  Because
> otherwise these incidents will keep happening.

Here's the story:

We have a few variables which are predefined in the dumped Emacs but
whose default value depends on information only available when Emacs is
executed, such as the user's $HOME.

We handle those using `custom-initialize-delayed`, so when the
variable's `defcustom` is procesed the variable isn't initialized yet,
and instead initialization happens in `startup.el` by calling
`custom-reevaluate-setting` on each one of those delayed variables.

In Emacs-26, we did that just before loading the `.emacs` file and
everybody was happy.  But the `early-init.el` file added to Emacs-27
introduced a difficulty there:

- Those vars's values might be needed in `early-init.el` so we should
  call `custom-reevaluate-setting` before we load `early-init.el`.

- The value of `blink-cursor-mode` depends on whether window-system is
  nil or not, which is only known after loading `early-init.el`, so we
  should call `custom-reevaluate-setting` after we load `early-init.el`.

Currently we solve this by calling `custom-reevaluate-setting` twice for
every one of those variables.  But it means that we silently override
any change made to those variables from `early-init.el`.

As noted, the only var whose default value needs to be (re)computed
after loading `early-init.el` is `blink-cursor-mode`.  In theory there
could be more, but I think we should aim to reduce rather than increase
those cases.  E.g. the current way `blink-cursor-mode` is defined means
that if I start `emacs -Q -nw` and later create a GUI frame, that frame
won't have a blinking cursor.  I think this is a bug (tho I can see
that some people may consider it a feature if they (like me) dislike
blinking cursors ;-0)


        Stefan






  reply	other threads:[~2021-01-14 19:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14 11:51 bug#45857: 28.0.50; Not possible to set package-user-dir in early-init.el Ola x Nilsson
2021-01-14 15:03 ` Stefan Monnier
2021-01-14 15:41   ` Stefan Monnier
2021-01-14 18:20     ` Stefan Monnier
2021-01-14 18:40       ` bug#30994: " Eli Zaretskii
2021-01-14 19:32         ` Stefan Monnier [this message]
2021-01-14 20:41           ` Eli Zaretskii
2021-01-14 21:02             ` Stefan Monnier
2021-01-15  7:52               ` Eli Zaretskii
2021-01-15 16:08                 ` Stefan Monnier
2021-01-15 18:25                   ` Eli Zaretskii
2021-01-15 22:19                     ` Stefan Monnier
2021-01-16  4:52                       ` Stefan Monnier
2021-01-19 17:11                         ` Stefan Monnier
2021-01-22 16:08                           ` bug#30994: " Phillip Lord
2021-01-22 16:44                             ` Stefan Monnier
2021-01-22 17:02                               ` Phillip Lord
2021-01-16  7:08                       ` Eli Zaretskii

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=jwvczy7s4uy.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=30994@debbugs.gnu.org \
    --cc=45857@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=ola.x.nilsson@axis.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).