annotate lisp/startup.el @ 5620:7a81b4d98d2d

Shrink the widget-field-face. -------------------- ChangeLog entries follow: -------------------- lisp/ChangeLog addition: 2011-12-27 Didier Verna <didier@xemacs.org> * wid-edit.el (widget-field-face): Set this face to shrink. Fix incorrect specification.
author Didier Verna <didier@xemacs.org>
date Tue, 27 Dec 2011 15:21:28 +0100
parents d469c668462e
children b09e3b1b7424
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 ;;; startup.el --- process XEmacs shell arguments
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 ;; Copyright (C) 1985-1986, 1990, 1992-1997 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 ;; Copyright (c) 1993, 1994 Sun Microsystems, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 ;; Copyright (C) 1995 Board of Trustees, University of Illinois
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
6 ;; Copyright (C) 2001, 2002, 2003, 2004, 2005 Ben Wing.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 ;; Maintainer: XEmacs Development Team
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 ;; Keywords: internal, dumped
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 ;; This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5228
diff changeset
13 ;; XEmacs is free software: you can redistribute it and/or modify it
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5228
diff changeset
14 ;; under the terms of the GNU General Public License as published by the
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5228
diff changeset
15 ;; Free Software Foundation, either version 3 of the License, or (at your
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5228
diff changeset
16 ;; option) any later version.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5228
diff changeset
18 ;; XEmacs is distributed in the hope that it will be useful, but WITHOUT
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5228
diff changeset
19 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5228
diff changeset
20 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5228
diff changeset
21 ;; for more details.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5228
diff changeset
24 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 ;;; Synched up with: FSF 19.34.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 ;;; Commentary:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 ;; This file is dumped with XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
32 ;; It handles the all aspects of startup once the C code has finished
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
33 ;; initializing itself. Entry from C is through the function set in
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
34 ;; the `top-level' variable, which is normally `normal-top-level'. At
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
35 ;; the point that `normal-top-level' has been invoked:
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
36 ;;
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
37 ;; (1) the dumped Elisp files are available. Either they were loaded
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
38 ;; during this invocation of temacs and it was then converted to
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
39 ;; XEmacs using the run-temacs mechanism, or (more likely) the
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
40 ;; loadup and dumping occurred at some point in the past and we
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
41 ;; just read in the dumped data.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
42 ;;
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
43 ;; (2) All C subsystems have been initialized.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
44 ;;
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
45 ;; (3) A "stream" device has been created, which does I/O over stdin
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
46 ;; and stdout. This is the only device we have available and our
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
47 ;; only means of communication, other than disk files.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
48 ;;
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
49 ;; (4) The command-line arguments have been sorted according to
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
50 ;; priority specs (this implies that the names of all arguments
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
51 ;; must be hard-coded into emacs.c), and certain low-level
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
52 ;; arguments such as -sd, -t, -nd, -nw, -batch, etc. have been
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
53 ;; processed by main_1() and removed. (NOTE: main_1() is the name
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
54 ;; in the source code, but in the object file it has some other
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
55 ;; name, such as xemacs_21_2_34_mips_sgi_irix6().) Certain other
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
56 ;; arguments such as -version and -help are partially-processed,
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
57 ;; triggering some special behavior but being left on the list for
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
58 ;; further processing by the Lisp code.
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
59 ;;
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
60 ;; The job of the code here is to process the remaining command-line
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
61 ;; args, set up the various paths, locate where all the packages are
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
62 ;; and set things up for them (initialize the load path, read in the
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
63 ;; autoloads, etc.), read in the init files, display the splash
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
64 ;; screen, and set up any remaining environment-dependent variables.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 ;;; Code:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 (setq top-level '(normal-top-level))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 (defvar command-line-processed nil "t once command line has been processed")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 (defconst startup-message-timeout 12000) ; More or less disable the timeout
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 (defconst inhibit-startup-message nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 "*Non-nil inhibits the initial startup message.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 This is for use in your personal init file, once you are familiar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 with the contents of the startup message.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 ;; #### FSFmacs randomness
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 ;;(defconst inhibit-startup-echo-area-message nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 ;; "*Non-nil inhibits the initial startup echo area message.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 ;;Inhibition takes effect only if your `.emacs' file contains
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 ;;a line of this form:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 ;; (setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 ;;If your `.emacs' file is byte-compiled, use the following form instead:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 ;; (eval '(setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 ;;Thus, someone else using a copy of your `.emacs' file will see
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 ;;the startup message unless he personally acts to inhibit it.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 (defconst inhibit-default-init nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 "*Non-nil inhibits loading the `default' library.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 (defvar command-line-args-left nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 "List of command-line args not yet processed.") ; bound by `command-line'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 (defvar command-line-default-directory nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 "Default directory to use for command line arguments.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 This is normally copied from `default-directory' when XEmacs starts.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 (defvar before-init-hook nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 "Functions to call after handling urgent options but before init files.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 The frame system uses this to open frames to display messages while
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 XEmacs loads the user's initialization file.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 (defvar after-init-hook nil
452
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
106 "*Functions to call after loading the init file.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 The call is not protected by a condition-case, so you can set `debug-on-error'
452
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
108 in the init file, and put all the actual code on `after-init-hook'.")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 (defvar term-setup-hook nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 "*Functions to be called after loading terminal-specific Lisp code.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 See `run-hooks'. This variable exists for users to set, so as to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 override the definitions made by the terminal-specific file. XEmacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 never sets this variable itself.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 (defvar keyboard-type nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 "The brand of keyboard you are using.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 This variable is used to define the proper function and keypad keys
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 for use under X. It is used in a fashion analogous to the environment
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 value TERM.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 (defvar window-setup-hook nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 "Normal hook run to initialize window system display.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 XEmacs runs this hook after processing the command line arguments and loading
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 the user's init file.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 (defconst initial-major-mode 'lisp-interaction-mode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 "Major mode command symbol to use for the initial *scratch* buffer.")
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
129
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
130 ;;; Path-related variables.
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
131 ;;; NOTE: Many of them (`lisp-directory', `data-directory', etc.) are
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
132 ;;; built-in.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
134 (defvar emacs-roots nil
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
135 "List of plausible roots of the XEmacs hierarchy.
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
136 This is a list of plausible directories in which to search for the important
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
137 directories used by XEmacs at run-time, for example `exec-directory',
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
138 `data-directory' and `lisp-directory'.
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
139
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
140 Normally set at startup by calling `paths-find-emacs-roots'.")
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
141
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
142 (defvar emacs-data-roots nil
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
143 "List of plausible data roots of the XEmacs hierarchy.")
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
144
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
145 (defvar user-init-directory-base ".xemacs"
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
146 "Base of directory where user-installed init files may go.")
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
147
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
148 (defvar user-init-directory
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
149 (file-name-as-directory
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
150 (paths-construct-path (list "~" user-init-directory-base)))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
151 "Directory where user-installed init files may go.")
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
152
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
153 (defvar user-init-file-base "init.el"
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
154 "Default name of the user init file if uncompiled.
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
155 This should be used for migration purposes only.")
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
156
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
157 (defvar user-init-file-base-list '("init.el")
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
158 "List of allowed init files in the user's init directory.
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
159 The first one found takes precedence. .elc files do not need to be listed.")
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
160
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
161 (defvar user-home-init-file-base-list
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
162 (append '(".emacs.el" ".emacs")
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
163 (and (eq system-type 'windows-nt)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
164 '("_emacs.el" "_emacs")))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
165 "List of allowed init files in the user's home directory.
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
166 The first one found takes precedence. .elc files do not need to be listed.")
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
167
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
168 (defvar load-home-init-file nil
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
169 "Non-nil if XEmacs should load the init file from the home directory.
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
170 Otherwise, XEmacs will offer migration to the init directory.")
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
171
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
172 (defvar load-user-init-file-p t
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
173 "Non-nil if XEmacs should load the user's init file.")
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
174
3360
316fddbf58e2 [xemacs-hg @ 2006-04-25 14:01:52 by stephent]
stephent
parents: 2756
diff changeset
175 ;; #### called `site-run-file' in GNU Emacs
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
177 (defvar site-start-file "site-start"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 "File containing site-wide run-time initializations.
2030
488b2f76d852 [xemacs-hg @ 2004-04-19 08:54:47 by stephent]
stephent
parents: 1389
diff changeset
179 It is loaded at run-time before the user's init file (see `user-init-file').
488b2f76d852 [xemacs-hg @ 2004-04-19 08:54:47 by stephent]
stephent
parents: 1389
diff changeset
180 It contains inits that need to be in place for the entire site, but
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 which, due to their higher incidence of change, don't make sense to
2030
488b2f76d852 [xemacs-hg @ 2004-04-19 08:54:47 by stephent]
stephent
parents: 1389
diff changeset
182 load into XEmacs's dumped image. Thus, the run-time load order is:
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 1. file described in this variable, if non-nil;
2030
488b2f76d852 [xemacs-hg @ 2004-04-19 08:54:47 by stephent]
stephent
parents: 1389
diff changeset
185 2. the file computed by `find-user-init-file';
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 3. `/path/to/xemacs/lisp/default.el'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 Don't use the `site-start.el' file for things some users may not like.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 Put them in `default.el' instead, so that users can more easily
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 override them. Users can prevent loading `default.el' with the `-q'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 option or by setting `inhibit-default-init' in their own init files,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 but inhibiting `site-start.el' requires `--no-site-file', which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 is less convenient.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 ;;(defconst iso-8859-1-locale-regexp "8859[-_]?1"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 ;; "Regexp that specifies when to enable the ISO 8859-1 character set.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 ;;We do that if this regexp matches the locale name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 ;;specified by the LC_ALL, LC_CTYPE and LANG environment variables.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
200 (defcustom mail-host-address nil
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
201 "*Name of this machine, for purposes of naming users."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
202 :type 'string
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
203 :group 'mail)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
205 (defcustom user-mail-address nil
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 "*Full mailing address of this user.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 This is initialized based on `mail-host-address',
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
208 after your init file is read, in case it sets `mail-host-address'."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
209 :type 'string
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
210 :group 'mail)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 (defvar init-file-debug nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 (defvar init-file-had-error nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 (defvar init-file-loaded nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 "True after the user's init file has been loaded (or suppressed with -q).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 This will be true when `after-init-hook' is run and at all times
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 after, and will not be true at any time before.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 (defvar initial-frame-unmapped-p nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 (defvar command-switch-alist
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
226 '(("-help" . command-line-do-help)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
227 ("-version" . command-line-do-version)
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
228 ("-V" . command-line-do-version)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
229 ("-funcall" . command-line-do-funcall)
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
230 ("-f" . command-line-do-funcall)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
231 ("-e" . command-line-do-funcall-1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
232 ("-eval" . command-line-do-eval)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
233 ("-load" . command-line-do-load)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
234 ("-l" . command-line-do-load)
4448
fd8a9a4d81d9 Support #!, to allow XEmacs to be called as a script interpreter.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4347
diff changeset
235 ("--script" . command-line-do-script)
fd8a9a4d81d9 Support #!, to allow XEmacs to be called as a script interpreter.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4347
diff changeset
236 ("-script" . command-line-do-script)
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
237 ("-insert" . command-line-do-insert)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
238 ("-i" . command-line-do-insert)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
239 ("-kill" . command-line-do-kill)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
240 ("-eol" . command-line-do-enable-eol-detection)
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
241 ("-enable-eol-detection" . command-line-do-enable-eol-detection)
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
242 ;; Options like +35 are handled specially.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
243 ;; Window-system, site, or package-specific code might add to this.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
244 ;; X11 handles its options by letting Xt remove args from this list.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
245 )
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 "Alist of command-line switches.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 Elements look like (SWITCH-STRING . HANDLER-FUNCTION).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 HANDLER-FUNCTION receives switch name as sole arg;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 remaining command-line args are in the variable `command-line-args-left'.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 ;;; default switches
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 ;;; Note: these doc strings are semi-magical.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 (defun command-line-do-help (arg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 "Print the XEmacs usage message and exit."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 (let ((standard-output 'external-debugging-output))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 (princ (concat "\n" (emacs-version) "\n\n"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 (princ
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 (if (featurep 'x)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 (concat "When creating a window on an X display, "
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 (emacs-name)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 " accepts all standard X Toolkit
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 command line options plus the following:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 -iconname <title> Use title as the icon name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 -mc <color> Use color as the mouse color.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 -cr <color> Use color as the text-cursor foregound color.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 -private Install a private colormap.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 In addition, the")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 "The"))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
271 (let ((l command-switch-alist)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
272 (options " following options are accepted:
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
273
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
274 Display options:
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
275
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
276 -nw Open the initial frame on the current TTY, instead of
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
277 a window system.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
278 -t <device> Use TTY <device> instead of the current TTY for input
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
279 and output. This implies the -nw option.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
280 -display <display> Standard X option, to specify the display connection.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
281 If this option is given, or if the environment
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
282 variable DISPLAY is set, an initial X frame will be
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
283 created. Otherwise, an initial Windows frame will be
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
284 created if Windows support exists and neither -nw nor
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
285 -t is given. Otherwise, a TTY frame is created.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
286 -unmapped Do not display the initial frame. Useful to create
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
287 a \"server\" that can accept `gnuclient' connections.
3360
316fddbf58e2 [xemacs-hg @ 2006-04-25 14:01:52 by stephent]
stephent
parents: 2756
diff changeset
288 -tty Create the initial frame on the given window system.
316fddbf58e2 [xemacs-hg @ 2006-04-25 14:01:52 by stephent]
stephent
parents: 2756
diff changeset
289 -x (Requesting an unsupported window system, or giving
316fddbf58e2 [xemacs-hg @ 2006-04-25 14:01:52 by stephent]
stephent
parents: 2756
diff changeset
290 -gtk conflicting window systems, is a fatal error.)
316fddbf58e2 [xemacs-hg @ 2006-04-25 14:01:52 by stephent]
stephent
parents: 2756
diff changeset
291 -gnome
316fddbf58e2 [xemacs-hg @ 2006-04-25 14:01:52 by stephent]
stephent
parents: 2756
diff changeset
292 -msw
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
293
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
294 Noninteractive options:
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
295
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
296 {-help}
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
297 {-version}
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
298 {-V}
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
299 -batch Execute noninteractively (messages go to stderr, no
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
300 initial frame created).
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
301 {-funcall}
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
302 (The function may parse the rest of the command line
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
303 for its arguments.)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
304 {-f}
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
305 {-eval}
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
306 {-load}
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
307 {-l}
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
308 {-insert}
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
309 {-i}
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
310 {-kill}
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
311 -sd Show dump ID. Ignored when configured without --pdump.
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
312 -nd Don't load the dump file. Roughly like old temacs.
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
313 Ignored when configured without --pdump.
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
314
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
315 Initialization files:
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
316
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
317 -no-init-file Do not load the user-specific init file.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
318 -q Same as -no-init-file.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 -debug-init Enter the debugger if an error in the init file occurs.
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
320 -user-init-file <file>
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
321 Use <file> as init file.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
322 -user-init-directory <directory>
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
323 Use <directory> as init directory.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
324 -user <user> Load user's init file instead of your own.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
325 -u <user> Same as -user.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
326 -no-site-file Do not load the site-specific init file
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
327 (site-start.el).
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
328
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
329 Package/module options:
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
330
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
331 -vanilla Equivalent to -q -no-site-file -no-early-packages.
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
332 Useful if you think some user-init or site-init code
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
333 is messing things up, or when running XEmacs in
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
334 batch mode.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
335 -no-autoloads Do not load global symbol files (auto-autoloads) at
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336 startup. Also implies `-vanilla'.
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
337 -no-packages Pretend like the packages don't exist. Don't put
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
338 any packages in the load path or set up any package
969
d41e92ee6d12 [xemacs-hg @ 2002-08-22 11:19:45 by stephent]
stephent
parents: 866
diff changeset
339 autoloads. Also implies `-vanilla'. Use this when
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
340 running XEmacs in batch mode when you aren't using
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
341 any functionality in packages and want to make sure
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
342 that you get no interference from packages
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
343 (e.g. Lisp files that shadow core Lisp files).
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
344 -no-early-packages Do not process early packages.
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
345 -debug-paths Display info about the runtime values of various
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
346 directory variables (e.g. for loading packages).
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
347 -no-site-modules Do not search site-modules directories for modules
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
348 at startup. Only applies when modules support is
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
349 compiled into XEmacs.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
350
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
351 Encoding options:
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
352
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
353 -eol Turn on EOL detection (only applies to Unix, no
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
354 international support; otherwise EOL detection is
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
355 already on).
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
356 -nuni Under MS Windows, disable use of the Unicode versions
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
357 of API calls. Not for Windows 95/98/ME. This is
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
358 mostly only useful for debugging purposes.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
359
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
360 Misc:
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
361
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
362 +N <file> Start displaying <file> at line N.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
363 ")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364 (insert (lambda (&rest x)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365 (let ((len 2))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 (while x
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 (princ (car x))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368 (incf len (length (car x)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369 (setq x (cdr x)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370 (when (>= len 24)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 (terpri) (setq len 0))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372 (while (< len 24)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373 (princ " ")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 (incf len))))))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
375 (princ
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
376 (with-temp-buffer
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
377 (insert options)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
378 (while l
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
379 (let ((name (car (car l)))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
380 (fn (cdr (car l)))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
381 doc arg cons)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
382 (cond
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
383 ((and (symbolp fn) (get fn 'undocumented)) nil)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
384 (t
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
385 (setq doc (documentation fn))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
386 (if (member doc '(nil "")) (setq doc "(undocumented)"))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
387 (cond ((string-match "\n\\(<.*>\\)\n?\\'" doc)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
388 ;; Doc of the form "The frobber switch\n<arg1> <arg2>"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
389 (setq arg (substring doc (match-beginning 1) (match-end 1))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
390 doc (substring doc 0 (match-beginning 0))))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
391 ((string-match "\n+\\'" doc)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
392 (setq doc (substring doc 0 (match-beginning 0)))))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
393 (if (and (setq cons (rassq fn command-switch-alist))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
394 (not (eq cons (car l))))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
395 (setq doc (format "Same as %s." (car cons))))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
396 (goto-char (point-min))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
397 (when (search-forward (format "{%s}" name) nil t)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
398 (delete-region (match-beginning 0) (match-end 0))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
399 (let ((standard-output (current-buffer)))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
400 (if arg
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
401 (funcall insert name " " arg)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
402 (funcall insert name))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
403 (princ doc))))))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
404 (setq l (cdr l)))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
405 (buffer-string))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
406 (princ (concat "\
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408 Anything else is considered a file name, and is placed into a buffer for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
409 editing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
410
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
411 " (emacs-name) " has an online tutorial and manuals. Type ^Ht (Control-h t) after
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
412 starting XEmacs to run the tutorial. Type ^Hi to enter the manual browser.
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
413 Type ^H^H^H (Control-h Control-h Control-h) to get more help options.\n"))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
414
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
415 (kill-emacs 0)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
416 ))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
417
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
418 (defun command-line-do-funcall (arg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
419 "Invoke the named lisp function with no arguments.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
420 <function>"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
421 (funcall (intern (pop command-line-args-left))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
422 (fset 'command-line-do-funcall-1 'command-line-do-funcall)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
423 (put 'command-line-do-funcall-1 'undocumented t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
424
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
425 (defun command-line-do-eval (arg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
426 "Evaluate the lisp form. Quote it carefully.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
427 <form>"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
428 (eval (read (pop command-line-args-left))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
429
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
430 (defun command-line-do-load (arg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
431 "Load the named file of Lisp code into XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
432 <file>"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
433 (let ((file (pop command-line-args-left)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
434 ;; Take file from default dir if it exists there;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435 ;; otherwise let `load' search for it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 (if (file-exists-p (expand-file-name file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437 (setq file (expand-file-name file)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438 (load file nil t)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
439
4448
fd8a9a4d81d9 Support #!, to allow XEmacs to be called as a script interpreter.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4347
diff changeset
440 (defun command-line-do-script (arg)
fd8a9a4d81d9 Support #!, to allow XEmacs to be called as a script interpreter.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4347
diff changeset
441 "Load the named file of Lisp code into XEmacs.
fd8a9a4d81d9 Support #!, to allow XEmacs to be called as a script interpreter.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4347
diff changeset
442 <file>"
fd8a9a4d81d9 Support #!, to allow XEmacs to be called as a script interpreter.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4347
diff changeset
443 (let ((file (pop command-line-args-left)))
fd8a9a4d81d9 Support #!, to allow XEmacs to be called as a script interpreter.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4347
diff changeset
444 (load file nil t t)))
fd8a9a4d81d9 Support #!, to allow XEmacs to be called as a script interpreter.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4347
diff changeset
445
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
446 (defun command-line-do-insert (arg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
447 "Insert file into the current buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
448 <file>"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
449 (insert-file-contents (pop command-line-args-left)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
450
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
451 (defun command-line-do-kill (arg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
452 "Exit XEmacs."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
453 (kill-emacs t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
454
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
455 (defun command-line-do-version (arg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
456 "Print version info and exit."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
457 (princ (concat (emacs-version) "\n"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
458 (kill-emacs 0))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
459
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
460 (defun command-line-do-enable-eol-detection (arg)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
461 "Turn on EOL detection (only applies to Unix)."
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
462 (set-eol-detection t))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
463
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
465 ;;; Processing the command line and loading various init files
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
466
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
467 (defun early-error-handler (&rest debugger-args)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
468 "You should probably not be using this."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 ;; Used as the debugger during XEmacs initialization; if an error occurs,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470 ;; print some diagnostics, and kill XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
472 ;; output the contents of the warning buffer, since it won't be seen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
473 ;; otherwise.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
474 ;; #### kludge! The call to Feval forces the pending warnings to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
475 ;; get output. There definitely needs to be a better way.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
476 (let ((buffer (eval (get-buffer-create "*Warnings*"))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
477 (princ (buffer-substring (point-min buffer) (point-max buffer) buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
478 'external-debugging-output))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
480 (let ((string "Initialization error")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
481 (error (nth 1 debugger-args))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
482 (debug-on-error nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
483 (stream 'external-debugging-output))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
484 (if (null error)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
485 (princ string stream)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
486 (princ (concat "\n" string ": ") stream)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487 (condition-case ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
488 (display-error error stream)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
489 (error (princ "<<< error printing error message >>>" stream)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
490 (princ "\n" stream)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
491 (if (memq (car-safe error) '(void-function void-variable))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
492 (princ "
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
493 This probably means that XEmacs is picking up an old version of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
494 the lisp library, or that some .elc files are not up-to-date.\n"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
495 stream)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
496 (when (not suppress-early-error-handler-backtrace)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
497 (let ((print-length 1000)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
498 (print-level 1000)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
499 (print-escape-newlines t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
500 (print-readably nil))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
501 (when (getenv "EMACSLOADPATH")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
502 (princ (format "\n$EMACSLOADPATH is %s" (getenv "EMACSLOADPATH"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
503 stream))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
504 (princ (format "\nexec-directory is %S" exec-directory) stream)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
505 (princ (format "\ndata-directory is %S" data-directory) stream)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506 (princ (format "\ndata-directory-list is %S" data-directory-list) stream)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
507 (princ (format "\ndoc-directory is %S" doc-directory) stream)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
508 (princ (format "\nload-path is %S" load-path) stream)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
509 (princ "\n\n" stream)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
510 (when (not suppress-early-error-handler-backtrace)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
511 (backtrace stream t)))
778
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 776
diff changeset
512 (if-fboundp 'mswindows-message-box
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
513 (mswindows-message-box "Initialization error"))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
514 (kill-emacs -1))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
515
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
516 (defun normal-top-level ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
517 (if command-line-processed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
518 (message "Back to top level.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
519 (setq command-line-processed t)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
520 ;; Do this first for maximum likelihood of catching errors. The main
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
521 ;; purpose of this is so that debug-on-error can be set to catch errors
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
522 ;; during normal noninteractive running.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
523 (when (getenv "XEMACSDEBUG")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
524 (eval (read (getenv "XEMACSDEBUG"))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
525 ;; Canonicalize HOME (PWD is canonicalized by init_buffer in buffer.c)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
526 (let ((value (user-home-directory)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
527 (if (and value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
528 (< (length value) (length default-directory))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
529 (equal (file-attributes default-directory)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
530 (file-attributes value)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
531 (setq default-directory (file-name-as-directory value))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
532 (setq default-directory (abbreviate-file-name default-directory))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
533 (initialize-xemacs-paths)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
534
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
535 (startup-set-invocation-environment)
1330
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
536 (startup-setup-paths (cond (inhibit-all-packages t)
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
537 (inhibit-early-packages '(early))
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
538 (t nil))
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
539 nil)
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
540 (startup-setup-paths-warning)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
541
1232
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
542 ;; Either we need to inhibit messages from do_autoloads, or this
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
543 ;; should go into (command-line) after the initialization of the
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
544 ;; frame?
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 502
diff changeset
545 (startup-load-autoloads)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
546
866
613552a02607 [xemacs-hg @ 2002-06-04 17:39:43 by andyp]
andyp
parents: 863
diff changeset
547 (let (error-data)
1123
37bdd24225ef [xemacs-hg @ 2002-11-27 07:15:02 by ben]
ben
parents: 996
diff changeset
548 ;; if noninteractive, an error will kill us. by catching and
37bdd24225ef [xemacs-hg @ 2002-11-27 07:15:02 by ben]
ben
parents: 996
diff changeset
549 ;; resignalling, we don't accomplish much, but do make it difficult
37bdd24225ef [xemacs-hg @ 2002-11-27 07:15:02 by ben]
ben
parents: 996
diff changeset
550 ;; to determine where the error really occurred. when interactive,
37bdd24225ef [xemacs-hg @ 2002-11-27 07:15:02 by ben]
ben
parents: 996
diff changeset
551 ;; however, an error processing the command line does NOT kill us;
37bdd24225ef [xemacs-hg @ 2002-11-27 07:15:02 by ben]
ben
parents: 996
diff changeset
552 ;; instead, the error handler tries to display an error on the frame.
37bdd24225ef [xemacs-hg @ 2002-11-27 07:15:02 by ben]
ben
parents: 996
diff changeset
553 ;; In that case, we must make sure that all the remaining initialization
37bdd24225ef [xemacs-hg @ 2002-11-27 07:15:02 by ben]
ben
parents: 996
diff changeset
554 ;; gets done!!!
37bdd24225ef [xemacs-hg @ 2002-11-27 07:15:02 by ben]
ben
parents: 996
diff changeset
555 ;;
37bdd24225ef [xemacs-hg @ 2002-11-27 07:15:02 by ben]
ben
parents: 996
diff changeset
556 ;; #### A better solution in the interactive case is to use
37bdd24225ef [xemacs-hg @ 2002-11-27 07:15:02 by ben]
ben
parents: 996
diff changeset
557 ;; call-with-condition-handler, which would let us do the rest of
37bdd24225ef [xemacs-hg @ 2002-11-27 07:15:02 by ben]
ben
parents: 996
diff changeset
558 ;; the initialization AND allow the user to get an accurate backtrace.
37bdd24225ef [xemacs-hg @ 2002-11-27 07:15:02 by ben]
ben
parents: 996
diff changeset
559 (if (noninteractive)
866
613552a02607 [xemacs-hg @ 2002-06-04 17:39:43 by andyp]
andyp
parents: 863
diff changeset
560 (command-line)
1123
37bdd24225ef [xemacs-hg @ 2002-11-27 07:15:02 by ben]
ben
parents: 996
diff changeset
561 (condition-case data
37bdd24225ef [xemacs-hg @ 2002-11-27 07:15:02 by ben]
ben
parents: 996
diff changeset
562 (command-line)
37bdd24225ef [xemacs-hg @ 2002-11-27 07:15:02 by ben]
ben
parents: 996
diff changeset
563 ;; catch non-error signals, especially quit
37bdd24225ef [xemacs-hg @ 2002-11-27 07:15:02 by ben]
ben
parents: 996
diff changeset
564 (t (setq error-data data))))
452
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
565 ;; Do this again, in case the init file defined more abbreviations.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
566 (setq default-directory (abbreviate-file-name default-directory))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
567 ;; Specify the file for recording all the auto save files of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
568 ;; this session. This is used by recover-session.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
569 (if auto-save-list-file-prefix
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
570 (setq auto-save-list-file-name
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
571 (expand-file-name
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
572 (format "%s%d-%s"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
573 auto-save-list-file-prefix
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
574 (emacs-pid)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
575 (system-name)))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
576 (run-hooks 'emacs-startup-hook)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
577 (and term-setup-hook
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
578 (run-hooks 'term-setup-hook))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
579 (setq term-setup-hook nil)
452
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
580 ;; ;; Modify the initial frame based on what the init file puts into
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
581 ;; ;; ...-frame-alist.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
582 (frame-notice-user-settings)
3360
316fddbf58e2 [xemacs-hg @ 2006-04-25 14:01:52 by stephent]
stephent
parents: 2756
diff changeset
583 ;; ;;#### GNU Emacs junk
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
584 ;; ;; Now we know the user's default font, so add it to the menu.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
585 ;; (if (fboundp 'font-menu-add-default)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
586 ;; (font-menu-add-default))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
587 (when window-setup-hook
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
588 (run-hooks 'window-setup-hook))
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 811
diff changeset
589 (setq window-setup-hook nil)
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 811
diff changeset
590 (if error-data
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 811
diff changeset
591 ;; re-signal, and don't allow continuation as that will probably
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 811
diff changeset
592 ;; wipe out the user's .emacs if she hasn't migrated yet!
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 811
diff changeset
593 (signal-error (car error-data) (cdr error-data))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
594
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
595 (if load-user-init-file-p
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
596 (maybe-migrate-user-init-file))
3360
316fddbf58e2 [xemacs-hg @ 2006-04-25 14:01:52 by stephent]
stephent
parents: 2756
diff changeset
597 ;; GNU calls precompute-menubar-bindings. We don't mix menubars
611
38db05db9cb5 [xemacs-hg @ 2001-06-08 12:21:09 by ben]
ben
parents: 528
diff changeset
598 ;; and keymaps.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
599 ))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
600
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
601 (defun command-line-early (args)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
602 ;; This processes those switches which need to be processed before
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
603 ;; starting up the window system.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
604
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
605 (setq command-line-default-directory default-directory)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
606
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
607 ;; See if we should import version-control from the environment variable.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
608 (let ((vc (getenv "VERSION_CONTROL")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
609 (cond ((eq vc nil)) ;don't do anything if not set
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
610 ((or (string= vc "t")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
611 (string= vc "numbered"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
612 (setq version-control t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
613 ((or (string= vc "nil")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
614 (string= vc "existing"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
615 (setq version-control nil))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
616 ((or (string= vc "never")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
617 (string= vc "simple"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
618 (setq version-control 'never))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
619
3360
316fddbf58e2 [xemacs-hg @ 2006-04-25 14:01:52 by stephent]
stephent
parents: 2756
diff changeset
620 ;;#### GNU Emacs
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
621 ;; (if (let ((ctype
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
622 ;; ;; Use the first of these three envvars that has a nonempty value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
623 ;; (or (let ((string (getenv "LC_ALL")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
624 ;; (and (not (equal string "")) string))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
625 ;; (let ((string (getenv "LC_CTYPE")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
626 ;; (and (not (equal string "")) string))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
627 ;; (let ((string (getenv "LANG")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
628 ;; (and (not (equal string "")) string)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
629 ;; (and ctype
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
630 ;; (string-match iso-8859-1-locale-regexp ctype)))
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
631 ;; (progn
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
632 ;; (standard-display-european t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
633 ;; (require 'iso-syntax)))
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
634
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
635 (if vanilla-inhibiting ;; set in main_1()
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
636 (setq load-user-init-file-p nil
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
637 site-start-file nil)
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
638 (setq load-user-init-file-p (not (noninteractive))))
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
639
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
640 ;; Allow (at least) these arguments anywhere in the command line
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
641 (macrolet ((long-argmatch (match)
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
642 ;; use a macro to avoid lots of concatting at runtime
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
643 `(or (string= arg ,match)
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
644 (string= arg ,(concat "-" match)))))
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
645 (let ((new-args nil)
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
646 (arg nil))
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
647 (while args
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
648 (setq arg (pop args))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
649 (cond
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
650 ((or (string= arg "-q")
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
651 (long-argmatch "-no-init-file"))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
652 (setq load-user-init-file-p nil))
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
653 ((long-argmatch "-no-site-file")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
654 (setq site-start-file nil))
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
655 ((long-argmatch "-user-init-file")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
656 (setq user-init-file (pop args)))
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
657 ((long-argmatch "-user-init-directory")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
658 (setq user-init-directory (file-name-as-directory (pop args))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
659 ((or (string= arg "-u")
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
660 (long-argmatch "-user"))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
661 (let* ((user (pop args))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
662 (home-user (concat "~" user)))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
663 (setq user-init-directory (file-name-as-directory
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
664 (paths-construct-path
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
665 (list home-user user-init-directory-base))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
666 (setq user-init-file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
667 (find-user-init-file user-init-directory home-user))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
668 (setq custom-file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
669 (make-custom-file-name user-init-file))))
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
670 ((long-argmatch "-debug-init")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
671 (setq init-file-debug t))
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
672 ((long-argmatch "-unmapped")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
673 (setq initial-frame-unmapped-p t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
674 ((or (string= arg "--") (string= arg "-"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
675 (while args
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
676 (push (pop args) new-args)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
677 (t (push arg new-args))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
678
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
679 (with-obsolete-variable 'init-file-user
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
680 (setq init-file-user (and load-user-init-file-p "")))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
681
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
682 (nreverse new-args))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
683
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
684 (defconst initial-scratch-message "\
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
685 ;; This buffer is for notes you don't want to save, and for Lisp evaluation.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
686 ;; If you want to create a file, first visit that file with C-x C-f,
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
687 ;; then enter the text in that file's own buffer. (C-x is the standard
684
c6ad4a798ab9 [xemacs-hg @ 2001-12-03 06:49:11 by youngs]
youngs
parents: 611
diff changeset
688 ;; XEmacs abbreviation for `Control+x', i.e. hold down the Control key
c6ad4a798ab9 [xemacs-hg @ 2001-12-03 06:49:11 by youngs]
youngs
parents: 611
diff changeset
689 ;; while hitting the x key.)
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
690 ;;
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
691 ;; For Lisp evaluation, type an expression, move to the end and hit C-j.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
692
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
693 "
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
694 "Initial message displayed in *scratch* buffer at startup.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
695 If this is nil, no message will be displayed.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
696
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
697 (defun command-line ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
698 (let ((command-line-args-left (cdr command-line-args)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
699
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
700 (let ((debugger 'early-error-handler)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
701 (debug-on-error t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
702
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
703 ;; Process magic command-line switches like -q and -u. Do this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
704 ;; before creating the first frame because some of these switches
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
705 ;; may affect that. I think it's ok to do this before establishing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
706 ;; the X connection, and maybe someday things like -nw can be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
707 ;; handled here instead of down in C.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
708 (setq command-line-args-left (command-line-early command-line-args-left))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
709
611
38db05db9cb5 [xemacs-hg @ 2001-06-08 12:21:09 by ben]
ben
parents: 528
diff changeset
710 (when (eq system-type 'windows-nt)
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 771
diff changeset
711 (declare-fboundp (init-mswindows-at-startup)))
611
38db05db9cb5 [xemacs-hg @ 2001-06-08 12:21:09 by ben]
ben
parents: 528
diff changeset
712
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
713 ;; Setup the toolbar icon directory
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
714 (when (featurep 'toolbar)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
715 (init-toolbar-location))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
716
2699
96036853a107 [xemacs-hg @ 2005-03-29 02:58:56 by aidan]
aidan
parents: 2505
diff changeset
717 ;; Setup coding systems and Unicode support--needs to be before X11
96036853a107 [xemacs-hg @ 2005-03-29 02:58:56 by aidan]
aidan
parents: 2505
diff changeset
718 ;; initialisation in case of keysyms of the form UABCD.
96036853a107 [xemacs-hg @ 2005-03-29 02:58:56 by aidan]
aidan
parents: 2505
diff changeset
719 (when (featurep 'mule)
96036853a107 [xemacs-hg @ 2005-03-29 02:58:56 by aidan]
aidan
parents: 2505
diff changeset
720 (declare-fboundp (init-mule-at-startup)))
96036853a107 [xemacs-hg @ 2005-03-29 02:58:56 by aidan]
aidan
parents: 2505
diff changeset
721
487
54fa1a5c2d12 [xemacs-hg @ 2001-04-28 07:48:36 by ben]
ben
parents: 470
diff changeset
722 (if (featurep 'toolbar)
5228
5efbd1253905 Remove all support for InfoDock.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4806
diff changeset
723 (init-toolbar))
487
54fa1a5c2d12 [xemacs-hg @ 2001-04-28 07:48:36 by ben]
ben
parents: 470
diff changeset
724
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4448
diff changeset
725 ;; Create the initial device (which may be the already-created stdio
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4448
diff changeset
726 ;; device, if we're noninteractive).
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4448
diff changeset
727 (make-device initial-device-type nil nil)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
728
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
729 ;; When not in batch mode, this creates the first visible frame,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
730 ;; and deletes the stdio device.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
731 (frame-initialize))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
732
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
733 ;; Reinitialize faces if necessary. This function changes face if
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
734 ;; it is created during auto-autoloads loading. Otherwise, it
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
735 ;; does nothing.
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
736 (startup-initialize-custom-faces)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
737
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
738 ;; A couple of other things need to be initted.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
739 ;; (RMS writes about internally using hooks for this, in reference
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
740 ;; to frame-initialize and frame-notice-user-settings:
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
741 ;;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
742 ;; These are now called explicitly at the proper times,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
743 ;; since that is easier to understand.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
744 ;; Actually using hooks within Emacs is bad for future maintenance. --rms.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
745 ;;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 684
diff changeset
746 ;; In this case, I completely agree. --ben
811
7778a469a8ac [xemacs-hg @ 2002-04-07 19:36:13 by wmperry]
wmperry
parents: 793
diff changeset
747 (if (featurep 'menubar)
7778a469a8ac [xemacs-hg @ 2002-04-07 19:36:13 by wmperry]
wmperry
parents: 793
diff changeset
748 (init-menubar-at-startup))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
749 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
750 ;; We have normality, I repeat, we have normality. Anything you still
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
751 ;; can't cope with is therefore your own problem. (And we don't need
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
752 ;; to kill XEmacs for it.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
753 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
754
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
755 ;;; Load init files.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
756 (load-init-file)
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
757
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
758 (with-current-buffer (get-buffer "*scratch*")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
759 (erase-buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
760 ;; (insert initial-scratch-message)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
761 (set-buffer-modified-p nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
762 (when (eq major-mode 'fundamental-mode)
2756
f441e940eed8 [xemacs-hg @ 2005-05-05 16:55:39 by aidan]
aidan
parents: 2699
diff changeset
763 (funcall initial-major-mode))
f441e940eed8 [xemacs-hg @ 2005-05-05 16:55:39 by aidan]
aidan
parents: 2699
diff changeset
764 ;; The docstring for font-lock-set-defaults says that major modes that
f441e940eed8 [xemacs-hg @ 2005-05-05 16:55:39 by aidan]
aidan
parents: 2699
diff changeset
765 ;; have any font-lock defaults specified should call the function
f441e940eed8 [xemacs-hg @ 2005-05-05 16:55:39 by aidan]
aidan
parents: 2699
diff changeset
766 ;; after initialising the `major-mode' variable. None of them do,
f441e940eed8 [xemacs-hg @ 2005-05-05 16:55:39 by aidan]
aidan
parents: 2699
diff changeset
767 ;; however, and any font locking that is ever put in place is done as
f441e940eed8 [xemacs-hg @ 2005-05-05 16:55:39 by aidan]
aidan
parents: 2699
diff changeset
768 ;; a result of `font-lock-set-defaults' being in find-file-hook and
f441e940eed8 [xemacs-hg @ 2005-05-05 16:55:39 by aidan]
aidan
parents: 2699
diff changeset
769 ;; various other places. We could make *scratch* honour the user's
f441e940eed8 [xemacs-hg @ 2005-05-05 16:55:39 by aidan]
aidan
parents: 2699
diff changeset
770 ;; choice of whether font-locking is in place by adding a call to
f441e940eed8 [xemacs-hg @ 2005-05-05 16:55:39 by aidan]
aidan
parents: 2699
diff changeset
771 ;; font-lock-set-defaults in `lisp-interaction-mode'; but that'll
5384
3889ef128488 Fix misspelled words, and some grammar, across the entire source tree.
Jerry James <james@xemacs.org>
parents: 5228
diff changeset
772 ;; break if `initial-major-mode' is anything else.
2756
f441e940eed8 [xemacs-hg @ 2005-05-05 16:55:39 by aidan]
aidan
parents: 2699
diff changeset
773 ;;
f441e940eed8 [xemacs-hg @ 2005-05-05 16:55:39 by aidan]
aidan
parents: 2699
diff changeset
774 ;; So, despite what `font-lock-set-defaults'' docstring says, this
f441e940eed8 [xemacs-hg @ 2005-05-05 16:55:39 by aidan]
aidan
parents: 2699
diff changeset
775 ;; *is* where we should call it to have the user's choice of font-lock
f441e940eed8 [xemacs-hg @ 2005-05-05 16:55:39 by aidan]
aidan
parents: 2699
diff changeset
776 ;; level take effect in *scratch*. If the modes are rewritten to do
f441e940eed8 [xemacs-hg @ 2005-05-05 16:55:39 by aidan]
aidan
parents: 2699
diff changeset
777 ;; the right then, we're okay too, the function is idempotent.
f441e940eed8 [xemacs-hg @ 2005-05-05 16:55:39 by aidan]
aidan
parents: 2699
diff changeset
778 (font-lock-set-defaults))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
779
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
780 ;; Load library for our terminal type.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
781 ;; User init file can set term-file-prefix to nil to prevent this.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
782 ;; Note that for any TTY's opened subsequently, the TTY init
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
783 ;; code will run this.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
784 (when (and (eq 'tty (console-type))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
785 (not (noninteractive)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
786 (load-terminal-library))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
787
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
788 ;; Process the remaining args.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
789 (command-line-1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
790
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
791 ;; it was turned on by default so that the warnings don't get displayed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
792 ;; until after the splash screen.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
793 (setq inhibit-warning-display nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
794 ;; If -batch, terminate after processing the command options.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
795 (when (noninteractive) (kill-emacs t))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
796
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
797 (defun load-terminal-library ()
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
798 (when term-file-prefix
5584
d469c668462e #'load-terminal-library; load term files correctly for gnuclient consoles.
Aidan Kehoe <kehoea@parhasard.net>
parents: 5474
diff changeset
799 (let ((term (console-tty-terminal-type))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
800 hyphend)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
801 (while (and term
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
802 (not (load (concat term-file-prefix term) t t)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
803 ;; Strip off last hyphen and what follows, then try again
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
804 (if (setq hyphend (string-match "[-_][^-_]+\\'" term))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
805 (setq term (substring term 0 hyphend))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
806 (setq term nil))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
807
1330
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
808 (defun find-init-file-1 (dir base-list)
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
809 (catch 'found
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
810 (dolist (file base-list)
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
811 (let ((expanded (expand-file-name file dir)))
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
812 (if (string-match "el$" expanded)
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
813 (let* ((elc (concat expanded "c"))
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
814 (el-ok (file-readable-p expanded))
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
815 (elc-ok (file-readable-p elc)))
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
816 (cond
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
817 ((and el-ok elc-ok (file-newer-than-file-p expanded elc))
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
818 (lwarn 'initialization 'warning
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
819 "\
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
820 The compiled initialization file `%s' exists
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
821 but is out-of-date with respect to the uncompiled initialization
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
822 file `%s'. XEmacs will load the uncompiled
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
823 version. You should correct the problem as soon as possible by
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
824 loading the uncompiled version and compiling it using
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
825 `M-x byte-compile-file' (or `Lisp->Byte-Compile This File' on
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
826 the menubar)."
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
827 elc expanded)
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
828 (throw 'found expanded))
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
829 (elc-ok (throw 'found elc))
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
830 (el-ok (throw 'found expanded))))
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
831 (when (file-readable-p
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
832 (when (file-readable-p expanded)
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
833 (throw 'found expanded)))))))))
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
834
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
835 (defun find-user-init-directory-init-file (&optional init-directory)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
836 "Determine the user's init file if in the init directory."
1330
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
837 (find-init-file-1 (or init-directory user-init-directory)
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
838 user-init-file-base-list))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
839
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
840 (defun find-user-home-directory-init-file (&optional home-directory)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
841 "Determine the user's init file if in the home directory."
1330
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
842 (find-init-file-1 (or home-directory "~")
4542b72c005e [xemacs-hg @ 2003-03-01 07:25:26 by ben]
ben
parents: 1232
diff changeset
843 user-home-init-file-base-list))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
844
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
845 (defun find-user-init-file (&optional init-directory home-directory)
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
846 "Determine the user's init file."
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
847 (if load-home-init-file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
848 (find-user-home-directory-init-file home-directory)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
849 (or (find-user-init-directory-init-file init-directory)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
850 (find-user-home-directory-init-file home-directory))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
851
4347
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
852 (defun ask-about-user-init-file-migration-p ()
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
853 "Check whether we want to ask the user if she wants to migrate the init file."
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
854 (and (not load-home-init-file)
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
855 (not (find-user-init-directory-init-file user-init-directory))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
856 (stringp user-init-file)
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
857 (file-readable-p user-init-file)))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
858
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
859 (defun maybe-migrate-user-init-file ()
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
860 "Ask user if she wants to migrate the init file(s) to new location."
4347
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
861 (if (ask-about-user-init-file-migration-p)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
862 (if (with-output-to-temp-buffer (help-buffer-name nil)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
863 (progn
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
864 (princ "XEmacs recommends that the initialization code in
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
865 ")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
866 (princ user-init-file)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
867 (princ "
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
868 be migrated to the ")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
869 (princ user-init-directory)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
870 (princ " directory. XEmacs can
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
871 perform the migration automatically.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
872
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
873 After the migration, init.el/init.elc holds user-written
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
874 initialization code. Moreover the customize settings will be in
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
875 custom.el.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
876
452
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
877 You can undo the migration at any time with
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
878 M-x maybe-unmigrate-user-init-file.
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
879
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
880 If you choose not to do this now, XEmacs will not ask you this
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
881 question in the future. However, you can still make XEmacs
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
882 perform the migration at any time with M-x migrate-user-init-file.")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
883 (show-temp-buffer-in-current-frame standard-output)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
884 (yes-or-no-p-minibuf (concat "Migrate init file to "
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
885 user-init-directory
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
886 "? "))))
4111
ff446f61f88f [xemacs-hg @ 2007-08-11 14:42:50 by michaels]
michaels
parents: 4093
diff changeset
887
4347
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
888 (progn
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
889 (migrate-user-init-file)
4111
ff446f61f88f [xemacs-hg @ 2007-08-11 14:42:50 by michaels]
michaels
parents: 4093
diff changeset
890 (with-output-to-temp-buffer (help-buffer-name nil)
ff446f61f88f [xemacs-hg @ 2007-08-11 14:42:50 by michaels]
michaels
parents: 4093
diff changeset
891 (progn
ff446f61f88f [xemacs-hg @ 2007-08-11 14:42:50 by michaels]
michaels
parents: 4093
diff changeset
892 (princ "The initialization code has now been migrated to the ")
ff446f61f88f [xemacs-hg @ 2007-08-11 14:42:50 by michaels]
michaels
parents: 4093
diff changeset
893 (princ user-init-directory)
ff446f61f88f [xemacs-hg @ 2007-08-11 14:42:50 by michaels]
michaels
parents: 4093
diff changeset
894 (princ "directory.
ff446f61f88f [xemacs-hg @ 2007-08-11 14:42:50 by michaels]
michaels
parents: 4093
diff changeset
895
ff446f61f88f [xemacs-hg @ 2007-08-11 14:42:50 by michaels]
michaels
parents: 4093
diff changeset
896 For backwards compatibility with, for example, older versions of XEmacs,
ff446f61f88f [xemacs-hg @ 2007-08-11 14:42:50 by michaels]
michaels
parents: 4093
diff changeset
897 XEmacs can create a special old-style .emacs file in your home
4347
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
898 directory which will load the relocated initialization code.
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
899
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
900 NOTE THAT THIS WILL OVERWRITE YOUR EXISTING .emacs FILE!")
4111
ff446f61f88f [xemacs-hg @ 2007-08-11 14:42:50 by michaels]
michaels
parents: 4093
diff changeset
901 (show-temp-buffer-in-current-frame standard-output)
ff446f61f88f [xemacs-hg @ 2007-08-11 14:42:50 by michaels]
michaels
parents: 4093
diff changeset
902 (maybe-create-compatibility-dot-emacs))))
4347
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
903 (set-load-home-init-file user-init-file t))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
904
452
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
905 (defun maybe-create-compatibility-dot-emacs ()
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
906 "Ask user if she wants to create a .emacs compatibility file."
4347
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
907 (if (yes-or-no-p-minibuf "Create compatibility .emacs?")
452
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
908 (create-compatibility-dot-emacs)))
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
909
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
910 (defun migrate-user-init-file ()
4347
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
911 "Migrate the init file from the home directory."
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
912 (interactive)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
913 (if (not (file-exists-p user-init-directory))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
914 (progn
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
915 (message "Creating %s directory..." user-init-directory)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
916 (make-directory user-init-directory)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
917 (message "Migrating custom file...")
4347
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
918 (set-load-home-init-file user-init-file nil)
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
919 (setq custom-file (make-custom-file-name user-init-file 'force-new))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
920 (custom-save-all)
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
921 (message "Copying init file...")
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
922 (let ((new-user-init-file (expand-file-name user-init-file-base
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
923 user-init-directory)))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
924 (copy-file user-init-file new-user-init-file)
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
925 (setq user-init-file new-user-init-file))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
926 (message "Migration done."))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
927
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
928 (defun set-load-home-init-file (filename val)
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
929 "Put code in `filename' to set `load-home-init-file' to `val'.
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
930 More precisely, remove the first `setq' form for `load-home-init-file',
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
931 and replace it by (setq load-home-init-file t) if `val' is non-nil."
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
932 (save-excursion
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
933 (set-buffer (find-file-noselect filename))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
934 (goto-char (point-min))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
935 (condition-case nil
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
936 (block find-existing
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
937 (while (not (eobp))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
938 (forward-sexp 1)
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
939 (backward-sexp 1)
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
940 (let* ((beginning (point))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
941 (sexp (read (current-buffer))))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
942 (if (and (consp sexp)
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
943 (consp (cdr sexp))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
944 (eq 'setq (car sexp))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
945 (eq 'load-home-init-file (cadr sexp)))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
946 (progn
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
947 (forward-line 1)
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
948 (delete-region beginning (point))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
949 (return-from find-existing nil))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
950 (forward-sexp 1)))))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
951 (error nil)) ; ignore if there are no sexprs in the file
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
952 (if val
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
953 (insert "(setq load-home-init-file t) ; don't load init file from ~/.xemacs/init.el\n"))
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
954 (save-buffer)))
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
955
452
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
956 (defun create-compatibility-dot-emacs ()
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
957 "Create .emacs compatibility file for migrated setup."
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
958 (message "Creating .emacs compatibility file.")
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
959 (with-temp-file (expand-file-name ".emacs" "~")
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
960 (insert ";;; XEmacs backwards compatibility file\n")
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
961 (insert "(setq user-init-file\n")
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
962 (insert " (expand-file-name \"init.el\"\n")
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
963 (insert " (expand-file-name \".xemacs\" \"~\")))\n")
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
964 (insert "(setq custom-file\n")
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
965 (insert " (expand-file-name \"custom.el\"\n")
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
966 (insert " (expand-file-name \".xemacs\" \"~\")))\n")
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
967 (insert "\n")
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
968 (insert "(load-file user-init-file)\n")
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
969 (insert "(load-file custom-file)"))
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
970 (message "Created .emacs compatibility file."))
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
971
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
972 (defun maybe-unmigrate-user-init-file ()
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
973 "Possibly unmigrate the user's init and custom files."
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
974 (interactive)
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
975 (let ((dot-emacs-file-name (expand-file-name ".emacs" "~")))
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
976 (if (and (not load-home-init-file)
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
977 (or (not (file-exists-p dot-emacs-file-name))
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
978 (yes-or-no-p-minibuf (concat "Overwrite " dot-emacs-file-name
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
979 "? "))))
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
980 (unmigrate-user-init-file dot-emacs-file-name))))
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
981
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
982 (defun unmigrate-user-init-file (&optional target-file-name)
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
983 "Unmigrate the user's init and custom files."
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
984 (interactive)
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
985 (let ((target-file-name
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
986 (or target-file-name (expand-file-name ".emacs" "~"))))
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
987 (rename-file user-init-file target-file-name 'ok-if-already-exists)
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
988 (setq user-init-file target-file-name)
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
989 (let ((old-custom-file custom-file))
4347
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
990 (setq custom-file target-file-name)
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
991 (custom-save-all)
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
992 (set-load-home-init-file user-init-file t)
452
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
993 (delete-file old-custom-file))))
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
994
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
995 (defun load-user-init-file ()
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
996 "This function actually reads the init file."
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
997 (if (not user-init-file)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
998 (setq user-init-file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
999 (find-user-init-file user-init-directory)))
470
8a548306e08d [xemacs-hg @ 2001-04-17 15:50:10 by didierv]
didierv
parents: 460
diff changeset
1000 (if (not custom-file)
8a548306e08d [xemacs-hg @ 2001-04-17 15:50:10 by didierv]
didierv
parents: 460
diff changeset
1001 (setq custom-file (make-custom-file-name user-init-file)))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1002 (if (and user-init-file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1003 (file-readable-p user-init-file))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1004 (load user-init-file t t t))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1005 (if (and custom-file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1006 (or (not user-init-file)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1007 (not (string= custom-file user-init-file)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1008 (file-readable-p custom-file))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1009 (load custom-file t t t))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1010 (unless inhibit-default-init
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1011 (let ((inhibit-startup-message nil))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1012 ;; Users are supposed to be told their rights.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1013 ;; (Plus how to get help and how to undo.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1014 ;; Don't you dare turn this off for anyone except yourself.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1015 (load "default" t t))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1016
2030
488b2f76d852 [xemacs-hg @ 2004-04-19 08:54:47 by stephent]
stephent
parents: 1389
diff changeset
1017 ;;; #### move this comment into a docstring. See site-init-file for some
488b2f76d852 [xemacs-hg @ 2004-04-19 08:54:47 by stephent]
stephent
parents: 1389
diff changeset
1018 ;;; description of what it does. Substitute a pointer to this function in
488b2f76d852 [xemacs-hg @ 2004-04-19 08:54:47 by stephent]
stephent
parents: 1389
diff changeset
1019 ;;; site-init-file's docstring.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1020 ;;; Load user's init file and default ones.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1021 (defun load-init-file ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1022 (run-hooks 'before-init-hook)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1023
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1024 ;; Run the site-start library if it exists. The point of this file is
2030
488b2f76d852 [xemacs-hg @ 2004-04-19 08:54:47 by stephent]
stephent
parents: 1389
diff changeset
1025 ;; that it is run before the user's init file. There is no point in
488b2f76d852 [xemacs-hg @ 2004-04-19 08:54:47 by stephent]
stephent
parents: 1389
diff changeset
1026 ;; doing this after the user's init file; that is useless.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1027 (when site-start-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1028 (load site-start-file t t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1029
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1030 ;; Sites should not disable this. Only individuals should disable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1031 ;; the startup message.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1032 (setq inhibit-startup-message nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1033
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1034 (let (debug-on-error-from-init-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1035 debug-on-error-should-be-set
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1036 (debug-on-error-initial
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1037 (if (eq init-file-debug t) 'startup init-file-debug)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1038 (let ((debug-on-error debug-on-error-initial))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1039 (if (and load-user-init-file-p init-file-debug)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1040 (progn
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1041 ;; Do this without a condition-case if the user wants to debug.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1042 (load-user-init-file))
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1043 (condition-case nil
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1044 (call-with-condition-handler
4806
fd36a980d701 Use uninterned symbols in various information-hiding contexts.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4664
diff changeset
1045 ((macro
fd36a980d701 Use uninterned symbols in various information-hiding contexts.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4664
diff changeset
1046 . (lambda (lambda-expression)
fd36a980d701 Use uninterned symbols in various information-hiding contexts.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4664
diff changeset
1047 ;; Be serious about information hiding here:
fd36a980d701 Use uninterned symbols in various information-hiding contexts.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4664
diff changeset
1048 (nsublis
fd36a980d701 Use uninterned symbols in various information-hiding contexts.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4664
diff changeset
1049 '((load-init-handler-arg . #:load-init-gZK6A36gTed))
fd36a980d701 Use uninterned symbols in various information-hiding contexts.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4664
diff changeset
1050 lambda-expression)))
fd36a980d701 Use uninterned symbols in various information-hiding contexts.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4664
diff changeset
1051 #'(lambda (load-init-handler-arg)
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1052 (let ((errstr (error-message-string
4806
fd36a980d701 Use uninterned symbols in various information-hiding contexts.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4664
diff changeset
1053 load-init-handler-arg)))
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1054 (message "Error in init file: %s" errstr)
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1055 (lwarn 'initialization 'error
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1056 "\
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1057 An error has occurred while loading %s:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1058
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1059 %s
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1060
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1061 Backtrace follows:
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1062
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1063 %s
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1064
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1065 To ensure normal operation, you should investigate the cause of the error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1066 in your initialization file and remove it. Use the `-debug-init' option
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1067 to XEmacs to enter the debugger when the error occurs and investigate the
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1068 exact problem."
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1069 user-init-file errstr
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1070 (backtrace-in-condition-handler-eliminating-handler
4806
fd36a980d701 Use uninterned symbols in various information-hiding contexts.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4664
diff changeset
1071 'load-init-handler-arg)))
fd36a980d701 Use uninterned symbols in various information-hiding contexts.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4664
diff changeset
1072 (setq init-file-had-error t)))
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1073 #'(lambda ()
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1074 (if load-user-init-file-p
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1075 (load-user-init-file))
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1076 (setq init-file-had-error nil)))
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 778
diff changeset
1077 (error nil)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1078 ;; If we can tell that the init file altered debug-on-error,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1079 ;; arrange to preserve the value that it set up.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1080 (or (eq debug-on-error debug-on-error-initial)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1081 (setq debug-on-error-should-be-set t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1082 debug-on-error-from-init-file debug-on-error)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1083 (when debug-on-error-should-be-set
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1084 (setq debug-on-error debug-on-error-from-init-file)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1085
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1086 (setq init-file-loaded t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1087
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1088 ;; Do this here in case the init file sets mail-host-address.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1089 ;; Don't do this here unless noninteractive, it is frequently wrong. -sb
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1090 ;; (or user-mail-address
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1091 (when noninteractive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1092 (setq user-mail-address (concat (user-login-name) "@"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1093 (or mail-host-address
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1094 (system-name)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1095
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1096 (run-hooks 'after-init-hook)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1097 nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1098
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1099 (defun load-options-file (filename)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1100 "Load the file of saved options (from the Options menu) called FILENAME.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1101 Currently this does nothing but call `load', but it might be redefined
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1102 in the future to support automatically converting older options files to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1103 a new format, when variables have changed, etc."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1104 (load filename))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1105
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1106 (defun command-line-1 ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1107 (cond
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1108 ((null command-line-args-left)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1109 (unless noninteractive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1110 ;; If there are no switches to process, run the term-setup-hook
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1111 ;; before displaying the copyright notice; there may be some need
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1112 ;; to do it before doing any output. If we're not going to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1113 ;; display a copyright notice (because other options are present)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1114 ;; then this is run after those options are processed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1115 (run-hooks 'term-setup-hook)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1116 ;; Don't let the hook be run twice.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1117 (setq term-setup-hook nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1118
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1119 ;; Don't clobber a non-scratch buffer if init file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1120 ;; has selected it.
4347
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
1121 (when (and (string= (buffer-name) "*scratch*")
6b571dc4ba3f Rework init-file migration.
Mike Sperber <sperber@deinprogramm.de>
parents: 4111
diff changeset
1122 (not (ask-about-user-init-file-migration-p)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1123 (unless (or inhibit-startup-message
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1124 (input-pending-p))
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1125 (let (tmout)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1126 (unwind-protect
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1127 ;; Guts of with-timeout
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1128 (catch 'tmout
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1129 (setq tmout (add-timeout startup-message-timeout
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1130 (lambda (ignore)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1131 (condition-case nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1132 (throw 'tmout t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1133 (error nil)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1134 nil))
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1135 (display-splash-screen)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1136 (or nil;; (pos-visible-in-window-p (point-min))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1137 (goto-char (point-min)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1138 (sit-for 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1139 (setq unread-command-event (next-command-event)))
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1140 (when tmout (disable-timeout tmout)))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1141 (with-current-buffer (get-buffer "*scratch*")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1142 ;; In case the XEmacs server has already selected
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1143 ;; another buffer, erase the one our message is in.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1144 (erase-buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1145 (when (stringp initial-scratch-message)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1146 (insert initial-scratch-message))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1147 (set-buffer-modified-p nil)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1148
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1149 (t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1150 ;; Command-line-options exist
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1151 (let ((dir command-line-default-directory)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1152 (file-count 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1153 (line nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1154 (end-of-options nil)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1155 file-p arg tem)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1156 (while command-line-args-left
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1157 (setq arg (pop command-line-args-left))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1158 (cond
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1159 (end-of-options
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1160 (setq file-p t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1161 ((setq tem (when (eq (aref arg 0) ?-)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1162 (or (assoc arg command-switch-alist)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1163 (assoc (substring arg 1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1164 command-switch-alist))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1165 (funcall (cdr tem) arg))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1166 ((string-match "\\`\\+[0-9]+\\'" arg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1167 (setq line (string-to-int arg)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1168 ;; "- file" means don't treat "file" as a switch
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1169 ;; ("+0 file" has the same effect; "-" added
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1170 ;; for unixoidiality).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1171 ;; This is worthless; the `unixoid' way is "./file". -jwz
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1172 ((or (string= arg "-") (string= arg "--"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1173 (setq end-of-options t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1174 (t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1175 (setq file-p t)))
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1176
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1177 (when file-p
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1178 (setq file-p nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1179 (incf file-count)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1180 (setq arg (expand-file-name arg dir))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1181 (cond
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1182 ((= file-count 1)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1183 (find-file arg))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1184 (noninteractive (find-file arg))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1185 (t (find-file-other-window arg)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1186 (when line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1187 (goto-line line)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1188 (setq line nil))))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1189
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1190
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1191 (defun startup-presentation-hack-help (e)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1192 (setq e (extent-property e 'startup-presentation-hack))
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1193 (symbol-name e))
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1194
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1195 (defun startup-presentation-activate (ev ex)
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1196 (call-interactively (extent-property ex 'startup-presentation-hack)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1197
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1198 (defun splash-screen-present-hack (e v)
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1199 ; (set-extent-property e 'mouse-face 'highlight)
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1200 ; (set-extent-property e 'startup-presentation-hack v)
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1201 ; (set-extent-property e 'help-echo
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1202 ; 'startup-presentation-hack-help)
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1203 ; (set-extent-property e 'activate-function 'startup-presentation-activate)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1204 )
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1205
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1206 (defun splash-hack-version-string ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1207 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1208 (save-restriction
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1209 (goto-char (point-min))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1210 (re-search-forward "^XEmacs" nil t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1211 (narrow-to-region (point-at-bol) (point-at-eol))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1212 (goto-char (point-min))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1213 (when (re-search-forward " \\[Lucid\\]" nil t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1214 (delete-region (match-beginning 0) (match-end 0)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1215 (when (re-search-forward "[^(][^)]*-[^)]*-" nil t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1216 (delete-region (1+ (match-beginning 0)) (match-end 0))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1217 (insert "("))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1218 (goto-char (point-max))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1219 (search-backward " " nil t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1220 (when (search-forward "." nil t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1221 (delete-region (1- (point)) (point-max))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1222
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1223 ;; parse one page description (see `splash-screen-body') and display
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1224 ;; at point.
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1225 (defun splash-screen-present (l)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1226 (cond ((stringp l)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1227 (insert l))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1228 ((eq (car-safe l) 'face)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1229 ;; (face name string)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1230 (let ((p (point)))
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1231 (splash-screen-present (elt l 2))
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1232 (set-extent-face (make-extent p (point))
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1233 (elt l 1))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1234 ((eq (car-safe l) 'key)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1235 (let* ((c (elt l 1))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1236 (p (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1237 (k (where-is-internal c nil t)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1238 (insert (if k (key-description k)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1239 (format "M-x %s" c)))
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1240 (let ((e (make-extent p (point))))
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1241 (set-extent-face e 'bold)
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1242 (splash-screen-present-hack e c))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1243 ((eq (car-safe l) 'funcall)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1244 ;; (funcall (fun . args) string)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1245 (let ((p (point)))
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1246 (splash-screen-present (elt l 2))
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1247 (splash-screen-present-hack (make-extent p (point))
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1248 (elt l 1))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1249 ((consp l)
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1250 (mapcar 'splash-screen-present l))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1251 (t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1252 (error "WTF!?"))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1253
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1254 (defun startup-center-spaces (glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1255 ;; Return the number of spaces to insert in order to center
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1256 ;; the given glyph (may be a string or a pixmap).
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1257 ;; Assume spaces are as wide as avg-pixwidth.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1258 ;; Won't be quite right for proportional fonts, but it's the best we can do.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1259 ;; Maybe the new redisplay will export something a glyph-width function.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1260 ;;; #### Yes, there is a glyph-width function but it isn't quite what
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1261 ;;; #### this was expecting. Or is it?
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1262 ;; (An alternate way to get avg-pixwidth would be to use x-font-properties
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1263 ;; and calculate RESOLUTION_X * AVERAGE_WIDTH / 722.7, but it's no better.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1264
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1265 ;; This function is used in about.el too.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1266 (let* ((avg-pixwidth (round (/ (frame-pixel-width) (frame-width))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1267 (fill-area-width (* avg-pixwidth (- fill-column left-margin)))
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1268 (glyph-pixwidth (cond ((stringp glyph)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1269 (* avg-pixwidth (length glyph)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1270 ((glyphp glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1271 (glyph-width glyph))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1272 (t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1273 (error "startup-center-spaces: bad arg")))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1274 (+ left-margin
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1275 (round (/ (/ (- fill-area-width glyph-pixwidth) 2) avg-pixwidth)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1276
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1277 ;; the splash screen originated in 19.10 as splash-screen-*. When
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1278 ;; Chuck made the global screen->frame change for 19.12, he
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1279 ;; accidentally changed these too. This randomness is getting on my
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1280 ;; nerves, so let's fix it and provide minimal aliases for the
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1281 ;; `locale' mule package. --ben
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1282
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1283 ;; returns either of vector of page descriptions, each describing one
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1284 ;; screenful of information, or just one such page descriptions Each
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1285 ;; page description is a list of textual elements describing how to
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1286 ;; display a section of text. The elements are processed in turn and
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1287 ;; the results inserted one after the previous in a buffer. Each
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1288 ;; textual element is either:
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1289
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1290 ;; -- a string, inserted as-is with no decoration.
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1291 ;; -- a list of (face FACES "text"), where FACES is the name of a face
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1292 ;; or a list of such names, and specifies the face(s) used when
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1293 ;; displaying the text.
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1294 ;; -- a list of (key COMMAND-NAME); the key sequence corresponding to
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1295 ;; the command will be inserted, in boldface.
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1296 ;; -- a list of textual elements.
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1297
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1298 (defun splash-screen-window-body ()
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1299 `(
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1300 (face (blue bold underline)
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1301 "Useful Help-menu entries:\n\n")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1302 ,@(if (string-match "beta" emacs-version)
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1303 `((face bold "Beta Info:")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1304 (face (red bold)
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1305 " This is an Experimental version of XEmacs.\n"))
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1306 `( ""))
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1307 (face bold "XEmacs FAQ:")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1308 " Read the XEmacs FAQ.\n"
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1309 (face bold "Info (Online Docs):")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1310 " Read the on-line documentation.\n"
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1311 (face bold "Tutorial:")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1312 " XEmacs tutorial.\n"
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1313 (face bold "Samples->View Sample init.el:")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1314 " A useful initialization file.\n"
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1315 (face bold "About XEmacs:")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1316 " See who's developing XEmacs.\n"
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1317 "\n"
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1318 (face (bold blue) "XEmacs website:")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1319 " http://www.xemacs.org/\n\n"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1320 ,@(if (featurep 'sparcworks)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1321 `( "\
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1322 Sun provides support for the WorkShop/XEmacs integration package only.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1323 All other XEmacs packages are provided to you \"AS IS\".\n"
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1324 ,@(let ((lang (or (getenv "LC_ALL") (getenv "LC_MESSAGES")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1325 (getenv "LANG"))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1326 (if (and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1327 (not (featurep 'mule)) ;; Already got mule?
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1328 lang ;; Non-English locale?
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1329 (not (string= lang "C"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1330 (not (string-match "^en" lang))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1331 ;; Comes with Sun WorkShop
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1332 (locate-file "xemacs-mule" exec-path))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1333 '( "\
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1334 This version of XEmacs has been built with support for Latin-1 languages only.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1335 To handle other languages you need to run a Multi-lingual (`Mule') version of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1336 XEmacs, by either running the command `xemacs-mule', or by using the X resource
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1337 `ESERVE*defaultXEmacsPath: xemacs-mule' when starting XEmacs from Sun WorkShop.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1338 \n")))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1339 (face italic "\
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1340 Copyright (C) 1985-1999 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1341 Copyright (C) 1990-1994 Lucid, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1342 Copyright (C) 1993-1997 Sun Microsystems, Inc. All Rights Reserved.
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1343 Copyright (C) 1994-1996 Board of Trustees, University of Illinois.
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1344 Copyright (C) 1995-2005 Ben Wing.\n")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1345 ))
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1346
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1347 (defun splash-screen-tty-body ()
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1348 `(
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1349 (face italic "[`C-' means the control key, `M-' means the meta key]\n\n")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1350 ,@(if (string-match "beta" emacs-version)
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1351 `((key describe-beta)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1352 ": " (face (red bold)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1353 "This is an Experimental version of XEmacs.\n"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1354 `( "\n"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1355 ((key xemacs-local-faq)
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1356 ": Read the XEmacs FAQ. (A " (face underline "capital") " F!)\n")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1357 ((key info) ": Read the on-line documentation.\n")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1358 ((key help-command)
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1359 ": Get help on using XEmacs.\n")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1360 ((key help-with-tutorial)
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1361 ": Read the XEmacs tutorial.\n")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1362 ((key view-sample-init-el)
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1363 ": View the sample init.el file.\n")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1364 ((key about-xemacs) ": See who's developing XEmacs.\n")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1365 ((key save-buffers-kill-emacs)
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1366 ": exit XEmacs\n")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1367 "\n"
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1368 (face (bold blue) "XEmacs website: ")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1369 "http://www.xemacs.org/\n\n"
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1370 (face italic "\
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1371 Copyright (C) 1985-1999 Free Software Foundation, Inc.
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1372 Copyright (C) 1990-1994 Lucid, Inc.
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1373 Copyright (C) 1993-1997 Sun Microsystems, Inc. All Rights Reserved.
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1374 Copyright (C) 1994-1996 Board of Trustees, University of Illinois.
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1375 Copyright (C) 1995-2004 Ben Wing.")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1376 ; ((key find-file) ": visit a file; ")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1377 ; ((key save-buffer) ": save changes; ")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1378 ; ((key undo) ": undo changes; ")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1379 ))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1380
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1381 ;; I really hate global variables, oh well.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1382 ;(defvar xemacs-startup-logo-function nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1383 ; "If non-nil, function called to provide the startup logo.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1384 ;This function should return an initialized glyph if it is used.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1385
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1386 ;; This will hopefully go away when gettext is functional.
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1387 (defconst splash-screen-static-body
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1388 `(,(emacs-version) "\n\n"))
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1389 ;; temporary support for old locale files.
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1390 (define-obsolete-variable-alias 'splash-frame-static-body
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1391 'splash-screen-static-body)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1392
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1393 (defun display-splash-screen ()
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1394 ;; display the splash screen in the current buffer and put it in the
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1395 ;; current window.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1396 (let ((logo xemacs-logo)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1397 (buffer-read-only nil)
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1398 (tty (eq 'tty (console-type))))
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1399 (unless tty
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1400 (insert "\n")
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1401 (indent-to (startup-center-spaces logo))
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1402 (set-extent-begin-glyph (make-extent (point) (point)) logo)
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1403 ;;(splash-screen-present-hack (make-extent p (point)) 'about-xemacs))
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1404 (insert "\n\n"))
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1405 (splash-screen-present splash-screen-static-body)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1406 (splash-hack-version-string)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1407 (goto-char (point-max))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1408 (let* ((after-change-functions nil) ; no font-lock, thank you
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1409 (elements (cond (tty (splash-screen-tty-body))
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1410 (t (splash-screen-window-body)))))
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1411 (splash-screen-present elements)
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1412 (set-buffer-modified-p nil))))
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1413
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1414 (defun xemacs-splash-buffer ()
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1415 "Display XEmacs splash screen in a buffer."
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1416 (interactive)
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1417 (let ((buffer (get-buffer-create "*Splash*")))
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1418 (set-buffer buffer)
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1419 (setq buffer-read-only nil)
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1420 (erase-buffer buffer)
3643
86be8d3dd45d [xemacs-hg @ 2006-10-30 11:17:43 by malcolmp]
malcolmp
parents: 3360
diff changeset
1421 (pop-to-buffer buffer)
86be8d3dd45d [xemacs-hg @ 2006-10-30 11:17:43 by malcolmp]
malcolmp
parents: 3360
diff changeset
1422 (delete-other-windows)
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1423 (display-splash-screen)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1424
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1425 ;; (let ((present-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1426 ;; #'(lambda (f)
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1427 ;; (splash-screen-present
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1428 ;; (list 'funcall
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1429 ;; (list 'find-file-other-window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1430 ;; (expand-file-name f data-directory))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1431 ;; f)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1432 ;; (insert "For customization examples, see the files ")
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1433 ;; (funcall present-file "sample.init.el")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1434 ;; (insert " and ")
1389
6355bae896e3 [xemacs-hg @ 2003-03-27 12:57:36 by stephent]
stephent
parents: 1330
diff changeset
1435 ;; (funcall present-file "sample.Xresources")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1436 ;; (insert (format "\nin the directory %s." data-directory)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1437
2505
3e5a2d0d57e1 [xemacs-hg @ 2005-01-26 04:56:17 by ben]
ben
parents: 2456
diff changeset
1438
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1439 (defun startup-set-invocation-environment ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1440 ;; XEmacs -- Steven Baur says invocation directory is nil if you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1441 ;; try to use XEmacs as a login shell.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1442 (or invocation-directory (setq invocation-directory default-directory))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1443 (setq invocation-directory
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1444 ;; don't let /tmp_mnt/... get into the load-path or exec-path.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1445 (abbreviate-file-name invocation-directory)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1446
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1447 ;;; High-level functions to set up the paths.
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1448
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1449 (defun startup-find-load-path (&optional inhibit-packages
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1450 set-global-package-paths)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1451 "Determine the value for `load-path'.
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1452 INHIBIT-PACKAGES says which types of packages, if any, to omit from the
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1453 returned value. It can be `t' (omit all), one of the symbols `early',
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1454 `late', or `last', or a list of one or more of the symbols.
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1455
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1456 If SET-GLOBAL-PACKAGE-PATHS is non-nil, initialize the global package path
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1457 variables referring to the particular types of packages
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4448
diff changeset
1458 \(`early-package-hierarchies', `early-package-load-path',
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1459 `late-package-hierarchies', `late-package-load-path',
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1460 `last-package-hierarchies', `last-package-load-path')."
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1461 (let (earlyp latep lastp earlyp-lp latep-lp lastp-lp)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1462 (apply #'(lambda (early late last)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1463 (setq earlyp (and (not (memq 'early inhibit-packages)) early))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1464 (setq latep (and (not (memq 'late inhibit-packages)) late))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1465 (setq lastp (and (not (memq 'last inhibit-packages)) last)))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1466 (packages-find-all-package-hierarchies
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1467 emacs-data-roots))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1468
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1469 (setq earlyp-lp (packages-find-package-load-path earlyp))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1470 (setq latep-lp (packages-find-package-load-path latep))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1471 (setq lastp-lp (packages-find-package-load-path lastp))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1472
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1473 (when set-global-package-paths
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1474 (setq early-package-hierarchies earlyp
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1475 late-package-hierarchies latep
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1476 last-package-hierarchies lastp
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1477 early-package-load-path earlyp-lp
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1478 late-package-load-path latep-lp
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1479 last-package-load-path lastp-lp))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1480
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1481 (paths-construct-load-path emacs-roots earlyp-lp latep-lp lastp-lp
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1482 lisp-directory site-directory
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1483 mule-lisp-directory)))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1484
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1485 (defun startup-setup-paths (&optional inhibit-packages called-early)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1486 "Setup all the various paths.
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1487 INHIBIT-PACKAGES says which types of packages, if any, to omit from the
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1488 returned value. It can be `t' (omit all), one of the symbols `early',
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1489 `late', or `last', or a list of one or more of the symbols.
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1490
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1491 This function is idempotent, so call this as often as you like!"
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1492
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1493 (setq debug-paths (or debug-paths
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1494 (and (getenv "EMACSDEBUGPATHS")
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1495 t)))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1496
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1497 (setq emacs-roots (paths-find-emacs-roots invocation-directory invocation-name
4093
86f900725eda [xemacs-hg @ 2007-08-02 06:37:48 by michaels]
michaels
parents: 3985
diff changeset
1498 #'paths-emacs-root-p))
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1499
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1500 (setq emacs-data-roots (paths-find-emacs-roots invocation-directory invocation-name
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1501 #'paths-emacs-data-root-p))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1502
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1503 (if (null emacs-roots)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1504 (save-excursion
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1505 (set-buffer (get-buffer-create " *warning-tmp*"))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1506 (erase-buffer)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1507 (buffer-disable-undo (current-buffer))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1508
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1509 (insert "Couldn't find an obvious default for the root of the\n"
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1510 "XEmacs hierarchy.")
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1511
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1512 (princ "\nWARNING:\n" 'external-debugging-output)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1513 (princ (buffer-string) 'external-debugging-output)))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1514
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1515 (if (eq inhibit-packages t)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1516 (setq inhibit-packages '(early late last)))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1517 (if (not (listp inhibit-packages))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1518 (setq inhibit-packages (list inhibit-packages)))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1519
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1520 (when debug-paths
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1521 (princ (format
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1522 "startup-setup-paths arguments:
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1523 inhibit-packages: %S
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1524 inhibit-site-lisp: %S
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1525 called-early: %S
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1526 " inhibit-packages inhibit-site-lisp called-early)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1527 'external-debugging-output)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1528 (princ (format
4662
a597b89c2db9 Print a few more variables upon --debug-paths.
Mike Sperber <sperber@deinprogramm.de>
parents: 4477
diff changeset
1529 "invocation-directory: %S
a597b89c2db9 Print a few more variables upon --debug-paths.
Mike Sperber <sperber@deinprogramm.de>
parents: 4477
diff changeset
1530 invocation-name: %S
a597b89c2db9 Print a few more variables upon --debug-paths.
Mike Sperber <sperber@deinprogramm.de>
parents: 4477
diff changeset
1531 configure-prefix-directory: %S
a597b89c2db9 Print a few more variables upon --debug-paths.
Mike Sperber <sperber@deinprogramm.de>
parents: 4477
diff changeset
1532 configure-exec-prefix-directory: %S
a597b89c2db9 Print a few more variables upon --debug-paths.
Mike Sperber <sperber@deinprogramm.de>
parents: 4477
diff changeset
1533 emacs-roots:
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1534 %S
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1535 emacs-data-roots:
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1536 %S
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1537 user-init-directory: %S
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1538 configure-package-path: %S
4662
a597b89c2db9 Print a few more variables upon --debug-paths.
Mike Sperber <sperber@deinprogramm.de>
parents: 4477
diff changeset
1539 " invocation-directory invocation-name
a597b89c2db9 Print a few more variables upon --debug-paths.
Mike Sperber <sperber@deinprogramm.de>
parents: 4477
diff changeset
1540 configure-prefix-directory configure-exec-prefix-directory
a597b89c2db9 Print a few more variables upon --debug-paths.
Mike Sperber <sperber@deinprogramm.de>
parents: 4477
diff changeset
1541 emacs-roots emacs-data-roots user-init-directory configure-package-path)
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1542 'external-debugging-output)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1543 )
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1544
4664
d71d2cefa42d Use `emacs-data-roots' instead of `emacs-roots' where appropriate.
Mike Sperber <sperber@deinprogramm.de>
parents: 4662
diff changeset
1545 (setq lisp-directory (paths-find-lisp-directory emacs-data-roots))
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1546
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1547 (if debug-paths
3985
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1548 (princ (format "configure-lisp-directory and lisp-directory:\n%S\n%S\n"
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1549 configure-lisp-directory lisp-directory)
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1550 'external-debugging-output))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1551
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1552 (if (featurep 'mule)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1553 (progn
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1554 (setq mule-lisp-directory
4664
d71d2cefa42d Use `emacs-data-roots' instead of `emacs-roots' where appropriate.
Mike Sperber <sperber@deinprogramm.de>
parents: 4662
diff changeset
1555 (paths-find-mule-lisp-directory emacs-data-roots
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1556 lisp-directory))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1557 (if debug-paths
3985
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1558 (princ (format "configure-mule-lisp-directory and mule-lisp-directory:\n%S\n%S\n"
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1559 configure-mule-lisp-directory mule-lisp-directory)
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1560 'external-debugging-output)))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1561 (setq mule-lisp-directory '()))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1562
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1563 (setq site-directory (and (null inhibit-site-lisp)
4664
d71d2cefa42d Use `emacs-data-roots' instead of `emacs-roots' where appropriate.
Mike Sperber <sperber@deinprogramm.de>
parents: 4662
diff changeset
1564 (paths-find-site-lisp-directory emacs-data-roots)))
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1565
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1566 (if (and debug-paths (null inhibit-site-lisp))
3985
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1567 (princ (format "configure-site-directory and site-directory:\n%S\n%S\n"
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1568 configure-site-directory site-directory)
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1569 'external-debugging-output))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1570
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1571 (setq load-path (startup-find-load-path inhibit-packages t))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1572
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1573 (when debug-paths
3985
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1574 (princ (format "configure-early-package-directories, early-package-hierarchies and early-package-load-path:\n%S\n%S\n%S\n"
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1575 configure-early-package-directories early-package-hierarchies early-package-load-path)
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1576 'external-debugging-output)
3985
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1577 (princ (format "configure-late-package-directories, late-package-hierarchies and late-package-load-path:\n%S\n%S\n"
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1578 configure-late-package-directories late-package-hierarchies late-package-load-path)
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1579 'external-debugging-output)
3985
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1580 (princ (format "configure-last-package-directories, last-package-hierarchies and last-package-load-path:\n%S\n%S\n"
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1581 configure-last-package-directories last-package-hierarchies last-package-load-path)
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1582 'external-debugging-output))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1583
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1584 (if debug-paths
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1585 (princ (format "load-path:\n%S\n" load-path)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1586 'external-debugging-output))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1587 (setq module-directory (paths-find-module-directory emacs-roots))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1588 (if debug-paths
3985
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1589 (princ (format "configure-module-directory and module-directory:\n%S\n"
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1590 configure-module-directory module-directory)
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1591 'external-debugging-output))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1592 (setq site-module-directory (and (null inhibit-site-modules)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1593 (paths-find-site-module-directory
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1594 emacs-roots)))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1595 (if (and debug-paths (null inhibit-site-modules))
3985
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1596 (princ (format "configure-site-module-directory and site-module-directory:\n%S\n%S\n"
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1597 configure-site-module-directory site-module-directory)
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1598 'external-debugging-output))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1599
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1600 (setq module-load-path (paths-construct-module-load-path
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1601 emacs-roots
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1602 module-directory
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1603 site-module-directory))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1604
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1605 (unless called-early
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1606 (setq Info-directory-list
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1607 (paths-construct-info-path
4664
d71d2cefa42d Use `emacs-data-roots' instead of `emacs-roots' where appropriate.
Mike Sperber <sperber@deinprogramm.de>
parents: 4662
diff changeset
1608 emacs-data-roots
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1609 early-package-hierarchies late-package-hierarchies last-package-hierarchies))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1610
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1611 (if debug-paths
3985
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1612 (princ (format "configure-info-directory, configure-info-path and Info-directory-list:\n%S\n%S\n%S\n"
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1613 configure-info-directory configure-info-path Info-directory-list)
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1614 'external-debugging-output))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1615
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1616 (setq exec-directory (paths-find-exec-directory emacs-roots))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1617
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1618 (if debug-paths
3985
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1619 (princ (format "configure-exec-directory and exec-directory:\n%S\n%S\n"
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1620 configure-exec-directory exec-directory)
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1621 'external-debugging-output))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1622
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1623 (setq exec-path
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1624 (paths-construct-exec-path emacs-roots exec-directory
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1625 early-package-hierarchies late-package-hierarchies
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1626 last-package-hierarchies))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1627
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1628 (if debug-paths
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1629 (princ (format "exec-path:\n%S\n" exec-path)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1630 'external-debugging-output))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1631
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1632 (setq doc-directory (paths-find-doc-directory emacs-roots))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1633
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1634 (if debug-paths
3985
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1635 (princ (format "configure-doc-directory and doc-directory:\n%S\n%S\n"
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1636 configure-doc-directory doc-directory)
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1637 'external-debugging-output))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1638
4664
d71d2cefa42d Use `emacs-data-roots' instead of `emacs-roots' where appropriate.
Mike Sperber <sperber@deinprogramm.de>
parents: 4662
diff changeset
1639 (setq data-directory (paths-find-data-directory emacs-data-roots))
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1640
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1641 (if debug-paths
3985
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1642 (princ (format "configure-data-directory and data-directory:\n%S\n%S\n"
92013722573f [xemacs-hg @ 2007-05-25 15:47:55 by michaels]
michaels
parents: 3643
diff changeset
1643 configure-data-directory data-directory)
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1644 'external-debugging-output))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1645
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1646 (setq data-directory-list (paths-construct-data-directory-list
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1647 data-directory early-package-hierarchies
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1648 late-package-hierarchies last-package-hierarchies))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1649 (if debug-paths
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1650 (princ (format "data-directory-list:\n%S\n" data-directory-list)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1651 'external-debugging-output))))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1652
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1653 (defun startup-find-load-path-for-packages (packages)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1654 "Return a suitable load-path for PACKAGES.
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1655 PACKAGES is a list of package names (strings). This looks for package
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1656 directories in the load path whose last component is one of the members of
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1657 PACKAGES."
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1658 (mapcan
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1659 #'(lambda (package)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1660 (and (member (file-name-nondirectory (directory-file-name package))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1661 packages)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1662 (list package)))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1663 (startup-find-load-path)))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1664
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1665 ; (defun startup-set-basic-packages-load-path ()
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1666 ; "#### This is a hack. When recompiling .el files, we use -no-packages
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1667 ; to avoid problems with packages shadowing standard Lisp files
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1668 ; (e.g. unicode.el), but we really still need the stuff in xemacs-base and
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1669 ; xemacs-devel."
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1670 ; (setq load-path (startup-find-load-path-for-packages
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1671 ; '("xemacs-base" "xemacs-devel"))))
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1672
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1673 (defun startup-setup-paths-warning ()
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1674 (let ((warnings '()))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1675 (cond
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1676 ((null (and lisp-directory exec-directory data-directory doc-directory
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1677 load-path))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1678 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1679 (set-buffer (get-buffer-create " *warning-tmp*"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1680 (erase-buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1681 (buffer-disable-undo (current-buffer))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1682 (if (null lisp-directory) (push "lisp-directory" warnings))
460
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 458
diff changeset
1683 (if (and (featurep 'mule)
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 458
diff changeset
1684 (null mule-lisp-directory))
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 458
diff changeset
1685 (push "mule-lisp-directory" warnings))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1686 (if (null exec-directory) (push "exec-directory" warnings))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1687 (if (null data-directory) (push "data-directory" warnings))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1688 (if (null doc-directory) (push "doc-directory" warnings))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1689 (if (null load-path) (push "load-path" warnings))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1690
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1691 (insert "Couldn't find obvious defaults for:\n")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1692 (while warnings
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1693 (insert (car warnings) "\n")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1694 (setq warnings (cdr warnings)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1695 (insert "Perhaps some directories don't exist, "
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1696 "or the XEmacs executable,\n" (concat invocation-directory
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1697 invocation-name)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1698 "\nis in a strange place?")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1699
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1700 (princ "\nWARNING:\n" 'external-debugging-output)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1701 (princ (buffer-string) 'external-debugging-output)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1702 (erase-buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1703 t)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1704
2456
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1705
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1706 ;;; Now actually set the paths up, for bootstrapping purposes. This is run
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1707 ;;; at early dump time and in certain cases where we use a minimal temacs
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1708 ;;; to do useful things, like rebuild DOC.
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1709
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1710 (startup-setup-paths (if inhibit-all-packages t '(early last)) t)
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1711
f4e405a9d18d [xemacs-hg @ 2004-12-27 12:25:14 by michaels]
michaels
parents: 2305
diff changeset
1712
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 502
diff changeset
1713 (defun startup-load-autoloads ()
1232
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
1714 (when (and (not inhibit-autoloads) lisp-directory)
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
1715 (load (expand-file-name (file-name-sans-extension autoload-file-name)
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
1716 lisp-directory)
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
1717 nil t)
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
1718 (when (featurep 'mule)
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 502
diff changeset
1719 (load (expand-file-name (file-name-sans-extension autoload-file-name)
1232
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
1720 (file-name-as-directory
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
1721 (expand-file-name "mule" lisp-directory)))
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
1722 nil t)))
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 502
diff changeset
1723
996
25e260cb7994 [xemacs-hg @ 2002-09-10 15:27:02 by james]
james
parents: 969
diff changeset
1724 ;; Hey! Let's use a packages-* function for a non-package purpose!
1232
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
1725 (when (and (not inhibit-autoloads) (featurep 'modules))
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
1726 (packages-load-package-auto-autoloads module-load-path))
996
25e260cb7994 [xemacs-hg @ 2002-09-10 15:27:02 by james]
james
parents: 969
diff changeset
1727
1232
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
1728 (unless (or inhibit-autoloads inhibit-all-packages)
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
1729 (unless inhibit-early-packages
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
1730 (packages-load-package-auto-autoloads early-package-load-path))
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
1731 (packages-load-package-auto-autoloads late-package-load-path)
c08a6fa181d1 [xemacs-hg @ 2003-01-23 11:38:56 by stephent]
stephent
parents: 1227
diff changeset
1732 (packages-load-package-auto-autoloads last-package-load-path)))
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 502
diff changeset
1733
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1734 ;;; startup.el ends here