annotate lisp/startup.el @ 410:de805c49cfc1 r21-2-35

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