diff options
| author | Gerd Moellmann | 2000-09-19 13:28:27 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-09-19 13:28:27 +0000 |
| commit | ce9ded5de26ead5cc69bd9179662c2d6600f7500 (patch) | |
| tree | ea76a553f9dc3679382f4e023b84f2302d44a246 | |
| parent | 6badfa25d2ba5e3fcf5e2498d2535096c76b4dc1 (diff) | |
| download | emacs-ce9ded5de26ead5cc69bd9179662c2d6600f7500.tar.gz emacs-ce9ded5de26ead5cc69bd9179662c2d6600f7500.zip | |
(fancy-splash-text): New variable.
(fancy-splash-delay, fancy-splash-image): New user-options.
(fancy-splash-insert, fancy-splash-head, fancy-splash-tail)
(fancy-splash-screens): New functions.
(command-line-1): If display has a `display' frame parameter, has
colors, and we have XPM support, show more fancy splash screens.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/startup.el | 124 |
2 files changed, 129 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 41376f5b764..faabcbd7430 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2000-09-19 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * startup.el (fancy-splash-text): New variable. | ||
| 4 | (fancy-splash-delay, fancy-splash-image): New user-options. | ||
| 5 | (fancy-splash-insert, fancy-splash-head, fancy-splash-tail) | ||
| 6 | (fancy-splash-screens): New functions. | ||
| 7 | (command-line-1): If display has a `display' frame parameter, has | ||
| 8 | colors, and we have XPM support, show more fancy splash screens. | ||
| 9 | |||
| 1 | 2000-09-19 Dave Love <fx@gnu.org> | 10 | 2000-09-19 Dave Love <fx@gnu.org> |
| 2 | 11 | ||
| 3 | * map-ynp.el (map-y-or-n-p): Check use-dialog-box. Don't lose | 12 | * map-ynp.el (map-y-or-n-p): Check use-dialog-box. Don't lose |
diff --git a/lisp/startup.el b/lisp/startup.el index cf6208becd1..bb2bb667be3 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -836,6 +836,119 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." | |||
| 836 | If this is nil, no message will be displayed." | 836 | If this is nil, no message will be displayed." |
| 837 | :type 'string) | 837 | :type 'string) |
| 838 | 838 | ||
| 839 | |||
| 840 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
| 841 | ;;; Fancy splash screen | ||
| 842 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
| 843 | |||
| 844 | (defvar fancy-splash-text | ||
| 845 | '((:face 'variable-pitch | ||
| 846 | "The menu bar and scroll bar are sufficient \ | ||
| 847 | for basic editing with the mouse.\n\n" | ||
| 848 | :face '(variable-pitch :weight bold) | ||
| 849 | "Useful Files menu items:\n" | ||
| 850 | :face 'variable-pitch "\ | ||
| 851 | Exit Emacs (or type Control-x followed by Control-c) | ||
| 852 | Recover Session recover files you were editing before a crash | ||
| 853 | |||
| 854 | |||
| 855 | " | ||
| 856 | ) | ||
| 857 | (:face 'variable-pitch | ||
| 858 | "The menu bar and scroll bar are sufficient \ | ||
| 859 | for basic editing with the mouse.\n\n" | ||
| 860 | :face '(variable-pitch :weight bold) | ||
| 861 | "Important Help menu items:\n" | ||
| 862 | :face 'variable-pitch "\ | ||
| 863 | Emacs Tutorial Learn-by-doing tutorial for using Emacs efficiently. | ||
| 864 | Emacs FAQ Frequently asked questions and answers | ||
| 865 | \(Non)Warranty GNU Emacs comes with " | ||
| 866 | :face '(variable-pitch :slant oblique) | ||
| 867 | "ABSOLUTELY NO WARRANTY\n" | ||
| 868 | :face `variable-pitch | ||
| 869 | "Copying Conditions Conditions for redistributing and \ | ||
| 870 | changing Emacs\n")) | ||
| 871 | "A list of texts to show in the middle part of splash screens. | ||
| 872 | Each element in the list should be a list of strings or pairs | ||
| 873 | `:face FACE', like `fancy-splash-insert' accepts them.") | ||
| 874 | |||
| 875 | |||
| 876 | (defcustom fancy-splash-delay 5 | ||
| 877 | "Delay in seconds between splash screens." | ||
| 878 | :group 'splash-screen | ||
| 879 | :type 'integer) | ||
| 880 | |||
| 881 | |||
| 882 | (defcustom fancy-splash-image "splash.xpm" | ||
| 883 | "The image to show in the splash screens." | ||
| 884 | :group 'splash-screen | ||
| 885 | :type 'file) | ||
| 886 | |||
| 887 | |||
| 888 | (defun fancy-splash-insert (&rest args) | ||
| 889 | "Insert text into the current buffer, with faces. | ||
| 890 | Arguments from ARGS should be either strings or pairs `:face FACE', | ||
| 891 | where FACE is a valid face specification, as it can be used with | ||
| 892 | `put-text-properties'." | ||
| 893 | (let ((current-face nil)) | ||
| 894 | (while args | ||
| 895 | (if (eq (car args) :face) | ||
| 896 | (setq args (cdr args) current-face (car args)) | ||
| 897 | (insert (propertize (car args) 'face current-face))) | ||
| 898 | (setq args (cdr args))))) | ||
| 899 | |||
| 900 | |||
| 901 | (defun fancy-splash-head () | ||
| 902 | "Insert the head part of the splash screen into the current buffer." | ||
| 903 | (let* ((img (create-image fancy-splash-image)) | ||
| 904 | (image-width (and img (car (image-size img)))) | ||
| 905 | (window-width (window-width (selected-window)))) | ||
| 906 | (when img | ||
| 907 | (when (> window-width image-width) | ||
| 908 | (let ((pos (/ (- window-width image-width) 2))) | ||
| 909 | (insert (propertize " " 'display `(space :align-to ,pos)))) | ||
| 910 | (insert-image img) | ||
| 911 | (insert "\n")))) | ||
| 912 | (when (eq system-type 'gnu/linux) | ||
| 913 | (fancy-splash-insert | ||
| 914 | :face '(variable-pitch :foreground "red") | ||
| 915 | "GNU Emacs is one component of a Linux-based GNU system.")) | ||
| 916 | (insert "\n")) | ||
| 917 | |||
| 918 | |||
| 919 | (defun fancy-splash-tail () | ||
| 920 | "Insert the tail part of the splash screen into the current buffer." | ||
| 921 | (fancy-splash-insert | ||
| 922 | :face '(variable-pitch :foreground "darkblue") | ||
| 923 | "\nThis is " | ||
| 924 | (emacs-version) | ||
| 925 | "\n" | ||
| 926 | :face '(variable-pitch :height 0.5) | ||
| 927 | "Copyright (C) 2000 Free Software Foundation, Inc.")) | ||
| 928 | |||
| 929 | |||
| 930 | (defun fancy-splash-screens () | ||
| 931 | (let* ((old-cursor-type cursor-type) | ||
| 932 | stop) | ||
| 933 | (unwind-protect | ||
| 934 | (progn | ||
| 935 | (setq cursor-type nil) | ||
| 936 | (while (not stop) | ||
| 937 | (let ((texts fancy-splash-text)) | ||
| 938 | (while (and texts (not stop)) | ||
| 939 | (erase-buffer) | ||
| 940 | (fancy-splash-head) | ||
| 941 | (apply #'fancy-splash-insert (car texts)) | ||
| 942 | (fancy-splash-tail) | ||
| 943 | (goto-char (point-min)) | ||
| 944 | (set-buffer-modified-p nil) | ||
| 945 | (force-mode-line-update) | ||
| 946 | (setq texts (cdr texts)) | ||
| 947 | (setq stop (not (sit-for fancy-splash-delay))))))) | ||
| 948 | (setq cursor-type old-cursor-type)) | ||
| 949 | (erase-buffer))) | ||
| 950 | |||
| 951 | |||
| 839 | (defun command-line-1 (command-line-args-left) | 952 | (defun command-line-1 (command-line-args-left) |
| 840 | (or noninteractive (input-pending-p) init-file-had-error | 953 | (or noninteractive (input-pending-p) init-file-had-error |
| 841 | (and inhibit-startup-echo-area-message | 954 | (and inhibit-startup-echo-area-message |
| @@ -910,8 +1023,11 @@ If this is nil, no message will be displayed." | |||
| 910 | (insert ", one component of a Linux-based GNU system.")) | 1023 | (insert ", one component of a Linux-based GNU system.")) |
| 911 | (insert "\n") | 1024 | (insert "\n") |
| 912 | (if (assq 'display (frame-parameters)) | 1025 | (if (assq 'display (frame-parameters)) |
| 913 | (progn | 1026 | (if (and (display-color-p) |
| 914 | (insert "\ | 1027 | (image-type-available-p 'xpm)) |
| 1028 | (fancy-splash-screens) | ||
| 1029 | (progn | ||
| 1030 | (insert "\ | ||
| 915 | The menu bar and scroll bar are sufficient for basic editing with the mouse. | 1031 | The menu bar and scroll bar are sufficient for basic editing with the mouse. |
| 916 | 1032 | ||
| 917 | Useful Files menu items: | 1033 | Useful Files menu items: |
| @@ -925,9 +1041,9 @@ Emacs FAQ Frequently asked questions and answers | |||
| 925 | Copying Conditions Conditions for redistributing and changing Emacs. | 1041 | Copying Conditions Conditions for redistributing and changing Emacs. |
| 926 | Getting New Versions How to obtain the latest version of Emacs. | 1042 | Getting New Versions How to obtain the latest version of Emacs. |
| 927 | ") | 1043 | ") |
| 928 | (insert "\n\n" (emacs-version) | 1044 | (insert "\n\n" (emacs-version) |
| 929 | " | 1045 | " |
| 930 | Copyright (C) 2000 Free Software Foundation, Inc.")) | 1046 | Copyright (C) 2000 Free Software Foundation, Inc."))) |
| 931 | ;; If keys have their default meanings, | 1047 | ;; If keys have their default meanings, |
| 932 | ;; use precomputed string to save lots of time. | 1048 | ;; use precomputed string to save lots of time. |
| 933 | (if (and (eq (key-binding "\C-h") 'help-command) | 1049 | (if (and (eq (key-binding "\C-h") 'help-command) |