comparison lisp/startup.el @ 32417:f1092988f808

(fancy-splash-screens): Don't add a pre-command hook. (fancy-splash-pre-command, fancy-splash-pending-command): Removed. (command-line-1): Don't use fancy-splash-pending-command. (fancy-splash-screens-1): Goto point-min after inserting text.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 12 Oct 2000 12:07:04 +0000
parents f5b3d7a43d24
children c49acc0abcf8
comparison
equal deleted inserted replaced
32416:33e158ac4449 32417:f1092988f808
987 (apply #'fancy-splash-insert text) 987 (apply #'fancy-splash-insert text)
988 (fancy-splash-tail) 988 (fancy-splash-tail)
989 (unless (current-message) 989 (unless (current-message)
990 (message fancy-splash-help-echo)) 990 (message fancy-splash-help-echo))
991 (set-buffer-modified-p nil) 991 (set-buffer-modified-p nil)
992 (goto-char (point-min))
992 (force-mode-line-update) 993 (force-mode-line-update)
993 (setq fancy-current-text (cdr fancy-current-text)))) 994 (setq fancy-current-text (cdr fancy-current-text))))
994 995
995 996
996 (defun fancy-splash-default-action () 997 (defun fancy-splash-default-action ()
997 "Default action for events in the splash screen buffer." 998 "Default action for events in the splash screen buffer."
998 (interactive) 999 (interactive)
999 (push last-command-event unread-command-events) 1000 (push last-command-event unread-command-events)
1000 (throw 'exit nil)) 1001 (throw 'exit nil))
1001
1002
1003 (defvar fancy-splash-pending-command nil
1004 "If non-nil, a command to be executed after the splash screen display.")
1005
1006 (defun fancy-splash-pre-command ()
1007 (unless (memq this-command
1008 '(ignore fancy-splash-default-action browse-url))
1009 (setq fancy-splash-pending-command this-command)
1010 (throw 'exit nil)))
1011 1002
1012 1003
1013 (defun fancy-splash-screens () 1004 (defun fancy-splash-screens ()
1014 "Display fancy splash screens when Emacs starts." 1005 "Display fancy splash screens when Emacs starts."
1015 (setq fancy-splash-help-echo (startup-echo-area-message)) 1006 (setq fancy-splash-help-echo (startup-echo-area-message))
1027 display-busy-cursor nil 1018 display-busy-cursor nil
1028 mode-line-format 1019 mode-line-format
1029 (propertize "---- %b %-" 'face '(:weight bold)) 1020 (propertize "---- %b %-" 'face '(:weight bold))
1030 timer (run-with-timer 0 5 #'fancy-splash-screens-1 1021 timer (run-with-timer 0 5 #'fancy-splash-screens-1
1031 splash-buffer)) 1022 splash-buffer))
1032 (add-hook 'pre-command-hook 'fancy-splash-pre-command)
1033 (recursive-edit)) 1023 (recursive-edit))
1034 (cancel-timer timer) 1024 (cancel-timer timer)
1035 (remove-hook 'pre-command-hook 'fancy-splash-pre-command) 1025 (remove-hook 'pre-command-hook 'fancy-splash-pre-command)
1036 (setq display-busy-cursor old-busy-cursor) 1026 (setq display-busy-cursor old-busy-cursor)
1037 (kill-buffer splash-buffer)))) 1027 (kill-buffer splash-buffer))))
1235 1225
1236 (with-current-buffer (get-buffer "*scratch*") 1226 (with-current-buffer (get-buffer "*scratch*")
1237 (erase-buffer) 1227 (erase-buffer)
1238 (when initial-scratch-message 1228 (when initial-scratch-message
1239 (insert initial-scratch-message)) 1229 (insert initial-scratch-message))
1240 (set-buffer-modified-p nil)) 1230 (set-buffer-modified-p nil)))))))
1241
1242 (when fancy-splash-pending-command
1243 (call-interactively fancy-splash-pending-command)))))))
1244 1231
1245 ;; Delay 2 seconds after the init file error message 1232 ;; Delay 2 seconds after the init file error message
1246 ;; was displayed, so user can read it. 1233 ;; was displayed, so user can read it.
1247 (if init-file-had-error 1234 (if init-file-had-error
1248 (sit-for 2)) 1235 (sit-for 2))