Mercurial > emacs
comparison lisp/startup.el @ 33236:d20d5b9045de
(fancy-splash-delay): Set to 10 seconds.
(fancy-splash-max-time): New user-option.
(fancy-splash-stop-time): New variable.
(fancy-splash-screens): Set it. Catch `stop-splashing'.
(fancy-splash-screens-1): Throw `stop-splashing' when current
time is greater than fancy-splash-stop-time.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 06 Nov 2000 11:43:59 +0000 |
parents | 4a73f3e3bd29 |
children | 4161fec906e0 |
comparison
equal
deleted
inserted
replaced
33235:332e8deb8bea | 33236:d20d5b9045de |
---|---|
983 "Fancy splash screen when Emacs starts." | 983 "Fancy splash screen when Emacs starts." |
984 :version "21.1" | 984 :version "21.1" |
985 :group 'initialization) | 985 :group 'initialization) |
986 | 986 |
987 | 987 |
988 (defcustom fancy-splash-delay 5 | 988 (defcustom fancy-splash-delay 10 |
989 "*Delay in seconds between splash screens." | 989 "*Delay in seconds between splash screens." |
990 :group 'fancy-splash-screen | |
991 :type 'integer) | |
992 | |
993 | |
994 (defcustom fancy-splash-max-time 60 | |
995 "*Show splash screens for at most this number of seconds. | |
996 Values less than 60 seconds are ignored." | |
990 :group 'fancy-splash-screen | 997 :group 'fancy-splash-screen |
991 :type 'integer) | 998 :type 'integer) |
992 | 999 |
993 | 1000 |
994 (defcustom fancy-splash-image nil | 1001 (defcustom fancy-splash-image nil |
1000 | 1007 |
1001 ;; These are temporary storage areas for the splash screen display. | 1008 ;; These are temporary storage areas for the splash screen display. |
1002 | 1009 |
1003 (defvar fancy-current-text nil) | 1010 (defvar fancy-current-text nil) |
1004 (defvar fancy-splash-help-echo nil) | 1011 (defvar fancy-splash-help-echo nil) |
1012 (defvar fancy-splash-stop-time nil) | |
1005 | 1013 |
1006 | 1014 |
1007 (defun fancy-splash-insert (&rest args) | 1015 (defun fancy-splash-insert (&rest args) |
1008 "Insert text into the current buffer, with faces. | 1016 "Insert text into the current buffer, with faces. |
1009 Arguments from ARGS should be either strings or pairs `:face FACE', | 1017 Arguments from ARGS should be either strings or pairs `:face FACE', |
1074 "Copyright (C) 2000 Free Software Foundation, Inc."))) | 1082 "Copyright (C) 2000 Free Software Foundation, Inc."))) |
1075 | 1083 |
1076 | 1084 |
1077 (defun fancy-splash-screens-1 (buffer) | 1085 (defun fancy-splash-screens-1 (buffer) |
1078 "Timer function displaying a splash screen." | 1086 "Timer function displaying a splash screen." |
1087 (when (> (float-time) fancy-splash-stop-time) | |
1088 (throw 'stop-splashing nil)) | |
1079 (unless fancy-current-text | 1089 (unless fancy-current-text |
1080 (setq fancy-current-text fancy-splash-text)) | 1090 (setq fancy-current-text fancy-splash-text)) |
1081 (let ((text (car fancy-current-text))) | 1091 (let ((text (car fancy-current-text))) |
1082 (set-buffer buffer) | 1092 (set-buffer buffer) |
1083 (erase-buffer) | 1093 (erase-buffer) |
1105 (switch-to-buffer "GNU Emacs") | 1115 (switch-to-buffer "GNU Emacs") |
1106 (setq tab-width 20) | 1116 (setq tab-width 20) |
1107 (let ((old-busy-cursor display-busy-cursor) | 1117 (let ((old-busy-cursor display-busy-cursor) |
1108 (splash-buffer (current-buffer)) | 1118 (splash-buffer (current-buffer)) |
1109 timer) | 1119 timer) |
1110 (unwind-protect | 1120 (catch 'stop-splashing |
1111 (let ((map (make-sparse-keymap)) | 1121 (unwind-protect |
1112 (show-help-function nil)) | 1122 (let ((map (make-sparse-keymap)) |
1113 (use-local-map map) | 1123 (show-help-function nil)) |
1114 (define-key map [t] 'fancy-splash-default-action) | 1124 (use-local-map map) |
1115 (define-key map [mouse-movement] 'ignore) | 1125 (define-key map [t] 'fancy-splash-default-action) |
1116 (setq cursor-type nil | 1126 (define-key map [mouse-movement] 'ignore) |
1117 display-busy-cursor nil | 1127 (setq cursor-type nil |
1118 buffer-undo-list t | 1128 display-busy-cursor nil |
1119 mode-line-format | 1129 buffer-undo-list t |
1120 (propertize "---- %b %-" 'face '(:weight bold)) | 1130 mode-line-format |
1121 timer (run-with-timer 0 fancy-splash-delay | 1131 (propertize "---- %b %-" 'face '(:weight bold)) |
1122 #'fancy-splash-screens-1 | 1132 fancy-splash-stop-time (+ (float-time) |
1123 splash-buffer)) | 1133 (max 60 fancy-splash-max-time)) |
1124 (recursive-edit)) | 1134 timer (run-with-timer 0 fancy-splash-delay |
1125 (cancel-timer timer) | 1135 #'fancy-splash-screens-1 |
1126 (setq display-busy-cursor old-busy-cursor) | 1136 splash-buffer)) |
1127 (kill-buffer splash-buffer)))) | 1137 (recursive-edit)) |
1138 (cancel-timer timer) | |
1139 (setq display-busy-cursor old-busy-cursor) | |
1140 (kill-buffer splash-buffer))))) | |
1128 | 1141 |
1129 | 1142 |
1130 (defun startup-echo-area-message () | 1143 (defun startup-echo-area-message () |
1131 (if (eq (key-binding "\C-h\C-p") 'describe-project) | 1144 (if (eq (key-binding "\C-h\C-p") 'describe-project) |
1132 "For information about the GNU Project and its goals, type C-h C-p." | 1145 "For information about the GNU Project and its goals, type C-h C-p." |