comparison lisp/startup.el @ 32232:ecede095f3ac

(fancy-splash-screens): Use local rather than global map. Don't use `update-menu-bindings' any more. Get rid of assumptions about keymap representation.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 06 Oct 2000 22:18:15 +0000
parents c743497a67e3
children f5b3d7a43d24
comparison
equal deleted inserted replaced
32231:1ba45428d865 32232:ecede095f3ac
478 (font-menu-add-default)) 478 (font-menu-add-default))
479 (and window-setup-hook 479 (and window-setup-hook
480 (run-hooks 'window-setup-hook)) 480 (run-hooks 'window-setup-hook))
481 (or menubar-bindings-done 481 (or menubar-bindings-done
482 (if (memq window-system '(x w32)) 482 (if (memq window-system '(x w32))
483 (precompute-menubar-bindings))))))) 483 (precompute-menubar-bindings)
484 ))))))
484 485
485 ;; Precompute the keyboard equivalents in the menu bar items. 486 ;; Precompute the keyboard equivalents in the menu bar items.
486 (defun precompute-menubar-bindings () 487 (defun precompute-menubar-bindings ()
487 (let ((submap (lookup-key global-map [menu-bar]))) 488 (let ((submap (lookup-key global-map [menu-bar])))
488 (while submap 489 (while submap
1011 1012
1012 (defun fancy-splash-screens () 1013 (defun fancy-splash-screens ()
1013 "Display fancy splash screens when Emacs starts." 1014 "Display fancy splash screens when Emacs starts."
1014 (setq fancy-splash-help-echo (startup-echo-area-message)) 1015 (setq fancy-splash-help-echo (startup-echo-area-message))
1015 (switch-to-buffer "GNU Emacs") 1016 (switch-to-buffer "GNU Emacs")
1016 (let ((old-global-map (current-global-map)) 1017 (let ((old-busy-cursor display-busy-cursor)
1017 (old-busy-cursor display-busy-cursor)
1018 (splash-buffer (current-buffer)) 1018 (splash-buffer (current-buffer))
1019 ;; Don't update menu bindings in the following. Since
1020 ;; C-x etc. are not bound in the map installed below,
1021 ;; there wouldn't be any bindings shown otherwise.
1022 (update-menu-bindings nil)
1023 timer) 1019 timer)
1024 (unwind-protect 1020 (unwind-protect
1025 (let ((map (nconc (make-sparse-keymap) 1021 (let ((map (make-sparse-keymap))
1026 '((t . fancy-splash-default-action))))
1027 (show-help-function nil)) 1022 (show-help-function nil))
1028 (use-global-map map) 1023 (use-local-map map)
1029 (use-local-map nil) 1024 (define-key map [t] 'fancy-splash-default-action)
1030 (define-key map [mouse-movement] 'ignore) 1025 (define-key map [mouse-movement] 'ignore)
1031 (define-key map [menu-bar] (lookup-key old-global-map [menu-bar]))
1032 (define-key map [tool-bar] (lookup-key old-global-map [tool-bar]))
1033 (setq cursor-type nil 1026 (setq cursor-type nil
1034 display-busy-cursor nil 1027 display-busy-cursor nil
1035 mode-line-format 1028 mode-line-format
1036 (propertize "---- %b %-" 'face '(:weight bold)) 1029 (propertize "---- %b %-" 'face '(:weight bold))
1037 timer (run-with-timer 0 5 #'fancy-splash-screens-1 1030 timer (run-with-timer 0 5 #'fancy-splash-screens-1
1038 splash-buffer)) 1031 splash-buffer))
1039 (add-hook 'pre-command-hook 'fancy-splash-pre-command) 1032 (add-hook 'pre-command-hook 'fancy-splash-pre-command)
1040 (recursive-edit)) 1033 (recursive-edit))
1041 (cancel-timer timer) 1034 (cancel-timer timer)
1042 (remove-hook 'pre-command-hook 'fancy-splash-pre-command) 1035 (remove-hook 'pre-command-hook 'fancy-splash-pre-command)
1043 (use-global-map old-global-map)
1044 (setq display-busy-cursor old-busy-cursor) 1036 (setq display-busy-cursor old-busy-cursor)
1045 (kill-buffer splash-buffer)))) 1037 (kill-buffer splash-buffer))))
1046 1038
1047 1039
1048 (defun startup-echo-area-message () 1040 (defun startup-echo-area-message ()