428
|
1 ;;; startup.el --- process XEmacs shell arguments
|
|
2
|
|
3 ;; Copyright (C) 1985-1986, 1990, 1992-1997 Free Software Foundation, Inc.
|
|
4 ;; Copyright (c) 1993, 1994 Sun Microsystems, Inc.
|
|
5 ;; Copyright (C) 1995 Board of Trustees, University of Illinois
|
771
|
6 ;; Copyright (C) 2001, 2002 Ben Wing.
|
428
|
7
|
|
8 ;; Maintainer: XEmacs Development Team
|
|
9 ;; Keywords: internal, dumped
|
|
10
|
|
11 ;; This file is part of XEmacs.
|
|
12
|
|
13 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
14 ;; under the terms of the GNU General Public License as published by
|
|
15 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
16 ;; any later version.
|
|
17
|
|
18 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
21 ;; General Public License for more details.
|
|
22
|
|
23 ;; You should have received a copy of the GNU General Public License
|
442
|
24 ;; along with XEmacs; see the file COPYING. If not, write to the
|
428
|
25 ;; Free Software Foundation, 59 Temple Place - Suite 330,
|
|
26 ;; Boston, MA 02111-1307, USA.
|
|
27
|
|
28 ;;; Synched up with: FSF 19.34.
|
|
29
|
|
30 ;;; Commentary:
|
|
31
|
|
32 ;; This file is dumped with XEmacs.
|
|
33
|
502
|
34 ;; It handles the all aspects of startup once the C code has finished
|
|
35 ;; initializing itself. Entry from C is through the function set in
|
|
36 ;; the `top-level' variable, which is normally `normal-top-level'. At
|
|
37 ;; the point that `normal-top-level' has been invoked:
|
|
38 ;;
|
|
39 ;; (1) the dumped Elisp files are available. Either they were loaded
|
|
40 ;; during this invocation of temacs and it was then converted to
|
|
41 ;; XEmacs using the run-temacs mechanism, or (more likely) the
|
|
42 ;; loadup and dumping occurred at some point in the past and we
|
|
43 ;; just read in the dumped data.
|
|
44 ;;
|
|
45 ;; (2) All C subsystems have been initialized.
|
|
46 ;;
|
|
47 ;; (3) A "stream" device has been created, which does I/O over stdin
|
|
48 ;; and stdout. This is the only device we have available and our
|
|
49 ;; only means of communication, other than disk files.
|
|
50 ;;
|
|
51 ;; (4) The command-line arguments have been sorted according to
|
|
52 ;; priority specs (this implies that the names of all arguments
|
|
53 ;; must be hard-coded into emacs.c), and certain low-level
|
|
54 ;; arguments such as -sd, -t, -nd, -nw, -batch, etc. have been
|
|
55 ;; processed by main_1() and removed. (NOTE: main_1() is the name
|
|
56 ;; in the source code, but in the object file it has some other
|
|
57 ;; name, such as xemacs_21_2_34_mips_sgi_irix6().) Certain other
|
|
58 ;; arguments such as -version and -help are partially-processed,
|
|
59 ;; triggering some special behavior but being left on the list for
|
|
60 ;; further processing by the Lisp code.
|
|
61 ;;
|
|
62 ;; The job of the code here is to process the remaining command-line
|
|
63 ;; args, set up the various paths, locate where all the packages are
|
|
64 ;; and set things up for them (initialize the load path, read in the
|
|
65 ;; autoloads, etc.), read in the init files, display the splash
|
|
66 ;; screen, and set up any remaining environment-dependent variables.
|
428
|
67
|
|
68 ;;; Code:
|
|
69
|
|
70 (setq top-level '(normal-top-level))
|
|
71
|
|
72 (defvar command-line-processed nil "t once command line has been processed")
|
|
73
|
|
74 (defconst startup-message-timeout 12000) ; More or less disable the timeout
|
|
75 (defconst splash-frame-timeout 7) ; interval between splash frame elements
|
|
76
|
|
77 (defconst inhibit-startup-message nil
|
|
78 "*Non-nil inhibits the initial startup message.
|
|
79 This is for use in your personal init file, once you are familiar
|
|
80 with the contents of the startup message.")
|
|
81
|
|
82 ;; #### FSFmacs randomness
|
|
83 ;;(defconst inhibit-startup-echo-area-message nil
|
|
84 ;; "*Non-nil inhibits the initial startup echo area message.
|
|
85 ;;Inhibition takes effect only if your `.emacs' file contains
|
|
86 ;;a line of this form:
|
|
87 ;; (setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\")
|
|
88 ;;If your `.emacs' file is byte-compiled, use the following form instead:
|
|
89 ;; (eval '(setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\"))
|
|
90 ;;Thus, someone else using a copy of your `.emacs' file will see
|
|
91 ;;the startup message unless he personally acts to inhibit it.")
|
|
92
|
|
93 (defconst inhibit-default-init nil
|
|
94 "*Non-nil inhibits loading the `default' library.")
|
|
95
|
|
96 (defvar command-line-args-left nil
|
|
97 "List of command-line args not yet processed.") ; bound by `command-line'
|
|
98
|
|
99 (defvar command-line-default-directory nil
|
|
100 "Default directory to use for command line arguments.
|
|
101 This is normally copied from `default-directory' when XEmacs starts.")
|
|
102
|
|
103 (defvar before-init-hook nil
|
|
104 "Functions to call after handling urgent options but before init files.
|
|
105 The frame system uses this to open frames to display messages while
|
|
106 XEmacs loads the user's initialization file.")
|
|
107
|
|
108 (defvar after-init-hook nil
|
452
|
109 "*Functions to call after loading the init file.
|
428
|
110 The call is not protected by a condition-case, so you can set `debug-on-error'
|
452
|
111 in the init file, and put all the actual code on `after-init-hook'.")
|
428
|
112
|
|
113 (defvar term-setup-hook nil
|
|
114 "*Functions to be called after loading terminal-specific Lisp code.
|
|
115 See `run-hooks'. This variable exists for users to set, so as to
|
|
116 override the definitions made by the terminal-specific file. XEmacs
|
|
117 never sets this variable itself.")
|
|
118
|
|
119 (defvar keyboard-type nil
|
|
120 "The brand of keyboard you are using.
|
|
121 This variable is used to define the proper function and keypad keys
|
|
122 for use under X. It is used in a fashion analogous to the environment
|
|
123 value TERM.")
|
|
124
|
|
125 (defvar window-setup-hook nil
|
|
126 "Normal hook run to initialize window system display.
|
|
127 XEmacs runs this hook after processing the command line arguments and loading
|
|
128 the user's init file.")
|
|
129
|
|
130 (defconst initial-major-mode 'lisp-interaction-mode
|
|
131 "Major mode command symbol to use for the initial *scratch* buffer.")
|
|
132
|
|
133 (defvar emacs-roots nil
|
|
134 "List of plausible roots of the XEmacs hierarchy.")
|
|
135
|
|
136 (defvar user-init-directory-base ".xemacs"
|
|
137 "Base of directory where user-installed init files may go.")
|
|
138
|
|
139 (defvar user-init-directory
|
|
140 (file-name-as-directory
|
|
141 (paths-construct-path (list "~" user-init-directory-base)))
|
|
142 "Directory where user-installed init files may go.")
|
|
143
|
442
|
144 (defvar user-init-file-base "init.el"
|
|
145 "Default name of the user init file if uncompiled.
|
|
146 This should be used for migration purposes only.")
|
|
147
|
|
148 (defvar user-init-file-base-list '("init.elc" "init.el")
|
|
149 "List of allowed init files in the user's init directory.
|
|
150 The first one found takes precedence.")
|
|
151
|
|
152 (defvar user-home-init-file-base-list
|
|
153 (append '(".emacs.elc" ".emacs.el" ".emacs")
|
|
154 (and (eq system-type 'windows-nt)
|
|
155 '("_emacs.elc" "_emacs.el" "_emacs")))
|
|
156 "List of allowed init files in the user's home directory.
|
|
157 The first one found takes precedence.")
|
|
158
|
|
159 (defvar load-home-init-file nil
|
|
160 "Non-nil if XEmacs should load the init file from the home directory.
|
|
161 Otherwise, XEmacs will offer migration to the init directory.")
|
|
162
|
428
|
163 (defvar load-user-init-file-p t
|
|
164 "Non-nil if XEmacs should load the user's init file.")
|
|
165
|
|
166 ;; #### called `site-run-file' in FSFmacs
|
|
167
|
444
|
168 (defvar site-start-file "site-start"
|
428
|
169 "File containing site-wide run-time initializations.
|
|
170 This file is loaded at run-time before `.emacs'. It
|
|
171 contains inits that need to be in place for the entire site, but
|
|
172 which, due to their higher incidence of change, don't make sense to
|
|
173 load into XEmacs' dumped image. Thus, the run-time load order is:
|
|
174
|
|
175 1. file described in this variable, if non-nil;
|
|
176 2. `.emacs';
|
|
177 3. `/path/to/xemacs/lisp/default.el'.
|
|
178
|
|
179 Don't use the `site-start.el' file for things some users may not like.
|
|
180 Put them in `default.el' instead, so that users can more easily
|
|
181 override them. Users can prevent loading `default.el' with the `-q'
|
|
182 option or by setting `inhibit-default-init' in their own init files,
|
|
183 but inhibiting `site-start.el' requires `--no-site-file', which
|
|
184 is less convenient.")
|
|
185
|
|
186 ;;(defconst iso-8859-1-locale-regexp "8859[-_]?1"
|
|
187 ;; "Regexp that specifies when to enable the ISO 8859-1 character set.
|
|
188 ;;We do that if this regexp matches the locale name
|
|
189 ;;specified by the LC_ALL, LC_CTYPE and LANG environment variables.")
|
|
190
|
442
|
191 (defcustom mail-host-address nil
|
|
192 "*Name of this machine, for purposes of naming users."
|
|
193 :type 'string
|
|
194 :group 'mail)
|
428
|
195
|
442
|
196 (defcustom user-mail-address nil
|
428
|
197 "*Full mailing address of this user.
|
|
198 This is initialized based on `mail-host-address',
|
442
|
199 after your init file is read, in case it sets `mail-host-address'."
|
|
200 :type 'string
|
|
201 :group 'mail)
|
428
|
202
|
|
203 (defvar init-file-debug nil)
|
|
204
|
|
205 (defvar init-file-had-error nil)
|
|
206
|
|
207 (defvar init-file-loaded nil
|
|
208 "True after the user's init file has been loaded (or suppressed with -q).
|
|
209 This will be true when `after-init-hook' is run and at all times
|
|
210 after, and will not be true at any time before.")
|
|
211
|
|
212 (defvar initial-frame-unmapped-p nil)
|
|
213
|
|
214
|
|
215
|
|
216 (defvar command-switch-alist
|
444
|
217 '(("-help" . command-line-do-help)
|
771
|
218 ("-version" . command-line-do-version)
|
444
|
219 ("-V" . command-line-do-version)
|
771
|
220 ("-funcall" . command-line-do-funcall)
|
444
|
221 ("-f" . command-line-do-funcall)
|
|
222 ("-e" . command-line-do-funcall-1)
|
|
223 ("-eval" . command-line-do-eval)
|
|
224 ("-load" . command-line-do-load)
|
|
225 ("-l" . command-line-do-load)
|
|
226 ("-insert" . command-line-do-insert)
|
|
227 ("-i" . command-line-do-insert)
|
|
228 ("-kill" . command-line-do-kill)
|
771
|
229 ("-eol" . command-line-do-enable-eol-detection)
|
444
|
230 ;; Options like +35 are handled specially.
|
|
231 ;; Window-system, site, or package-specific code might add to this.
|
|
232 ;; X11 handles its options by letting Xt remove args from this list.
|
|
233 )
|
428
|
234 "Alist of command-line switches.
|
|
235 Elements look like (SWITCH-STRING . HANDLER-FUNCTION).
|
|
236 HANDLER-FUNCTION receives switch name as sole arg;
|
|
237 remaining command-line args are in the variable `command-line-args-left'.")
|
|
238
|
|
239 ;;; default switches
|
|
240 ;;; Note: these doc strings are semi-magical.
|
|
241
|
|
242 (defun command-line-do-help (arg)
|
|
243 "Print the XEmacs usage message and exit."
|
|
244 (let ((standard-output 'external-debugging-output))
|
|
245 (princ (concat "\n" (emacs-version) "\n\n"))
|
|
246 (princ
|
|
247 (if (featurep 'x)
|
|
248 (concat "When creating a window on an X display, "
|
|
249 (emacs-name)
|
|
250 " accepts all standard X Toolkit
|
|
251 command line options plus the following:
|
|
252 -iconname <title> Use title as the icon name.
|
|
253 -mc <color> Use color as the mouse color.
|
|
254 -cr <color> Use color as the text-cursor foregound color.
|
|
255 -private Install a private colormap.
|
|
256
|
|
257 In addition, the")
|
|
258 "The"))
|
771
|
259 (let ((l command-switch-alist)
|
|
260 (options " following options are accepted:
|
|
261
|
|
262 Display options:
|
|
263
|
|
264 -nw Open the initial frame on the current TTY, instead of
|
|
265 a window system.
|
|
266 -t <device> Use TTY <device> instead of the current TTY for input
|
|
267 and output. This implies the -nw option.
|
|
268 -display <display> Standard X option, to specify the display connection.
|
|
269 If this option is given, or if the environment
|
|
270 variable DISPLAY is set, an initial X frame will be
|
|
271 created. Otherwise, an initial Windows frame will be
|
|
272 created if Windows support exists and neither -nw nor
|
|
273 -t is given. Otherwise, a TTY frame is created.
|
|
274 -unmapped Do not display the initial frame. Useful to create
|
|
275 a \"server\" that can accept `gnuclient' connections.
|
|
276
|
|
277 Noninteractive options:
|
|
278
|
|
279 {-help}
|
|
280 {-version}
|
|
281 {-V}
|
|
282 -batch Execute noninteractively (messages go to stderr, no
|
|
283 initial frame created).
|
|
284 {-funcall}
|
|
285 (The function may parse the rest of the command line
|
|
286 for its arguments.)
|
|
287 {-f}
|
|
288 {-eval}
|
|
289 {-load}
|
|
290 {-l}
|
|
291 {-insert}
|
|
292 {-i}
|
|
293 {-kill}
|
446
|
294 -sd Show dump ID. Ignored when configured without --pdump.
|
|
295 -nd Don't load the dump file. Roughly like old temacs.
|
|
296 Ignored when configured without --pdump.
|
771
|
297
|
|
298 Initialization files:
|
|
299
|
|
300 -no-init-file Do not load the user-specific init file.
|
|
301 -q Same as -no-init-file.
|
428
|
302 -debug-init Enter the debugger if an error in the init file occurs.
|
771
|
303 -user-init-file <file>
|
|
304 Use <file> as init file.
|
|
305 -user-init-directory <directory>
|
|
306 Use <directory> as init directory.
|
|
307 -user <user> Load user's init file instead of your own.
|
|
308 -u <user> Same as -user.
|
|
309 -no-site-file Do not load the site-specific init file
|
|
310 (site-start.el).
|
|
311
|
|
312 Package/module options:
|
|
313
|
428
|
314 -no-early-packages Do not process early packages.
|
771
|
315 -vanilla Equivalent to -q -no-site-file -no-early-packages.
|
428
|
316 -no-autoloads Do not load global symbol files (auto-autoloads) at
|
|
317 startup. Also implies `-vanilla'.
|
771
|
318 -debug-paths Display info about the runtime values of various
|
|
319 directory variables (e.g. for loading packages).
|
|
320 -no-site-modules Do not search site-modules directories for modules
|
|
321 at startup. Only applies when modules support is
|
|
322 compiled into XEmacs.
|
|
323
|
|
324 Encoding options:
|
|
325
|
|
326 -eol Turn on EOL detection (only applies to Unix, no
|
|
327 international support; otherwise EOL detection is
|
|
328 already on).
|
|
329 -nuni Under MS Windows, disable use of the Unicode versions
|
|
330 of API calls. Not for Windows 95/98/ME. This is
|
|
331 mostly only useful for debugging purposes.
|
|
332
|
|
333 Misc:
|
|
334
|
|
335 +N <file> Start displaying <file> at line N.
|
|
336 ")
|
428
|
337 (insert (lambda (&rest x)
|
|
338 (let ((len 2))
|
|
339 (while x
|
|
340 (princ (car x))
|
|
341 (incf len (length (car x)))
|
|
342 (setq x (cdr x)))
|
|
343 (when (>= len 24)
|
|
344 (terpri) (setq len 0))
|
|
345 (while (< len 24)
|
|
346 (princ " ")
|
|
347 (incf len))))))
|
771
|
348 (princ
|
|
349 (with-temp-buffer
|
|
350 (insert options)
|
|
351 (while l
|
|
352 (let ((name (car (car l)))
|
|
353 (fn (cdr (car l)))
|
|
354 doc arg cons)
|
|
355 (cond
|
|
356 ((and (symbolp fn) (get fn 'undocumented)) nil)
|
|
357 (t
|
|
358 (setq doc (documentation fn))
|
|
359 (if (member doc '(nil "")) (setq doc "(undocumented)"))
|
|
360 (cond ((string-match "\n\\(<.*>\\)\n?\\'" doc)
|
|
361 ;; Doc of the form "The frobber switch\n<arg1> <arg2>"
|
|
362 (setq arg (substring doc (match-beginning 1) (match-end 1))
|
|
363 doc (substring doc 0 (match-beginning 0))))
|
|
364 ((string-match "\n+\\'" doc)
|
|
365 (setq doc (substring doc 0 (match-beginning 0)))))
|
|
366 (if (and (setq cons (rassq fn command-switch-alist))
|
|
367 (not (eq cons (car l))))
|
|
368 (setq doc (format "Same as %s." (car cons))))
|
|
369 (goto-char (point-min))
|
|
370 (when (search-forward (format "{%s}" name) nil t)
|
|
371 (delete-region (match-beginning 0) (match-end 0))
|
|
372 (let ((standard-output (current-buffer)))
|
|
373 (if arg
|
|
374 (funcall insert name " " arg)
|
|
375 (funcall insert name))
|
|
376 (princ doc))))))
|
|
377 (setq l (cdr l)))
|
|
378 (buffer-string))))
|
428
|
379 (princ (concat "\
|
|
380
|
|
381 Anything else is considered a file name, and is placed into a buffer for
|
|
382 editing.
|
|
383
|
|
384 " (emacs-name) " has an online tutorial and manuals. Type ^Ht (Control-h t) after
|
|
385 starting XEmacs to run the tutorial. Type ^Hi to enter the manual browser.
|
771
|
386 Type ^H^H^H (Control-h Control-h Control-h) to get more help options.\n"))
|
428
|
387
|
771
|
388 (kill-emacs 0)
|
|
389 ))
|
428
|
390
|
|
391 (defun command-line-do-funcall (arg)
|
|
392 "Invoke the named lisp function with no arguments.
|
|
393 <function>"
|
|
394 (funcall (intern (pop command-line-args-left))))
|
|
395 (fset 'command-line-do-funcall-1 'command-line-do-funcall)
|
|
396 (put 'command-line-do-funcall-1 'undocumented t)
|
|
397
|
|
398 (defun command-line-do-eval (arg)
|
|
399 "Evaluate the lisp form. Quote it carefully.
|
|
400 <form>"
|
|
401 (eval (read (pop command-line-args-left))))
|
|
402
|
|
403 (defun command-line-do-load (arg)
|
|
404 "Load the named file of Lisp code into XEmacs.
|
|
405 <file>"
|
|
406 (let ((file (pop command-line-args-left)))
|
|
407 ;; Take file from default dir if it exists there;
|
|
408 ;; otherwise let `load' search for it.
|
|
409 (if (file-exists-p (expand-file-name file))
|
|
410 (setq file (expand-file-name file)))
|
|
411 (load file nil t)))
|
|
412
|
|
413 (defun command-line-do-insert (arg)
|
|
414 "Insert file into the current buffer.
|
|
415 <file>"
|
|
416 (insert-file-contents (pop command-line-args-left)))
|
|
417
|
|
418 (defun command-line-do-kill (arg)
|
|
419 "Exit XEmacs."
|
|
420 (kill-emacs t))
|
|
421
|
|
422 (defun command-line-do-version (arg)
|
|
423 "Print version info and exit."
|
|
424 (princ (concat (emacs-version) "\n"))
|
|
425 (kill-emacs 0))
|
|
426
|
771
|
427 (defun command-line-do-enable-eol-detection (arg)
|
|
428 "Turn on EOL detection (only applies to Unix)."
|
|
429 (set-eol-detection t))
|
|
430
|
428
|
431
|
|
432 ;;; Processing the command line and loading various init files
|
|
433
|
|
434 (defun early-error-handler (&rest debugger-args)
|
|
435 "You should probably not be using this."
|
|
436 ;; Used as the debugger during XEmacs initialization; if an error occurs,
|
|
437 ;; print some diagnostics, and kill XEmacs.
|
|
438
|
|
439 ;; output the contents of the warning buffer, since it won't be seen
|
|
440 ;; otherwise.
|
|
441 ;; #### kludge! The call to Feval forces the pending warnings to
|
|
442 ;; get output. There definitely needs to be a better way.
|
|
443 (let ((buffer (eval (get-buffer-create "*Warnings*"))))
|
|
444 (princ (buffer-substring (point-min buffer) (point-max buffer) buffer)
|
|
445 'external-debugging-output))
|
|
446
|
|
447 (let ((string "Initialization error")
|
|
448 (error (nth 1 debugger-args))
|
|
449 (debug-on-error nil)
|
|
450 (stream 'external-debugging-output))
|
|
451 (if (null error)
|
|
452 (princ string stream)
|
|
453 (princ (concat "\n" string ": ") stream)
|
|
454 (condition-case ()
|
|
455 (display-error error stream)
|
|
456 (error (princ "<<< error printing error message >>>" stream)))
|
|
457 (princ "\n" stream)
|
|
458 (if (memq (car-safe error) '(void-function void-variable))
|
|
459 (princ "
|
|
460 This probably means that XEmacs is picking up an old version of
|
|
461 the lisp library, or that some .elc files are not up-to-date.\n"
|
|
462 stream)))
|
|
463 (when (not suppress-early-error-handler-backtrace)
|
|
464 (let ((print-length 1000)
|
|
465 (print-level 1000)
|
|
466 (print-escape-newlines t)
|
|
467 (print-readably nil))
|
|
468 (when (getenv "EMACSLOADPATH")
|
|
469 (princ (format "\n$EMACSLOADPATH is %s" (getenv "EMACSLOADPATH"))
|
|
470 stream))
|
|
471 (princ (format "\nexec-directory is %S" exec-directory) stream)
|
|
472 (princ (format "\ndata-directory is %S" data-directory) stream)
|
|
473 (princ (format "\ndata-directory-list is %S" data-directory-list) stream)
|
|
474 (princ (format "\ndoc-directory is %S" doc-directory) stream)
|
|
475 (princ (format "\nload-path is %S" load-path) stream)
|
|
476 (princ "\n\n" stream)))
|
|
477 (when (not suppress-early-error-handler-backtrace)
|
|
478 (backtrace stream t)))
|
442
|
479 (if (fboundp 'mswindows-message-box)
|
|
480 (mswindows-message-box "Initialization error"))
|
428
|
481 (kill-emacs -1))
|
|
482
|
|
483 (defun normal-top-level ()
|
|
484 (if command-line-processed
|
|
485 (message "Back to top level.")
|
|
486 (setq command-line-processed t)
|
771
|
487 ;; Do this first for maximum likelihood of catching errors. The main
|
|
488 ;; purpose of this is so that debug-on-error can be set to catch errors
|
|
489 ;; during normal noninteractive running.
|
|
490 (when (getenv "XEMACSDEBUG")
|
|
491 (eval (read (getenv "XEMACSDEBUG"))))
|
428
|
492 ;; Canonicalize HOME (PWD is canonicalized by init_buffer in buffer.c)
|
|
493 (let ((value (user-home-directory)))
|
|
494 (if (and value
|
|
495 (< (length value) (length default-directory))
|
|
496 (equal (file-attributes default-directory)
|
|
497 (file-attributes value)))
|
|
498 (setq default-directory (file-name-as-directory value))))
|
|
499 (setq default-directory (abbreviate-file-name default-directory))
|
|
500 (initialize-xemacs-paths)
|
|
501
|
|
502 (startup-set-invocation-environment)
|
|
503
|
|
504 (let ((debug-paths (or debug-paths
|
|
505 (and (getenv "EMACSDEBUGPATHS")
|
|
506 t))))
|
|
507
|
|
508 (setq emacs-roots (paths-find-emacs-roots invocation-directory
|
|
509 invocation-name))
|
438
|
510
|
428
|
511 (if debug-paths
|
|
512 (princ (format "emacs-roots:\n%S\n" emacs-roots)
|
|
513 'external-debugging-output))
|
438
|
514
|
428
|
515 (if (null emacs-roots)
|
458
|
516 (startup-find-roots-warning))
|
|
517 (startup-setup-paths emacs-roots
|
|
518 user-init-directory
|
|
519 inhibit-early-packages
|
|
520 inhibit-site-lisp
|
|
521 debug-paths)
|
428
|
522 (startup-setup-paths-warning))
|
|
523
|
528
|
524 (startup-load-autoloads)
|
428
|
525
|
|
526 (unwind-protect
|
|
527 (command-line)
|
452
|
528 ;; Do this again, in case the init file defined more abbreviations.
|
428
|
529 (setq default-directory (abbreviate-file-name default-directory))
|
|
530 ;; Specify the file for recording all the auto save files of
|
|
531 ;; this session. This is used by recover-session.
|
444
|
532 (if auto-save-list-file-prefix
|
|
533 (setq auto-save-list-file-name
|
|
534 (expand-file-name
|
|
535 (format "%s%d-%s"
|
|
536 auto-save-list-file-prefix
|
|
537 (emacs-pid)
|
|
538 (system-name)))))
|
428
|
539 (run-hooks 'emacs-startup-hook)
|
|
540 (and term-setup-hook
|
|
541 (run-hooks 'term-setup-hook))
|
|
542 (setq term-setup-hook nil)
|
452
|
543 ;; ;; Modify the initial frame based on what the init file puts into
|
428
|
544 ;; ;; ...-frame-alist.
|
|
545 (frame-notice-user-settings)
|
|
546 ;; ;;####FSFmacs junk
|
|
547 ;; ;; Now we know the user's default font, so add it to the menu.
|
|
548 ;; (if (fboundp 'font-menu-add-default)
|
|
549 ;; (font-menu-add-default))
|
|
550 (when window-setup-hook
|
|
551 (run-hooks 'window-setup-hook))
|
|
552 (setq window-setup-hook nil))
|
442
|
553
|
|
554 (if load-user-init-file-p
|
|
555 (maybe-migrate-user-init-file))
|
611
|
556 ;; FSF calls precompute-menubar-bindings. We don't mix menubars
|
|
557 ;; and keymaps.
|
428
|
558 ))
|
|
559
|
|
560 (defun command-line-early (args)
|
|
561 ;; This processes those switches which need to be processed before
|
|
562 ;; starting up the window system.
|
|
563
|
|
564 (setq command-line-default-directory default-directory)
|
|
565
|
|
566 ;; See if we should import version-control from the environment variable.
|
|
567 (let ((vc (getenv "VERSION_CONTROL")))
|
|
568 (cond ((eq vc nil)) ;don't do anything if not set
|
|
569 ((or (string= vc "t")
|
|
570 (string= vc "numbered"))
|
|
571 (setq version-control t))
|
|
572 ((or (string= vc "nil")
|
|
573 (string= vc "existing"))
|
|
574 (setq version-control nil))
|
|
575 ((or (string= vc "never")
|
|
576 (string= vc "simple"))
|
|
577 (setq version-control 'never))))
|
|
578
|
|
579 ;;####FSFmacs
|
|
580 ;; (if (let ((ctype
|
|
581 ;; ;; Use the first of these three envvars that has a nonempty value.
|
|
582 ;; (or (let ((string (getenv "LC_ALL")))
|
|
583 ;; (and (not (equal string "")) string))
|
|
584 ;; (let ((string (getenv "LC_CTYPE")))
|
|
585 ;; (and (not (equal string "")) string))
|
|
586 ;; (let ((string (getenv "LANG")))
|
|
587 ;; (and (not (equal string "")) string)))))
|
|
588 ;; (and ctype
|
|
589 ;; (string-match iso-8859-1-locale-regexp ctype)))
|
438
|
590 ;; (progn
|
428
|
591 ;; (standard-display-european t)
|
|
592 ;; (require 'iso-syntax)))
|
|
593
|
|
594 (setq load-user-init-file-p (not (noninteractive)))
|
|
595
|
|
596 ;; Allow (at least) these arguments anywhere in the command line
|
|
597 (let ((new-args nil)
|
|
598 (arg nil))
|
|
599 (while args
|
|
600 (setq arg (pop args))
|
|
601 (cond
|
|
602 ((or (string= arg "-q")
|
|
603 (string= arg "-no-init-file"))
|
|
604 (setq load-user-init-file-p nil))
|
|
605 ((string= arg "-no-site-file")
|
|
606 (setq site-start-file nil))
|
|
607 ((or (string= arg "-no-early-packages")
|
|
608 (string= arg "--no-early-packages"))
|
|
609 (setq inhibit-early-packages t))
|
|
610 ((or (string= arg "-vanilla")
|
|
611 (string= arg "--vanilla")
|
|
612 ;; Some work on this one already done in emacs.c.
|
|
613 (string= arg "-no-autoloads")
|
|
614 (string= arg "--no-autoloads"))
|
|
615 (setq load-user-init-file-p nil
|
|
616 site-start-file nil))
|
|
617 ((string= arg "-user-init-file")
|
|
618 (setq user-init-file (pop args)))
|
|
619 ((string= arg "-user-init-directory")
|
|
620 (setq user-init-directory (file-name-as-directory (pop args))))
|
|
621 ((or (string= arg "-u")
|
|
622 (string= arg "-user"))
|
|
623 (let* ((user (pop args))
|
|
624 (home-user (concat "~" user)))
|
442
|
625 (setq user-init-directory (file-name-as-directory
|
440
|
626 (paths-construct-path
|
442
|
627 (list home-user user-init-directory-base))))
|
|
628 (setq user-init-file
|
|
629 (find-user-init-file user-init-directory home-user))
|
|
630 (setq custom-file
|
|
631 (make-custom-file-name user-init-file))))
|
428
|
632 ((string= arg "-debug-init")
|
|
633 (setq init-file-debug t))
|
|
634 ((string= arg "-unmapped")
|
|
635 (setq initial-frame-unmapped-p t))
|
|
636 ((or (string= arg "-debug-paths")
|
|
637 (string= arg "--debug-paths"))
|
|
638 t)
|
|
639 ((or (string= arg "--") (string= arg "-"))
|
|
640 (while args
|
|
641 (push (pop args) new-args)))
|
|
642 (t (push arg new-args))))
|
|
643
|
502
|
644 (with-obsolete-variable 'init-file-user
|
|
645 (setq init-file-user (and load-user-init-file-p "")))
|
428
|
646
|
|
647 (nreverse new-args)))
|
|
648
|
|
649 (defconst initial-scratch-message "\
|
|
650 ;; This buffer is for notes you don't want to save, and for Lisp evaluation.
|
|
651 ;; If you want to create a file, first visit that file with C-x C-f,
|
502
|
652 ;; then enter the text in that file's own buffer. (C-x is the standard
|
684
|
653 ;; XEmacs abbreviation for `Control+x', i.e. hold down the Control key
|
|
654 ;; while hitting the x key.)
|
502
|
655 ;;
|
|
656 ;; For Lisp evaluation, type an expression, move to the end and hit C-j.
|
428
|
657
|
|
658 "
|
|
659 "Initial message displayed in *scratch* buffer at startup.
|
|
660 If this is nil, no message will be displayed.")
|
|
661
|
|
662 (defun command-line ()
|
|
663 (let ((command-line-args-left (cdr command-line-args)))
|
|
664
|
|
665 (let ((debugger 'early-error-handler)
|
|
666 (debug-on-error t))
|
|
667
|
|
668 ;; Process magic command-line switches like -q and -u. Do this
|
|
669 ;; before creating the first frame because some of these switches
|
|
670 ;; may affect that. I think it's ok to do this before establishing
|
|
671 ;; the X connection, and maybe someday things like -nw can be
|
|
672 ;; handled here instead of down in C.
|
|
673 (setq command-line-args-left (command-line-early command-line-args-left))
|
|
674
|
611
|
675 (when (eq system-type 'windows-nt)
|
|
676 (init-mswindows-at-startup))
|
|
677
|
428
|
678 ;; Setup the toolbar icon directory
|
|
679 (when (featurep 'toolbar)
|
|
680 (init-toolbar-location))
|
|
681
|
487
|
682 (if (featurep 'toolbar)
|
|
683 (if (featurep 'infodock)
|
|
684 (require 'id-x-toolbar)
|
|
685 (init-toolbar)))
|
|
686
|
428
|
687 ;; Run the window system's init function. tty is considered to be
|
|
688 ;; a type of window system for this purpose. This creates the
|
|
689 ;; initial (non stdio) device.
|
|
690 (when (and initial-window-system (not noninteractive))
|
|
691 (funcall (intern (concat "init-"
|
|
692 (symbol-name initial-window-system)
|
|
693 "-win"))))
|
|
694
|
|
695 ;; When not in batch mode, this creates the first visible frame,
|
|
696 ;; and deletes the stdio device.
|
|
697 (frame-initialize))
|
|
698
|
440
|
699 ;; Reinitialize faces if necessary. This function changes face if
|
|
700 ;; it is created during auto-autoloads loading. Otherwise, it
|
|
701 ;; does nothing.
|
|
702 (startup-initialize-custom-faces)
|
|
703
|
771
|
704 ;; A couple of other things need to be initted.
|
|
705 ;; (RMS writes about internally using hooks for this, in reference
|
|
706 ;; to frame-initialize and frame-notice-user-settings:
|
|
707 ;;
|
|
708 ;; These are now called explicitly at the proper times,
|
|
709 ;; since that is easier to understand.
|
|
710 ;; Actually using hooks within Emacs is bad for future maintenance. --rms.
|
|
711 ;;
|
|
712 ;; In this case, I completely agree. --ben
|
|
713 (init-menubar-at-startup)
|
|
714 ;; perhaps this should go earlier in the proecess?
|
|
715 (if (featurep 'mule)
|
|
716 (declare-fboundp (init-mule-at-startup)))
|
|
717
|
428
|
718 ;;
|
|
719 ;; We have normality, I repeat, we have normality. Anything you still
|
|
720 ;; can't cope with is therefore your own problem. (And we don't need
|
|
721 ;; to kill XEmacs for it.)
|
|
722 ;;
|
|
723
|
|
724 ;;; Load init files.
|
|
725 (load-init-file)
|
438
|
726
|
428
|
727 (with-current-buffer (get-buffer "*scratch*")
|
|
728 (erase-buffer)
|
|
729 ;; (insert initial-scratch-message)
|
|
730 (set-buffer-modified-p nil)
|
|
731 (when (eq major-mode 'fundamental-mode)
|
|
732 (funcall initial-major-mode)))
|
|
733
|
|
734 ;; Load library for our terminal type.
|
|
735 ;; User init file can set term-file-prefix to nil to prevent this.
|
|
736 ;; Note that for any TTY's opened subsequently, the TTY init
|
|
737 ;; code will run this.
|
|
738 (when (and (eq 'tty (console-type))
|
|
739 (not (noninteractive)))
|
|
740 (load-terminal-library))
|
|
741
|
|
742 ;; Process the remaining args.
|
|
743 (command-line-1)
|
|
744
|
|
745 ;; it was turned on by default so that the warnings don't get displayed
|
|
746 ;; until after the splash screen.
|
|
747 (setq inhibit-warning-display nil)
|
|
748 ;; If -batch, terminate after processing the command options.
|
|
749 (when (noninteractive) (kill-emacs t))))
|
|
750
|
438
|
751 (defun load-terminal-library ()
|
428
|
752 (when term-file-prefix
|
|
753 (let ((term (getenv "TERM"))
|
|
754 hyphend)
|
|
755 (while (and term
|
|
756 (not (load (concat term-file-prefix term) t t)))
|
|
757 ;; Strip off last hyphen and what follows, then try again
|
|
758 (if (setq hyphend (string-match "[-_][^-_]+\\'" term))
|
|
759 (setq term (substring term 0 hyphend))
|
|
760 (setq term nil))))))
|
|
761
|
442
|
762 (defun find-user-init-directory-init-file (&optional init-directory)
|
|
763 "Determine the user's init file if in the init directory."
|
|
764 (let ((init-directory (or init-directory user-init-directory)))
|
|
765 (catch 'found
|
|
766 (dolist (file user-init-file-base-list)
|
|
767 (let ((expanded (expand-file-name file init-directory)))
|
|
768 (when (file-readable-p expanded)
|
|
769 (throw 'found expanded)))))))
|
|
770
|
|
771 (defun find-user-home-directory-init-file (&optional home-directory)
|
|
772 "Determine the user's init file if in the home directory."
|
|
773 (let ((home-directory (or home-directory "~")))
|
|
774 (catch 'found
|
|
775 (dolist (file user-home-init-file-base-list)
|
|
776 (let ((expanded (expand-file-name file home-directory)))
|
|
777 (when (file-readable-p expanded)
|
|
778 (throw 'found expanded))))
|
|
779 nil)))
|
|
780
|
|
781 (defun find-user-init-file (&optional init-directory home-directory)
|
440
|
782 "Determine the user's init file."
|
442
|
783 (if load-home-init-file
|
|
784 (find-user-home-directory-init-file home-directory)
|
|
785 (or (find-user-init-directory-init-file init-directory)
|
|
786 (find-user-home-directory-init-file home-directory))))
|
|
787
|
|
788 (defun maybe-migrate-user-init-file ()
|
|
789 "Ask user if she wants to migrate the init file(s) to new location."
|
|
790 (if (and (not load-home-init-file)
|
|
791 (not (find-user-init-directory-init-file user-init-directory))
|
|
792 (stringp user-init-file)
|
|
793 (file-readable-p user-init-file))
|
|
794 (if (with-output-to-temp-buffer (help-buffer-name nil)
|
|
795 (progn
|
|
796 (princ "XEmacs recommends that the initialization code in
|
|
797 ")
|
|
798 (princ user-init-file)
|
|
799 (princ "
|
|
800 be migrated to the ")
|
|
801 (princ user-init-directory)
|
|
802 (princ " directory. XEmacs can
|
|
803 perform the migration automatically.
|
|
804
|
|
805 After the migration, init.el/init.elc holds user-written
|
|
806 initialization code. Moreover the customize settings will be in
|
|
807 custom.el.
|
|
808
|
452
|
809 You can undo the migration at any time with
|
|
810 M-x maybe-unmigrate-user-init-file.
|
|
811
|
442
|
812 If you choose not to do this now, XEmacs will not ask you this
|
|
813 question in the future. However, you can still make XEmacs
|
|
814 perform the migration at any time with M-x migrate-user-init-file.")
|
|
815 (show-temp-buffer-in-current-frame standard-output)
|
|
816 (yes-or-no-p-minibuf (concat "Migrate init file to "
|
|
817 user-init-directory
|
|
818 "? "))))
|
452
|
819 (progn
|
|
820 (migrate-user-init-file)
|
|
821 (maybe-create-compatibility-dot-emacs))
|
442
|
822 (customize-save-variable 'load-home-init-file t))))
|
|
823
|
452
|
824 (defun maybe-create-compatibility-dot-emacs ()
|
|
825 "Ask user if she wants to create a .emacs compatibility file."
|
|
826 (if (with-output-to-temp-buffer (help-buffer-name nil)
|
|
827 (progn
|
|
828 (princ "The initialization code has now been migrated to the ")
|
|
829 (princ user-init-directory)
|
|
830 (princ "directory.
|
|
831
|
|
832 For backwards compatibility with, for example, older versions of XEmacs,
|
|
833 XEmacs can create a special old-style .emacs file in your home
|
|
834 directory which will load the relocated initialization code.")
|
|
835 (show-temp-buffer-in-current-frame standard-output)
|
|
836 (yes-or-no-p-minibuf "Create compatibility .emacs? ")))
|
|
837 (create-compatibility-dot-emacs)))
|
|
838
|
442
|
839 (defun migrate-user-init-file ()
|
|
840 "Migrate the init file from the home directory."
|
|
841 (interactive)
|
|
842 (if (not (file-exists-p user-init-directory))
|
|
843 (progn
|
|
844 (message "Creating %s directory..." user-init-directory)
|
|
845 (make-directory user-init-directory)))
|
|
846 (message "Migrating custom file...")
|
452
|
847 (customize-set-value 'load-home-init-file nil)
|
442
|
848 (custom-migrate-custom-file (make-custom-file-name user-init-file
|
|
849 'force-new))
|
|
850 (message "Moving init file...")
|
452
|
851 (let ((new-user-init-file (expand-file-name user-init-file-base
|
|
852 user-init-directory)))
|
|
853 (rename-file user-init-file new-user-init-file)
|
|
854 (setq user-init-file new-user-init-file))
|
442
|
855 (message "Migration done."))
|
440
|
856
|
452
|
857 (defun create-compatibility-dot-emacs ()
|
|
858 "Create .emacs compatibility file for migrated setup."
|
|
859 (message "Creating .emacs compatibility file.")
|
|
860 (with-temp-file (expand-file-name ".emacs" "~")
|
|
861 (insert ";;; XEmacs backwards compatibility file\n")
|
|
862 (insert "(setq user-init-file\n")
|
|
863 (insert " (expand-file-name \"init.el\"\n")
|
|
864 (insert " (expand-file-name \".xemacs\" \"~\")))\n")
|
|
865 (insert "(setq custom-file\n")
|
|
866 (insert " (expand-file-name \"custom.el\"\n")
|
|
867 (insert " (expand-file-name \".xemacs\" \"~\")))\n")
|
|
868 (insert "\n")
|
|
869 (insert "(load-file user-init-file)\n")
|
|
870 (insert "(load-file custom-file)"))
|
|
871 (message "Created .emacs compatibility file."))
|
|
872
|
|
873 (defun maybe-unmigrate-user-init-file ()
|
|
874 "Possibly unmigrate the user's init and custom files."
|
|
875 (interactive)
|
|
876 (let ((dot-emacs-file-name (expand-file-name ".emacs" "~")))
|
|
877 (if (and (not load-home-init-file)
|
|
878 (or (not (file-exists-p dot-emacs-file-name))
|
|
879 (yes-or-no-p-minibuf (concat "Overwrite " dot-emacs-file-name
|
|
880 "? "))))
|
|
881 (unmigrate-user-init-file dot-emacs-file-name))))
|
|
882
|
|
883 (defun unmigrate-user-init-file (&optional target-file-name)
|
|
884 "Unmigrate the user's init and custom files."
|
|
885 (interactive)
|
|
886 (let ((target-file-name
|
|
887 (or target-file-name (expand-file-name ".emacs" "~"))))
|
|
888 (rename-file user-init-file target-file-name 'ok-if-already-exists)
|
|
889 (setq user-init-file target-file-name)
|
|
890 (let ((old-custom-file custom-file))
|
|
891 (custom-migrate-custom-file target-file-name)
|
|
892 (customize-save-variable 'load-home-init-file t)
|
|
893 (delete-file old-custom-file))))
|
|
894
|
428
|
895 (defun load-user-init-file ()
|
442
|
896 "This function actually reads the init file."
|
428
|
897 (if (not user-init-file)
|
442
|
898 (setq user-init-file
|
|
899 (find-user-init-file user-init-directory)))
|
470
|
900 (if (not custom-file)
|
|
901 (setq custom-file (make-custom-file-name user-init-file)))
|
442
|
902 (if (and user-init-file
|
|
903 (file-readable-p user-init-file))
|
|
904 (load user-init-file t t t))
|
|
905 (if (and custom-file
|
|
906 (or (not user-init-file)
|
|
907 (not (string= custom-file user-init-file)))
|
|
908 (file-readable-p custom-file))
|
|
909 (load custom-file t t t))
|
428
|
910 (unless inhibit-default-init
|
|
911 (let ((inhibit-startup-message nil))
|
|
912 ;; Users are supposed to be told their rights.
|
|
913 ;; (Plus how to get help and how to undo.)
|
|
914 ;; Don't you dare turn this off for anyone except yourself.
|
|
915 (load "default" t t))))
|
|
916
|
|
917 ;;; Load user's init file and default ones.
|
|
918 (defun load-init-file ()
|
|
919 (run-hooks 'before-init-hook)
|
|
920
|
|
921 ;; Run the site-start library if it exists. The point of this file is
|
|
922 ;; that it is run before .emacs. There is no point in doing this after
|
|
923 ;; .emacs; that is useless.
|
|
924 (when site-start-file
|
|
925 (load site-start-file t t))
|
|
926
|
|
927 ;; Sites should not disable this. Only individuals should disable
|
|
928 ;; the startup message.
|
|
929 (setq inhibit-startup-message nil)
|
|
930
|
|
931 (let (debug-on-error-from-init-file
|
|
932 debug-on-error-should-be-set
|
|
933 (debug-on-error-initial
|
|
934 (if (eq init-file-debug t) 'startup init-file-debug)))
|
|
935 (let ((debug-on-error debug-on-error-initial))
|
|
936 (if (and load-user-init-file-p init-file-debug)
|
442
|
937 (progn
|
|
938 ;; Do this without a condition-case if the user wants to debug.
|
|
939 (load-user-init-file))
|
428
|
940 (condition-case error
|
|
941 (progn
|
|
942 (if load-user-init-file-p
|
|
943 (load-user-init-file))
|
|
944 (setq init-file-had-error nil))
|
|
945 (error
|
|
946 (message "Error in init file: %s" (error-message-string error))
|
|
947 (display-warning 'initialization
|
|
948 (format "\
|
|
949 An error has occurred while loading %s:
|
|
950
|
|
951 %s
|
|
952
|
|
953 To ensure normal operation, you should investigate the cause of the error
|
|
954 in your initialization file and remove it. Use the `-debug-init' option
|
|
955 to XEmacs to view a complete error backtrace."
|
|
956 user-init-file (error-message-string error))
|
|
957 'error)
|
|
958 (setq init-file-had-error t))))
|
|
959 ;; If we can tell that the init file altered debug-on-error,
|
|
960 ;; arrange to preserve the value that it set up.
|
|
961 (or (eq debug-on-error debug-on-error-initial)
|
|
962 (setq debug-on-error-should-be-set t
|
|
963 debug-on-error-from-init-file debug-on-error)))
|
|
964 (when debug-on-error-should-be-set
|
|
965 (setq debug-on-error debug-on-error-from-init-file)))
|
|
966
|
|
967 (setq init-file-loaded t)
|
|
968
|
|
969 ;; Do this here in case the init file sets mail-host-address.
|
|
970 ;; Don't do this here unless noninteractive, it is frequently wrong. -sb
|
|
971 ;; (or user-mail-address
|
|
972 (when noninteractive
|
|
973 (setq user-mail-address (concat (user-login-name) "@"
|
|
974 (or mail-host-address
|
|
975 (system-name)))))
|
|
976
|
|
977 (run-hooks 'after-init-hook)
|
|
978 nil)
|
|
979
|
|
980 (defun load-options-file (filename)
|
|
981 "Load the file of saved options (from the Options menu) called FILENAME.
|
|
982 Currently this does nothing but call `load', but it might be redefined
|
|
983 in the future to support automatically converting older options files to
|
|
984 a new format, when variables have changed, etc."
|
|
985 (load filename))
|
|
986
|
|
987 (defun command-line-1 ()
|
|
988 (cond
|
|
989 ((null command-line-args-left)
|
|
990 (unless noninteractive
|
|
991 ;; If there are no switches to process, run the term-setup-hook
|
|
992 ;; before displaying the copyright notice; there may be some need
|
|
993 ;; to do it before doing any output. If we're not going to
|
|
994 ;; display a copyright notice (because other options are present)
|
|
995 ;; then this is run after those options are processed.
|
|
996 (run-hooks 'term-setup-hook)
|
|
997 ;; Don't let the hook be run twice.
|
|
998 (setq term-setup-hook nil)
|
|
999
|
|
1000 ;; Don't clobber a non-scratch buffer if init file
|
|
1001 ;; has selected it.
|
|
1002 (when (string= (buffer-name) "*scratch*")
|
|
1003 (unless (or inhibit-startup-message
|
|
1004 (input-pending-p))
|
|
1005 (let (tmout circ-tmout)
|
|
1006 (unwind-protect
|
|
1007 ;; Guts of with-timeout
|
|
1008 (catch 'tmout
|
|
1009 (setq tmout (add-timeout startup-message-timeout
|
|
1010 (lambda (ignore)
|
|
1011 (condition-case nil
|
|
1012 (throw 'tmout t)
|
|
1013 (error nil)))
|
|
1014 nil))
|
|
1015 (setq circ-tmout (display-splash-frame))
|
|
1016 (or nil;; (pos-visible-in-window-p (point-min))
|
|
1017 (goto-char (point-min)))
|
|
1018 (sit-for 0)
|
|
1019 (setq unread-command-event (next-command-event)))
|
|
1020 (when tmout (disable-timeout tmout))
|
|
1021 (when circ-tmout (disable-timeout circ-tmout)))))
|
|
1022 (with-current-buffer (get-buffer "*scratch*")
|
|
1023 ;; In case the XEmacs server has already selected
|
|
1024 ;; another buffer, erase the one our message is in.
|
|
1025 (erase-buffer)
|
|
1026 (when (stringp initial-scratch-message)
|
|
1027 (insert initial-scratch-message))
|
|
1028 (set-buffer-modified-p nil)))))
|
|
1029
|
|
1030 (t
|
|
1031 ;; Command-line-options exist
|
|
1032 (let ((dir command-line-default-directory)
|
|
1033 (file-count 0)
|
|
1034 (line nil)
|
|
1035 (end-of-options nil)
|
442
|
1036 file-p arg tem)
|
428
|
1037 (while command-line-args-left
|
|
1038 (setq arg (pop command-line-args-left))
|
|
1039 (cond
|
|
1040 (end-of-options
|
|
1041 (setq file-p t))
|
|
1042 ((setq tem (when (eq (aref arg 0) ?-)
|
|
1043 (or (assoc arg command-switch-alist)
|
|
1044 (assoc (substring arg 1)
|
|
1045 command-switch-alist))))
|
|
1046 (funcall (cdr tem) arg))
|
|
1047 ((string-match "\\`\\+[0-9]+\\'" arg)
|
|
1048 (setq line (string-to-int arg)))
|
|
1049 ;; "- file" means don't treat "file" as a switch
|
|
1050 ;; ("+0 file" has the same effect; "-" added
|
|
1051 ;; for unixoidiality).
|
|
1052 ;; This is worthless; the `unixoid' way is "./file". -jwz
|
|
1053 ((or (string= arg "-") (string= arg "--"))
|
|
1054 (setq end-of-options t))
|
|
1055 (t
|
|
1056 (setq file-p t)))
|
438
|
1057
|
428
|
1058 (when file-p
|
|
1059 (setq file-p nil)
|
|
1060 (incf file-count)
|
|
1061 (setq arg (expand-file-name arg dir))
|
|
1062 (cond
|
442
|
1063 ((= file-count 1)
|
|
1064 (find-file arg))
|
428
|
1065 (noninteractive (find-file arg))
|
|
1066 (t (find-file-other-window arg)))
|
|
1067 (when line
|
|
1068 (goto-line line)
|
|
1069 (setq line nil))))))))
|
|
1070
|
|
1071 (defvar startup-presentation-hack-keymap
|
|
1072 (let ((map (make-sparse-keymap)))
|
|
1073 (set-keymap-name map 'startup-presentation-hack-keymap)
|
|
1074 (define-key map '[button1] 'startup-presentation-hack)
|
|
1075 (define-key map '[button2] 'startup-presentation-hack)
|
|
1076 map)
|
|
1077 "Putting yesterday in the future tomorrow.")
|
|
1078
|
|
1079 (defun startup-presentation-hack ()
|
|
1080 (interactive)
|
|
1081 (let ((e last-command-event))
|
|
1082 (and (button-press-event-p e)
|
|
1083 (setq e (extent-at (event-point e)
|
|
1084 (event-buffer e)
|
|
1085 'startup-presentation-hack))
|
|
1086 (setq e (extent-property e 'startup-presentation-hack))
|
|
1087 (if (consp e)
|
|
1088 (apply (car e) (cdr e))
|
|
1089 (while (keymapp (indirect-function e))
|
|
1090 (let ((map e)
|
|
1091 (overriding-local-map (indirect-function e)))
|
|
1092 (setq e (read-key-sequence
|
|
1093 (let ((p (keymap-prompt map t)))
|
|
1094 (cond ((symbolp map)
|
438
|
1095 (if p
|
428
|
1096 (format "%s %s " map p)
|
|
1097 (format "%s " map)))
|
|
1098 (p)
|
|
1099 (t
|
|
1100 (prin1-to-string map))))))
|
|
1101 (if (and (button-release-event-p (elt e 0))
|
|
1102 (null (key-binding e)))
|
|
1103 (setq e map) ; try again
|
|
1104 (setq e (key-binding e)))))
|
|
1105 (call-interactively e)))))
|
|
1106
|
|
1107 (defun startup-presentation-hack-help (e)
|
|
1108 (setq e (extent-property e 'startup-presentation-hack))
|
|
1109 (if (consp e)
|
|
1110 (format "Evaluate %S" e)
|
|
1111 (symbol-name e)))
|
|
1112
|
|
1113 (defun splash-frame-present-hack (e v)
|
|
1114 ;; (set-extent-property e 'mouse-face 'highlight)
|
|
1115 ;; (set-extent-property e 'keymap
|
|
1116 ;; startup-presentation-hack-keymap)
|
|
1117 ;; (set-extent-property e 'startup-presentation-hack v)
|
|
1118 ;; (set-extent-property e 'help-echo
|
|
1119 ;; 'startup-presentation-hack-help)
|
|
1120 )
|
|
1121
|
|
1122 (defun splash-hack-version-string ()
|
|
1123 (save-excursion
|
|
1124 (save-restriction
|
|
1125 (goto-char (point-min))
|
|
1126 (re-search-forward "^XEmacs" nil t)
|
|
1127 (narrow-to-region (point-at-bol) (point-at-eol))
|
|
1128 (goto-char (point-min))
|
|
1129 (when (re-search-forward " \\[Lucid\\]" nil t)
|
|
1130 (delete-region (match-beginning 0) (match-end 0)))
|
|
1131 (when (re-search-forward "[^(][^)]*-[^)]*-" nil t)
|
|
1132 (delete-region (1+ (match-beginning 0)) (match-end 0))
|
|
1133 (insert "("))
|
|
1134 (goto-char (point-max))
|
|
1135 (search-backward " " nil t)
|
|
1136 (when (search-forward "." nil t)
|
|
1137 (delete-region (1- (point)) (point-max))))))
|
|
1138
|
|
1139 (defun splash-frame-present (l)
|
|
1140 (cond ((stringp l)
|
|
1141 (insert l))
|
|
1142 ((eq (car-safe l) 'face)
|
|
1143 ;; (face name string)
|
|
1144 (let ((p (point)))
|
|
1145 (splash-frame-present (elt l 2))
|
|
1146 (if (fboundp 'set-extent-face)
|
|
1147 (set-extent-face (make-extent p (point))
|
|
1148 (elt l 1)))))
|
|
1149 ((eq (car-safe l) 'key)
|
|
1150 (let* ((c (elt l 1))
|
|
1151 (p (point))
|
|
1152 (k (where-is-internal c nil t)))
|
|
1153 (insert (if k (key-description k)
|
|
1154 (format "M-x %s" c)))
|
|
1155 (if (fboundp 'set-extent-face)
|
|
1156 (let ((e (make-extent p (point))))
|
|
1157 (set-extent-face e 'bold)
|
|
1158 (splash-frame-present-hack e c)))))
|
|
1159 ((eq (car-safe l) 'funcall)
|
|
1160 ;; (funcall (fun . args) string)
|
|
1161 (let ((p (point)))
|
|
1162 (splash-frame-present (elt l 2))
|
|
1163 (if (fboundp 'set-extent-face)
|
|
1164 (splash-frame-present-hack (make-extent p (point))
|
|
1165 (elt l 1)))))
|
|
1166 ((consp l)
|
|
1167 (mapcar 'splash-frame-present l))
|
|
1168 (t
|
|
1169 (error "WTF!?"))))
|
|
1170
|
|
1171 (defun startup-center-spaces (glyph)
|
|
1172 ;; Return the number of spaces to insert in order to center
|
|
1173 ;; the given glyph (may be a string or a pixmap).
|
438
|
1174 ;; Assume spaces are as wide as avg-pixwidth.
|
428
|
1175 ;; Won't be quite right for proportional fonts, but it's the best we can do.
|
|
1176 ;; Maybe the new redisplay will export something a glyph-width function.
|
|
1177 ;;; #### Yes, there is a glyph-width function but it isn't quite what
|
|
1178 ;;; #### this was expecting. Or is it?
|
|
1179 ;; (An alternate way to get avg-pixwidth would be to use x-font-properties
|
|
1180 ;; and calculate RESOLUTION_X * AVERAGE_WIDTH / 722.7, but it's no better.)
|
|
1181
|
|
1182 ;; This function is used in about.el too.
|
|
1183 (let* ((avg-pixwidth (round (/ (frame-pixel-width) (frame-width))))
|
|
1184 (fill-area-width (* avg-pixwidth (- fill-column left-margin)))
|
438
|
1185 (glyph-pixwidth (cond ((stringp glyph)
|
428
|
1186 (* avg-pixwidth (length glyph)))
|
|
1187 ;; #### the pixmap option should be removed
|
|
1188 ;;((pixmapp glyph)
|
|
1189 ;; (pixmap-width glyph))
|
|
1190 ((glyphp glyph)
|
|
1191 (glyph-width glyph))
|
|
1192 (t
|
|
1193 (error "startup-center-spaces: bad arg")))))
|
|
1194 (+ left-margin
|
|
1195 (round (/ (/ (- fill-area-width glyph-pixwidth) 2) avg-pixwidth)))))
|
|
1196
|
|
1197 (defun splash-frame-body ()
|
|
1198 `[((face (blue bold underline)
|
|
1199 "\nDistribution, copying license, warranty:\n\n")
|
|
1200 "Please visit the XEmacs website at http://www.xemacs.org !\n\n"
|
|
1201 ,@(if (featurep 'sparcworks)
|
|
1202 `( "\
|
|
1203 Sun provides support for the WorkShop/XEmacs integration package only.
|
|
1204 All other XEmacs packages are provided to you \"AS IS\".\n"
|
438
|
1205 ,@(let ((lang (or (getenv "LC_ALL") (getenv "LC_MESSAGES")
|
428
|
1206 (getenv "LANG"))))
|
|
1207 (if (and
|
|
1208 (not (featurep 'mule)) ;; Already got mule?
|
|
1209 ;; No Mule support on tty's yet
|
438
|
1210 (not (eq 'tty (console-type)))
|
428
|
1211 lang ;; Non-English locale?
|
|
1212 (not (string= lang "C"))
|
|
1213 (not (string-match "^en" lang))
|
|
1214 ;; Comes with Sun WorkShop
|
|
1215 (locate-file "xemacs-mule" exec-path))
|
|
1216 '( "\
|
|
1217 This version of XEmacs has been built with support for Latin-1 languages only.
|
|
1218 To handle other languages you need to run a Multi-lingual (`Mule') version of
|
|
1219 XEmacs, by either running the command `xemacs-mule', or by using the X resource
|
|
1220 `ESERVE*defaultXEmacsPath: xemacs-mule' when starting XEmacs from Sun WorkShop.
|
|
1221 \n")))))
|
438
|
1222 ((key describe-no-warranty)
|
428
|
1223 ": "(face (red bold) "XEmacs comes with ABSOLUTELY NO WARRANTY\n"))
|
|
1224 ((key describe-copying)
|
|
1225 ": conditions to give out copies of XEmacs\n")
|
|
1226 ((key describe-distribution)
|
|
1227 ": how to get the latest version\n")
|
|
1228 "\n--\n"
|
|
1229 (face italic "\
|
|
1230 Copyright (C) 1985-1999 Free Software Foundation, Inc.
|
|
1231 Copyright (C) 1990-1994 Lucid, Inc.
|
|
1232 Copyright (C) 1993-1997 Sun Microsystems, Inc. All Rights Reserved.
|
|
1233 Copyright (C) 1994-1996 Board of Trustees, University of Illinois
|
|
1234 Copyright (C) 1995-1996 Ben Wing\n"))
|
438
|
1235
|
428
|
1236 ((face (blue bold underline) "\nInformation, on-line help:\n\n")
|
|
1237 "XEmacs comes with plenty of documentation...\n\n"
|
|
1238 ,@(if (string-match "beta" emacs-version)
|
438
|
1239 `((key describe-beta)
|
428
|
1240 ": " (face (red bold)
|
|
1241 "This is an Experimental version of XEmacs.\n"))
|
|
1242 `( "\n"))
|
|
1243 ((key xemacs-local-faq)
|
|
1244 ": read the XEmacs FAQ (a " (face underline "capital") " F!)\n")
|
|
1245 ((key help-with-tutorial)
|
|
1246 ": read the XEmacs tutorial (also available through the "
|
|
1247 (face bold "Help") " menu)\n")
|
|
1248 ((key help-command)
|
|
1249 ": get help on using XEmacs (also available through the "
|
|
1250 (face bold "Help") " menu)\n")
|
|
1251 ((key info) ": read the on-line documentation\n\n")
|
|
1252 ((key describe-project) ": read about the GNU project\n")
|
|
1253 ((key about-xemacs) ": see who's developing XEmacs\n"))
|
|
1254
|
|
1255 ((face (blue bold underline) "\nUseful stuff:\n\n")
|
|
1256 "Things that you should know rather quickly...\n\n"
|
|
1257 ((key find-file) ": visit a file\n")
|
|
1258 ((key save-buffer) ": save changes\n")
|
771
|
1259 ((key undo) ": undo changes\n")
|
428
|
1260 ((key save-buffers-kill-emacs) ": exit XEmacs\n"))
|
|
1261 ])
|
|
1262
|
|
1263 ;; I really hate global variables, oh well.
|
|
1264 ;(defvar xemacs-startup-logo-function nil
|
|
1265 ; "If non-nil, function called to provide the startup logo.
|
|
1266 ;This function should return an initialized glyph if it is used.")
|
|
1267
|
438
|
1268 ;; This will hopefully go away when gettext is functional.
|
428
|
1269 (defconst splash-frame-static-body
|
|
1270 `(,(emacs-version) "\n\n"
|
|
1271 (face italic "`C-' means the control key,`M-' means the meta key\n\n")))
|
|
1272
|
|
1273
|
|
1274 (defun circulate-splash-frame-elements (client-data)
|
|
1275 (with-current-buffer (aref client-data 2)
|
|
1276 (let ((buffer-read-only nil)
|
|
1277 (elements (aref client-data 3))
|
|
1278 (indice (aref client-data 0)))
|
|
1279 (goto-char (aref client-data 1))
|
|
1280 (delete-region (point) (point-max))
|
|
1281 (splash-frame-present (aref elements indice))
|
|
1282 (set-buffer-modified-p nil)
|
|
1283 (aset client-data 0
|
|
1284 (if (= indice (- (length elements) 1))
|
|
1285 0
|
|
1286 (1+ indice )))
|
|
1287 )))
|
|
1288
|
440
|
1289 ;; #### This function now returns the (possibly nil) timeout circulating the
|
428
|
1290 ;; splash-frame elements
|
|
1291 (defun display-splash-frame ()
|
|
1292 (let ((logo xemacs-logo)
|
|
1293 (buffer-read-only nil)
|
|
1294 (cramped-p (eq 'tty (console-type))))
|
|
1295 (unless cramped-p (insert "\n"))
|
|
1296 (indent-to (startup-center-spaces logo))
|
|
1297 (set-extent-begin-glyph (make-extent (point) (point)) logo)
|
|
1298 ;;(splash-frame-present-hack (make-extent p (point)) 'about-xemacs))
|
|
1299 (insert "\n\n")
|
|
1300 (splash-frame-present splash-frame-static-body)
|
|
1301 (splash-hack-version-string)
|
|
1302 (goto-char (point-max))
|
|
1303 (let* ((after-change-functions nil) ; no font-lock, thank you
|
|
1304 (elements (splash-frame-body))
|
|
1305 (client-data `[ 1 ,(point) ,(current-buffer) ,elements ])
|
|
1306 tmout)
|
|
1307 (if (listp elements) ;; A single element to display
|
|
1308 (splash-frame-present (splash-frame-body))
|
|
1309 ;; several elements to rotate
|
|
1310 (splash-frame-present (aref elements 0))
|
|
1311 (setq tmout (add-timeout splash-frame-timeout
|
|
1312 'circulate-splash-frame-elements
|
|
1313 client-data splash-frame-timeout)))
|
|
1314 (set-buffer-modified-p nil)
|
|
1315 tmout)))
|
|
1316
|
|
1317 ;; (let ((present-file
|
|
1318 ;; #'(lambda (f)
|
|
1319 ;; (splash-frame-present
|
|
1320 ;; (list 'funcall
|
|
1321 ;; (list 'find-file-other-window
|
|
1322 ;; (expand-file-name f data-directory))
|
|
1323 ;; f)))))
|
|
1324 ;; (insert "For customization examples, see the files ")
|
|
1325 ;; (funcall present-file "sample.emacs")
|
|
1326 ;; (insert " and ")
|
|
1327 ;; (funcall present-file "sample.Xdefaults")
|
|
1328 ;; (insert (format "\nin the directory %s." data-directory)))
|
|
1329
|
|
1330 (defun startup-set-invocation-environment ()
|
|
1331 ;; XEmacs -- Steven Baur says invocation directory is nil if you
|
|
1332 ;; try to use XEmacs as a login shell.
|
|
1333 (or invocation-directory (setq invocation-directory default-directory))
|
|
1334 (setq invocation-directory
|
|
1335 ;; don't let /tmp_mnt/... get into the load-path or exec-path.
|
|
1336 (abbreviate-file-name invocation-directory)))
|
|
1337
|
|
1338 (defun startup-setup-paths (roots user-init-directory
|
|
1339 &optional
|
|
1340 inhibit-early-packages inhibit-site-lisp
|
|
1341 debug-paths)
|
|
1342 "Setup all the various paths.
|
|
1343 ROOTS is a list of plausible roots of the XEmacs directory hierarchy.
|
|
1344 If INHIBIT-PACKAGES is non-NIL, don't do packages.
|
|
1345 If INHIBIT-SITE-LISP is non-NIL, don't do site-lisp.
|
|
1346 If DEBUG-PATHS is non-NIL, print paths as they are detected.
|
|
1347 It's idempotent, so call this as often as you like!"
|
|
1348
|
|
1349 (apply #'(lambda (early late last)
|
|
1350 (setq early-packages (and (not inhibit-early-packages)
|
|
1351 early))
|
|
1352 (setq late-packages late)
|
|
1353 (setq last-packages last))
|
|
1354 (packages-find-packages
|
|
1355 roots
|
|
1356 (packages-compute-package-locations user-init-directory)))
|
|
1357
|
|
1358 (setq early-package-load-path (packages-find-package-load-path early-packages))
|
|
1359 (setq late-package-load-path (packages-find-package-load-path late-packages))
|
|
1360 (setq last-package-load-path (packages-find-package-load-path last-packages))
|
|
1361
|
|
1362 (if debug-paths
|
|
1363 (progn
|
|
1364 (princ (format "configure-package-path:\n%S\n" configure-package-path)
|
|
1365 'external-debugging-output)
|
|
1366 (princ (format "early-packages and early-package-load-path:\n%S\n%S\n"
|
|
1367 early-packages early-package-load-path)
|
|
1368 'external-debugging-output)
|
|
1369 (princ (format "late-packages and late-package-load-path:\n%S\n%S\n"
|
|
1370 late-packages late-package-load-path)
|
|
1371 'external-debugging-output)
|
|
1372 (princ (format "last-packages and last-package-load-path:\n%S\n%S\n"
|
|
1373 last-packages last-package-load-path)
|
|
1374 'external-debugging-output)))
|
|
1375
|
|
1376 (setq lisp-directory (paths-find-lisp-directory roots))
|
|
1377
|
|
1378 (if debug-paths
|
|
1379 (princ (format "lisp-directory:\n%S\n" lisp-directory)
|
|
1380 'external-debugging-output))
|
|
1381
|
460
|
1382 (if (featurep 'mule)
|
|
1383 (progn
|
|
1384 (setq mule-lisp-directory
|
|
1385 (paths-find-mule-lisp-directory roots
|
|
1386 lisp-directory))
|
|
1387 (if debug-paths
|
|
1388 (princ (format "mule-lisp-directory:\n%S\n"
|
|
1389 mule-lisp-directory)
|
|
1390 'external-debugging-output)))
|
|
1391 (setq mule-lisp-directory '()))
|
|
1392
|
428
|
1393 (setq site-directory (and (null inhibit-site-lisp)
|
|
1394 (paths-find-site-lisp-directory roots)))
|
|
1395
|
|
1396 (if (and debug-paths (null inhibit-site-lisp))
|
|
1397 (princ (format "site-directory:\n%S\n" site-directory)
|
|
1398 'external-debugging-output))
|
|
1399
|
|
1400 (setq load-path (paths-construct-load-path roots
|
|
1401 early-package-load-path
|
|
1402 late-package-load-path
|
|
1403 last-package-load-path
|
|
1404 lisp-directory
|
460
|
1405 site-directory
|
|
1406 mule-lisp-directory))
|
428
|
1407
|
|
1408 (setq Info-directory-list
|
|
1409 (paths-construct-info-path roots
|
|
1410 early-packages late-packages last-packages))
|
|
1411
|
438
|
1412
|
428
|
1413 (if debug-paths
|
|
1414 (princ (format "Info-directory-list:\n%S\n" Info-directory-list)
|
|
1415 'external-debugging-output))
|
|
1416
|
|
1417 (setq exec-directory (paths-find-exec-directory roots))
|
|
1418
|
|
1419 (if debug-paths
|
|
1420 (princ (format "exec-directory:\n%s\n" exec-directory)
|
|
1421 'external-debugging-output))
|
|
1422
|
|
1423 (setq exec-path
|
|
1424 (paths-construct-exec-path roots exec-directory
|
|
1425 early-packages late-packages last-packages))
|
|
1426
|
|
1427 (if debug-paths
|
|
1428 (princ (format "exec-path:\n%S\n" exec-path)
|
|
1429 'external-debugging-output))
|
438
|
1430
|
428
|
1431 (setq doc-directory (paths-find-doc-directory roots))
|
|
1432
|
|
1433 (if debug-paths
|
|
1434 (princ (format "doc-directory:\n%S\n" doc-directory)
|
|
1435 'external-debugging-output))
|
|
1436
|
|
1437 (setq data-directory (paths-find-data-directory roots))
|
|
1438
|
|
1439 (if debug-paths
|
|
1440 (princ (format "data-directory:\n%S\n" data-directory)
|
|
1441 'external-debugging-output))
|
|
1442
|
|
1443 (setq data-directory-list (paths-construct-data-directory-list data-directory
|
|
1444 early-packages
|
|
1445 late-packages
|
|
1446 last-packages))
|
|
1447 (if debug-paths
|
|
1448 (princ (format "data-directory-list:\n%S\n" data-directory-list)
|
|
1449 'external-debugging-output)))
|
|
1450
|
|
1451 (defun startup-find-roots-warning ()
|
|
1452 (save-excursion
|
|
1453 (set-buffer (get-buffer-create " *warning-tmp*"))
|
|
1454 (erase-buffer)
|
|
1455 (buffer-disable-undo (current-buffer))
|
|
1456
|
|
1457 (insert "Couldn't find an obvious default for the root of the\n"
|
|
1458 "XEmacs hierarchy.")
|
|
1459
|
|
1460 (princ "\nWARNING:\n" 'external-debugging-output)
|
|
1461 (princ (buffer-string) 'external-debugging-output)))
|
|
1462
|
|
1463 (defun startup-setup-paths-warning ()
|
442
|
1464 (let ((warnings '()))
|
428
|
1465 (cond
|
|
1466 ((null (and lisp-directory exec-directory data-directory doc-directory
|
442
|
1467 load-path))
|
428
|
1468 (save-excursion
|
|
1469 (set-buffer (get-buffer-create " *warning-tmp*"))
|
|
1470 (erase-buffer)
|
|
1471 (buffer-disable-undo (current-buffer))
|
|
1472 (if (null lisp-directory) (push "lisp-directory" warnings))
|
460
|
1473 (if (and (featurep 'mule)
|
|
1474 (null mule-lisp-directory))
|
|
1475 (push "mule-lisp-directory" warnings))
|
428
|
1476 (if (null exec-directory) (push "exec-directory" warnings))
|
|
1477 (if (null data-directory) (push "data-directory" warnings))
|
|
1478 (if (null doc-directory) (push "doc-directory" warnings))
|
|
1479 (if (null load-path) (push "load-path" warnings))
|
|
1480
|
|
1481 (insert "Couldn't find obvious defaults for:\n")
|
|
1482 (while warnings
|
|
1483 (insert (car warnings) "\n")
|
|
1484 (setq warnings (cdr warnings)))
|
|
1485 (insert "Perhaps some directories don't exist, "
|
|
1486 "or the XEmacs executable,\n" (concat invocation-directory
|
|
1487 invocation-name)
|
|
1488 "\nis in a strange place?")
|
|
1489
|
|
1490 (princ "\nWARNING:\n" 'external-debugging-output)
|
|
1491 (princ (buffer-string) 'external-debugging-output)
|
|
1492 (erase-buffer)
|
|
1493 t)))))
|
|
1494
|
528
|
1495 (defun startup-load-autoloads ()
|
|
1496 (if (and (not inhibit-autoloads)
|
|
1497 lisp-directory)
|
|
1498 (load (expand-file-name (file-name-sans-extension autoload-file-name)
|
|
1499 lisp-directory) nil t))
|
|
1500
|
|
1501 (if (not inhibit-autoloads)
|
|
1502 (progn
|
|
1503 (if (not inhibit-early-packages)
|
|
1504 (packages-load-package-auto-autoloads early-package-load-path))
|
|
1505 (packages-load-package-auto-autoloads late-package-load-path)
|
|
1506 (packages-load-package-auto-autoloads last-package-load-path))))
|
|
1507
|
428
|
1508 ;;; startup.el ends here
|