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#45857: 28.0.50; Not possible to set package-user-dir in early-init.el Date: Thu, 14 Jan 2021 13:20:53 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21170"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 45857@debbugs.gnu.org, 30994@debbugs.gnu.org To: Ola x Nilsson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 14 19:25:06 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 1l07Iv-0005PX-RD for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Jan 2021 19:25:06 +0100 Original-Received: from localhost ([::1]:41382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l07Iu-0003eZ-SS for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Jan 2021 13:25:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l07Fz-00010W-Ft for bug-gnu-emacs@gnu.org; Thu, 14 Jan 2021 13:22:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55833) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l07Fy-00038Q-AN for bug-gnu-emacs@gnu.org; Thu, 14 Jan 2021 13:22:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l07Fy-0000Jn-6M for bug-gnu-emacs@gnu.org; Thu, 14 Jan 2021 13:22: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 18:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45857 X-GNU-PR-Package: emacs Original-Received: via spool by 45857-submit@debbugs.gnu.org id=B45857.16106484661149 (code B ref 45857); Thu, 14 Jan 2021 18:22:02 +0000 Original-Received: (at 45857) by debbugs.gnu.org; 14 Jan 2021 18:21:06 +0000 Original-Received: from localhost ([127.0.0.1]:39145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l07F4-0000IO-Gu for submit@debbugs.gnu.org; Thu, 14 Jan 2021 13:21:06 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:8489) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l07Ez-0000HS-Mx; Thu, 14 Jan 2021 13:21:05 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 387FF101AA5; Thu, 14 Jan 2021 13:20:56 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id B8A70100250; Thu, 14 Jan 2021 13:20:54 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1610648454; bh=N8kWsFEtlteaNrqYs6dAB581rPt5p26YaG2lB4AfchI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Oy5Qhz+F8eWF+qL4r7oxNdVJnZq40fTQB8bQG40qMTkTkPWHDBO/n0P18+rU4/jvl Clpo4YYb+QcaZC83mTJzJ/zVw4jIA43c2hACu1o+CqpTH49hFZjrpBPpWcLR5sJBsZ /2W0YyKHkIHgABAkuT/tmlTkJoAo6YX0qfTpuuaWKKZ3wjO9P3gRvXftufqldU2ryr 8cfmqkrjBBm/kT24ssGPLX7QfdPIoke7FT+zt9z4MtPJkX9jXIDNbXiHdOaTJoUKhu O5pzLoQLJvOYnftJ+lulYmJ5b0WoMmehY2b3xxhdK9q67bsnrCR60FoF+IrqY8FOK/ e0zfBsQvGdj7w== Original-Received: from alfajor (unknown [45.72.224.181]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6943212046B; Thu, 14 Jan 2021 13:20:54 -0500 (EST) In-Reply-To: (Stefan Monnier's message of "Thu, 14 Jan 2021 10:41:07 -0500") 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:197955 Archived-At: >> the package-user-dir defcustom gets the custom-initialize-delay >> intializer. At least for me, this overrides any setting of >> package-user-dir that is done in early-init.el. > Oh, I see you're right, and I think this issue is wider than > `package-user-dir` since it affects all the other vars that use > `custom-initialize-delay`. Back in June 2018, Eli wrote: > I can see several ways out of this: > > . Move the call to custom-reevaluate-setting back where it was, and > instead call custom-reevaluate-setting in that earlier place only > for Info-default-directory-list, which was the original reason why > the call was moved; > . Add a call to custom-reevaluate-setting for blink-cursor-mode > where the window-system is already set up; > . Call custom-reevaluate-setting for all the delayed-init variables > twice: once where we do that now, and again where we did that > before the above commit; > . Introduce yet another variable similar to > custom-delayed-init-variables, but separate from it, and put on > it all the delayed-init variables that need the window-system to > be set up, leaving all the rest in custom-delayed-init-variables. We ended up going with the 3rd option, but this is the source of the problem here. I think we should change to option 2 for now and plan on fixing it for good by removing this exception, i.e. by making the default value of `blink-cursor-mode` be t. More concretely, I suggest the patch below, Stefan diff --git a/lisp/startup.el b/lisp/startup.el index 57fd87f20f..8c9ac4e30f 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1311,12 +1312,13 @@ command-line (startup--setup-quote-display) (setq internal--text-quoting-flag t)) - ;; Re-evaluate again the predefined variables whose initial value - ;; depends on the runtime context, in case some of them depend on - ;; the window-system features. Example: blink-cursor-mode. - (let (current-load-list) ; c-r-s may call defvar, and hence LOADHIST_ATTACH - (mapc 'custom-reevaluate-setting custom-delayed-init-variables) - (setq custom-delayed-init-variables nil)) + ;; Some vars's initialization need to be delayed yet further, until + ;; after we setup the real initial frame, because their initial + ;; value depends on the window-system features. + ;; Currently, the only such var is `blink-cursor-mode'. See bug#30994. + ;; FIXME: We should arrange for `blink-cursor-mode's default to be + ;; unconditionally `t' so as to finally eliminate this problem. + (custom-reevaluate-setting 'blink-cursor-mode) (normal-erase-is-backspace-setup-frame)