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#45857: 28.0.50; Not possible to set package-user-dir in early-init.el
Date: Fri, 15 Jan 2021 23:52:29 -0500	[thread overview]
Message-ID: <jwvpn25mr6p.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <jwv8s8trh23.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 15 Jan 2021 17:19:33 -0500")

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  <monnier@iro.umontreal.ca>

    * 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)))))






  reply	other threads:[~2021-01-16  4:52 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
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 [this message]
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=jwvpn25mr6p.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).