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: Fri, 15 Jan 2021 23:52:29 -0500 Message-ID: References: <83o8hrbbv6.fsf@gnu.org> <83h7njb6a5.fsf@gnu.org> <835z3ybpsj.fsf@gnu.org> <83k0se9hw2.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="21988"; 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 Sat Jan 16 05:53:26 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 1l0daX-0005ci-Ra for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Jan 2021 05:53:25 +0100 Original-Received: from localhost ([::1]:55304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0daW-0003Hj-Bq for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Jan 2021 23:53:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0daA-0003H4-RK for bug-gnu-emacs@gnu.org; Fri, 15 Jan 2021 23:53:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58934) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l0daA-0000vK-Jt for bug-gnu-emacs@gnu.org; Fri, 15 Jan 2021 23:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l0daA-0002z7-Hm for bug-gnu-emacs@gnu.org; Fri, 15 Jan 2021 23:53: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: Sat, 16 Jan 2021 04:53: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.161077276211439 (code B ref 45857); Sat, 16 Jan 2021 04:53:02 +0000 Original-Received: (at 45857) by debbugs.gnu.org; 16 Jan 2021 04:52:42 +0000 Original-Received: from localhost ([127.0.0.1]:42246 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0dZp-0002yL-Kv for submit@debbugs.gnu.org; Fri, 15 Jan 2021 23:52:41 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:48637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0dZm-0002y2-Kl; Fri, 15 Jan 2021 23:52:40 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 1091F10247E; Fri, 15 Jan 2021 23:52:33 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id F0055102380; Fri, 15 Jan 2021 23:52:30 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1610772751; bh=53PmadSLVUsVX+nKWKZQ1GFjtHsAnNroR9c/U57oiKM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=hX0DLC1Td2cuzOjpEzqeDJzPACSQlNTqyLN5DcwbNjIPWkj2YeswmDOI0fbQ4rlv5 Pw+pW36Mj6/K81KVVs3MC4K48sX8ddxggn3w8L38svBjOxc1nv/cfNsorQ5AaaIMO1 j+Rg/OVaBMVu48knG199Q3NAj6w8ay+J0WKU2qTJkPexT3fFNFC0PEi1J0863jyct8 uLQX+uKeXufnANPiUhQgVDibo1PDc+j9FwlrCAdedmGIJZZMIYZ+vMXKrNAr88KHur +iqXc+c+4efFJMwdpG4QkX6RkQXOVpaNfyKs1u7hTzM8HDfYzehug7fwE1q7ONm3cU MofBmgwLB4H1g== Original-Received: from alfajor (unknown [45.72.224.181]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8F75912051C; Fri, 15 Jan 2021 23:52:30 -0500 (EST) In-Reply-To: (Stefan Monnier's message of "Fri, 15 Jan 2021 17:19:33 -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:198010 Archived-At: I looked at the issue of the default value of `blink-cursor-mode` and it's actually easy to make it be t unconditionally, so as to eliminate the need to re-evaluate variables after loading `early-init.el`. Maybe some time in the future this need will re-appear at which point we may want to introduce some fancier system to control which var is initialized when, but I think for now the patch below is a better solution. Stefan 2021-01-15 Stefan Monnier * lisp/startup.el: Fix bug#45857, bug#30994, and bug#45913. (command-line): Don't re-evaluate the `custom-delayed-init-variables` a second time after reading the `early-init.el` file. (x-apply-session-resources): Set `blink-cursor-mode` rather than `no-blinking-cursor`. * lisp/frame.el (blink-cursor-start): Turn `blink-cursor-mode` off if `blink-cursor-mode` was set to nil. (blink-cursor-mode): Default to it being enabled regardless of `window-system`. diff --git a/lisp/frame.el b/lisp/frame.el index e2d7f21a49..06aab269dd 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -2552,13 +2552,15 @@ blink-cursor-start This starts the timer `blink-cursor-timer', which makes the cursor blink if appropriate. It also arranges to cancel that timer when the next command starts, by installing a pre-command hook." - (when (null blink-cursor-timer) + (cond + ((null blink-cursor-mode) (blink-cursor-mode -1)) + ((null blink-cursor-timer) ;; Set up the timer first, so that if this signals an error, ;; blink-cursor-end is not added to pre-command-hook. (setq blink-cursor-blinks-done 1) (blink-cursor--start-timer) (add-hook 'pre-command-hook #'blink-cursor-end) - (internal-show-cursor nil nil))) + (internal-show-cursor nil nil)))) (defun blink-cursor-timer-function () "Timer function of timer `blink-cursor-timer'." @@ -2637,9 +2639,8 @@ blink-cursor-mode terminals, cursor blinking is controlled by the terminal." :init-value (not (or noninteractive no-blinking-cursor - (eq system-type 'ms-dos) - (not (display-blink-cursor-p)))) - :initialize 'custom-initialize-delay + (eq system-type 'ms-dos))) + :initialize #'custom-initialize-delay :group 'cursor :global t (blink-cursor-suspend) diff --git a/lisp/startup.el b/lisp/startup.el index 552802a38d..7011fbf458 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1172,6 +1172,7 @@ command-line ;; are dependencies between them. (nreverse custom-delayed-init-variables)) (mapc #'custom-reevaluate-setting custom-delayed-init-variables) + (setq custom-delayed-init-variables nil) ;; Warn for invalid user name. (when init-file-user @@ -1301,12 +1302,6 @@ 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. - (mapc #'custom-reevaluate-setting custom-delayed-init-variables) - (setq custom-delayed-init-variables nil) - (normal-erase-is-backspace-setup-frame) ;; Register default TTY colors for the case the terminal hasn't a @@ -1487,13 +1482,13 @@ x-apply-session-resources opens a graphical frame. This can set the values of `menu-bar-mode', `tool-bar-mode', -`tab-bar-mode', and `no-blinking-cursor', as well as the `cursor' face. +`tab-bar-mode', and `blink-cursor-mode', as well as the `cursor' face. Changed settings will be marked as \"CHANGED outside of Customize\"." (let ((no-vals '("no" "off" "false" "0")) (settings '(("menuBar" "MenuBar" menu-bar-mode nil) ("toolBar" "ToolBar" tool-bar-mode nil) ("scrollBar" "ScrollBar" scroll-bar-mode nil) - ("cursorBlink" "CursorBlink" no-blinking-cursor t)))) + ("cursorBlink" "CursorBlink" blink-cursor-mode nil)))) (dolist (x settings) (if (member (x-get-resource (nth 0 x) (nth 1 x)) no-vals) (set (nth 2 x) (nth 3 x)))))