From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <83o8hrbbv6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8912"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: ola.x.nilsson@axis.com, 45857@debbugs.gnu.org, 30994@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 14 20:33:22 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l08Mz-0002C9-JK for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Jan 2021 20:33:21 +0100 Original-Received: from localhost ([::1]:41996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l08My-0006FH-DF for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Jan 2021 14:33:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l08Mg-0006D7-Um for bug-gnu-emacs@gnu.org; Thu, 14 Jan 2021 14:33:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56003) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l08Mg-0006Fa-MO for bug-gnu-emacs@gnu.org; Thu, 14 Jan 2021 14:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l08Mg-0004Q6-JT for bug-gnu-emacs@gnu.org; Thu, 14 Jan 2021 14:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Jan 2021 19:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30994 X-GNU-PR-Package: emacs Original-Received: via spool by 30994-submit@debbugs.gnu.org id=B30994.161065274616931 (code B ref 30994); Thu, 14 Jan 2021 19:33:02 +0000 Original-Received: (at 30994) by debbugs.gnu.org; 14 Jan 2021 19:32:26 +0000 Original-Received: from localhost ([127.0.0.1]:39312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l08M5-0004Oz-2q for submit@debbugs.gnu.org; Thu, 14 Jan 2021 14:32:26 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:15471) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l08M1-0004Og-VM; Thu, 14 Jan 2021 14:32:23 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5EB0480880; Thu, 14 Jan 2021 14:32:16 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 9836780722; Thu, 14 Jan 2021 14:32:14 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1610652734; bh=5FxppJ3GkCI8vSDSI5Tpegi/4PddWJ2a7O15f1x+o7U=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=NbXL03i8jj0gdrpuQLILF+8slMOp2p3yzFBOWmyBs6dmhy9YnuSqNmzlSsTn+HU1o nsbU3Z8+N0sghCp5vjvphrVUJgPgwfeCWNHXhNor72OPE4khgLcxeM+QPoIN7wUESs a8LtfiDc/DtgZzk0sqk3wcuPDKHhXXRGiy0UPDbR5k5msnwglHYzRbipHoV4xD/VYi iZvqRhdSRENU6bk/xy8020rpn5caDE1o3m/xJgDuSGu0EJ4sU98MvqX8orgcRwvzWE zjg05lDzaXqzo90MLli562x3FQZYiVqVvJ8jFsJNCjCKKWiTEOqst7r6SsLzq0vAUL HJ+3mx8ogPOOQ== Original-Received: from alfajor (unknown [45.72.224.181]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 10B05120352; Thu, 14 Jan 2021 14:32:14 -0500 (EST) In-Reply-To: <83o8hrbbv6.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 14 Jan 2021 20:40:45 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:197960 Archived-At: > 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