comparison lisp/startup.el @ 370:d56e16bd220a

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Thu, 01 Aug 1991 18:50:36 +0000
parents ecc1a00366a3
children 9dab5ca1890f
comparison
equal deleted inserted replaced
369:7f92840f8be4 370:d56e16bd220a
71 argi (the current argument) and command-line-args-left (the remaining 71 argi (the current argument) and command-line-args-left (the remaining
72 arguments). The function should return non-nil only if it recognizes and 72 arguments). The function should return non-nil only if it recognizes and
73 processes argi. If it does so, it may consume successive arguments by 73 processes argi. If it does so, it may consume successive arguments by
74 altering command-line-args-left to remove them.") 74 altering command-line-args-left to remove them.")
75 75
76 (defvar pre-init-hook nil
77 "Functions to call after handling urgent options but before loading init file.
78 The window/screen system uses this to open screens to display messages while
79 Emacs loads the user's initialization file.")
80
76 (defvar term-setup-hook nil 81 (defvar term-setup-hook nil
77 "Function to be called after loading terminal-specific lisp code. 82 "Function to be called after loading terminal-specific lisp code.
78 It is called with no arguments. This variable exists for users to set, 83 It is called with no arguments. This variable exists for users to set,
79 so as to override the definitions made by the terminal-specific file. 84 so as to override the definitions made by the terminal-specific file.
80 Emacs never sets this variable itself.") 85 Emacs never sets this variable itself.")
83 "The brand of keyboard you are using. This variable is used to define 88 "The brand of keyboard you are using. This variable is used to define
84 the proper function and keypad keys for use under X. It is used in a 89 the proper function and keypad keys for use under X. It is used in a
85 fashion analogous to the environment value TERM.") 90 fashion analogous to the environment value TERM.")
86 91
87 (defvar window-setup-hook nil 92 (defvar window-setup-hook nil
88 "Function used to initialize window system display, after command line args. 93 "Function called to initialize window system display.
94 Emacs calls this after processing the command line arguments and loading
95 the user's init file.
96
89 Users should not set this variable; use term-setup-hook instead.") 97 Users should not set this variable; use term-setup-hook instead.")
90 98
91 (defconst initial-major-mode 'lisp-interaction-mode 99 (defconst initial-major-mode 'lisp-interaction-mode
92 "Major mode command symbol to use for the initial *scratch* buffer.") 100 "Major mode command symbol to use for the initial *scratch* buffer.")
93 101
185 args (cdr args))) 193 args (cdr args)))
186 (t (setq done t))))) 194 (t (setq done t)))))
187 195
188 ;; Re-attach the program name to the front of the arg list. 196 ;; Re-attach the program name to the front of the arg list.
189 (setcdr command-line-args args)) 197 (setcdr command-line-args args))
198
199 ;; If the window system asked to, let it set up some initial screens.
200 (if pre-init-hook (funcall pre-init-hook))
190 201
191 ;; Load that user's init file, or the default one, or none. 202 ;; Load that user's init file, or the default one, or none.
192 (let ((debug-on-error init-file-debug) 203 (let ((debug-on-error init-file-debug)
193 ;; This function actually reads the init files. 204 ;; This function actually reads the init files.
194 (inner 205 (inner
213 (funcall inner) 224 (funcall inner)
214 (error (message "Error in init file: %s%s%s" 225 (error (message "Error in init file: %s%s%s"
215 (get (car error) 'error-message) 226 (get (car error) 'error-message)
216 (if (cdr error) ": ") 227 (if (cdr error) ": ")
217 (mapconcat 'prin1-to-string (cdr error) ", ")))))) 228 (mapconcat 'prin1-to-string (cdr error) ", "))))))
229
218 ;; If *scratch* exists and init file didn't change its mode, initialize it. 230 ;; If *scratch* exists and init file didn't change its mode, initialize it.
219 (if (get-buffer "*scratch*") 231 (if (get-buffer "*scratch*")
220 (save-excursion 232 (save-excursion
221 (set-buffer "*scratch*") 233 (set-buffer "*scratch*")
222 (if (eq major-mode 'fundamental-mode) 234 (if (eq major-mode 'fundamental-mode)
258 (setq window-setup-hook nil) 270 (setq window-setup-hook nil)
259 (unwind-protect 271 (unwind-protect
260 (progn 272 (progn
261 (insert (emacs-version) 273 (insert (emacs-version)
262 " 274 "
263 Copyright (C) 1989 Free Software Foundation, Inc.\n\n") 275 Copyright (C) 1991 Free Software Foundation, Inc.\n\n")
264 ;; If keys have their default meanings, 276 ;; If keys have their default meanings,
265 ;; use precomputed string to save lots of time. 277 ;; use precomputed string to save lots of time.
266 (if (and (eq (key-binding "\C-h") 'help-command) 278 (if (and (eq (key-binding "\C-h") 'help-command)
267 (eq (key-binding "\C-xu") 'advertised-undo) 279 (eq (key-binding "\C-xu") 'advertised-undo)
268 (eq (key-binding "\C-x\C-c") 'save-buffers-kill-emacs) 280 (eq (key-binding "\C-x\C-c") 'save-buffers-kill-emacs)