From 1592c1efdf808c504fbd3e648b65423ded6c4197 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 17 Oct 2000 12:59:41 +0000 Subject: [PATCH] (command-line): Move the code which registers the default colors to before before-init-hook. --- lisp/ChangeLog | 5 +++++ lisp/startup.el | 34 +++++++++++++++++----------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8521567f17d..ebd6ae77c4f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2000-10-17 Eli Zaretskii + + * startup.el (command-line): Move the code which sets the default + TTY colors to before before-init-hook. + 2000-10-17 Gerd Moellmann * jit-lock.el (jit-lock-stealth-time): Doc fix. diff --git a/lisp/startup.el b/lisp/startup.el index b2e03e2ab4e..e5cb37fd082 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -665,6 +665,23 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." (setq-default blink-cursor t) (blink-cursor-mode 1)) + ;; Register default TTY colors for the case the terminal hasn't a + ;; terminal init file. + (or (memq window-system '(x w32)) + (not (tty-display-color-p)) + (let* ((colors (cond ((eq window-system 'pc) + msdos-color-values) + ((eq system-type 'windows-nt) + w32-tty-standard-colors) + (t tty-standard-colors))) + (color (car colors))) + (while colors + (tty-color-define (car color) (cadr color) (cddr color)) + (setq colors (cdr colors) color (car colors))) + ;; Modifying color mappings means realized faces don't + ;; use the right colors, so clear them. + (clear-face-cache))) + (run-hooks 'before-init-hook) ;; Run the site-start library if it exists. The point of this file is @@ -796,23 +813,6 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." (set-buffer "*scratch*") (if (eq major-mode 'fundamental-mode) (funcall initial-major-mode)))) - - ;; Register default TTY colors for the case the terminal hasn't a - ;; terminal init file. - (or (memq window-system '(x w32)) - (not (tty-display-color-p)) - (let* ((colors (cond ((eq window-system 'pc) - msdos-color-values) - ((eq system-type 'windows-nt) - w32-tty-standard-colors) - (t tty-standard-colors))) - (color (car colors))) - (while colors - (tty-color-define (car color) (cadr color) (cddr color)) - (setq colors (cdr colors) color (car colors))) - ;; Modifying color mappings means realized faces don't - ;; use the right colors, so clear them. - (clear-face-cache))) ;; Load library for our terminal type. ;; User init file can set term-file-prefix to nil to prevent this. -- 2.39.2