comparison etc/sample.init.el @ 863:42375619fa45

[xemacs-hg @ 2002-06-04 06:03:59 by andyp] merge 21.4 windows changes, minimally tested
author andyp
date Tue, 04 Jun 2002 06:05:53 +0000
parents 943eaba38521
children b10161763edf
comparison
equal deleted inserted replaced
862:278c743f1578 863:42375619fa45
22 ;; along with XEmacs; see the file COPYING. If not, write to the 22 ;; along with XEmacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA. 24 ;; Boston, MA 02111-1307, USA.
25 25
26 ;; #### to do: 26 ;; #### to do:
27 ;; -- #### figure out how init.el and custom.el interact and put 27 ;; -- scan for #### markers and fix the problems noted there.
28 ;; documentation about it here. (perhaps it already exists 28 ;; -- #### maybe the setqs in this file should be changed to defvars
29 ;; elsewhere?) 29 ;; to avoid tromping on customizations when custom.el is loaded
30 30 ;; early (dv and sjt at least favor making this the default)
31 ;;; This is a sample init.el file. It can be used without 31 ;; -- #### update documentation in (lispref)Starting Up XEmacs, in
32 ;;; modification as your init.el or .emacs. In older versions of 32 ;; (xemacs)Entering Emacs, and in (custom), then point to them
33 ;;; XEmacs, this file was called .emacs and placed in your home 33 ;; instead of going into detail here.
34 ;;; directory. (Under MS Windows, that directory is controlled by the 34
35 ;;; HOME environment variable and defaults to C:\. You can find out 35 ;;; This is a sample init file. It can be used without modification
36 ;;; where XEmacs thinks your home directory is using 36 ;;; as your init.el or .emacs. In older versions of XEmacs, this file
37 ;;; was called .emacs and placed in your home directory. (Under MS
38 ;;; Windows, that directory is controlled by the HOME environment
39 ;;; variable and defaults to C:\. You can find out where XEmacs
40 ;;; thinks your home directory is using
37 ;;; 41 ;;;
38 ;;; ESC : (expand-file-name "~") 42 ;;; ESC : (expand-file-name "~")
39 ;;; 43 ;;;
40 ;;; . This means type ESC, then colon, then the following text, then hit 44 ;;; . This means type ESC, then colon, then the following text, then hit
41 ;;; return.) In more recent versions of XEmacs, this file has migrated to 45 ;;; return.) In more recent versions of XEmacs, this file has migrated to
50 ;;; M-x load-file RET ~/.xemacs/init.el RET 54 ;;; M-x load-file RET ~/.xemacs/init.el RET
51 55
52 ;;; The language that this file (and most other XEmacs init files) is 56 ;;; The language that this file (and most other XEmacs init files) is
53 ;;; written in is called "XEmacs Lisp" or more commonly "Elisp". 57 ;;; written in is called "XEmacs Lisp" or more commonly "Elisp".
54 58
55 ;;; There are many sources of further information: 59 ;;; Brief descriptions of how the init process works and how to
60 ;;; accomplish many useful customizations are given below in this
61 ;;; file. There are many sources of further information:
56 62
57 ;;; -- the XEmacs User's Manual (Access using the online Info browser: 63 ;;; -- the XEmacs User's Manual (Access using the online Info browser:
58 ;;; Use `Help->Info (Online Docs)->XEmacs User's Manual' (if 64 ;;; Use `Help->Info (Online Docs)->XEmacs User's Manual' (if
59 ;;; there is such an entry); or get to the Info contents page 65 ;;; there is such an entry); or get to the Info contents page
60 ;;; using `Help->Info Contents' or `C-h i', and then 66 ;;; using `Help->Info Contents' or `C-h i', and then
116 122
117 ;;; -- the XEmacs internals manual, for those interested in working on 123 ;;; -- the XEmacs internals manual, for those interested in working on
118 ;;; the XEmacs C code. (Available through Info.) 124 ;;; the XEmacs C code. (Available through Info.)
119 125
120 ;;; -- `Help->About XEmacs' to find out who the maintainers are. 126 ;;; -- `Help->About XEmacs' to find out who the maintainers are.
127
128
129 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
130 ;; Theory of Operation ;;
131 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
132
133 ;;; XEmacs allows you to make persistent changes to editor behavior by
134 ;;; saving code in files which are by default loaded at startup.
135
136 ;; These files are just Lisp libraries with names built in to XEmacs.
137 ;; There are files for the use of the user (the init file and the
138 ;; custom file), for the site administrator (default.el and
139 ;; site-start.el), and for the XEmacs maintainers (auto-autoloads
140 ;; files). See the Lispref for user and site files (node Starting Up
141 ;; XEmacs, currently inaccurate (it doesn't describe the custom
142 ;; file)). Interactions among the files are complex; see
143 ;; lisp/startup.el for details.
144
145 ;; Briefly, after very basic initializations including processing a
146 ;; special command line options (including GUI toolkit options),
147 ;; setting up the terminal, and setting up `load-path', it executes
148 ;; customization code as follows:
149
150 ;; 1. It runs the normal hook `before-init-hook'.
151 ;; 2. It loads the library `site-start' (by default `site-start.el').
152 ;; 3. It loads the init file (by default `~/.xemacs/init.el').
153 ;; 4. It loads the custom file (by default `~/.xemacs/custom.el').
154 ;; 5. It loads the library `default' (by default `default.el').
155 ;; 6. It runs the normal hook `after-init-hook'.
156
157 ;; After this the *scratch* buffer is set up and the remaining command
158 ;; line arguments (actions and file names) are processed.
159
160 ;; N.B. Switching the order of steps 3 and 4 is under discussion and
161 ;; favored by several core developers.
162
163 ;; Step 2 is inhibited by the -no-site-file command line switch.
164 ;; Steps 3 and 4 are inhibited (as a unit) by the -no-init-file
165 ;; command line switch (-q is a convenient synonym). Step 5 is
166 ;; inhibited by -no-init-file or a non-nil value of
167 ;; `inhibit-default-init' (set it in the init file). From now on the
168 ;; hooks and the site initialization files will be ignored.
169
170 ;; The custom file and the init file contain customizations managed by
171 ;; XEmacs itself via the Custom subsystem and manual customizations,
172 ;; respectively. Originally both were placed in the same file,
173 ;; usually ~/.emacs, but occasionally XEmacs would trash user settings
174 ;; when automatically changing options, and more frequently users
175 ;; would trash the automatically generated code. So these functions
176 ;; have been reallocated to separate files, usually named custom.el
177 ;; and init.el, respectively.
178
179 ;; The Custom system is accessed most conveniently from the
180 ;; Options->Advanced (Customize) menu (also, the Options->Fonts and
181 ;; Options->Sizes menus are implicitly managed by Custom, and
182 ;; Options->Edit Faces explicitly invokes Custom). You can also use
183 ;; the suite of customize commands directly (cf C-h a customize RET).
184 ;; Currently, Custom possesses specialized facilities for setting
185 ;; ordinary variables of many types, and for customizing faces. As a
186 ;; general rule, variable and face initialization should be done using
187 ;; Custom, and other initializations should be done in the init file.
188
189 ;; A possible exception is a subsystem with its own complex init file,
190 ;; eg, Gnus and .gnus. In these cases it is often preferable to keep
191 ;; even simple variable initializations together, and you may wish to
192 ;; maintain these configurations by hand.
193
194 ;; You should avoid editing the custom file by hand. The syntax used
195 ;; is complex but concise, and it is easy to silently break the whole
196 ;; file with a single error that happens to result in a valid Lisp
197 ;; form. On the other hand, the init file is just a Lisp library that
198 ;; is loaded before starting the read-eval-redisplay loop.
199
200 ;; The interactions between the custom file and other init files are
201 ;; governed by a simple idea:
202
203 ;; Custom to User: ALL VARIABLES YOURS OURS NOW ARE.
204
205 ;; To be precise, Custom is pretty good about noticing and respecting
206 ;; existing settings in interactive use. However, it is weak in
207 ;; understanding advanced use of specifier variables (these are used
208 ;; for customizations which depend on display characteristics and
209 ;; configuration in complex ways), and can be quite brutal at
210 ;; initialization.
211
212 ;; Normal practice for Custom at initialization is to (1) reset all
213 ;; customized faces before applying customizations and (2) force all
214 ;; variables to the values specified in custom.el. For this reason,
215 ;; and because it is generally the case that the init file can
216 ;; usefully depend on customized variables, but Custom pays no
217 ;; attention to behavior of the init file, it is probably a good idea
218 ;; to force custom.el to be loaded before the init file. (As
219 ;; mentioned, this will probably become the default in future versions
220 ;; of XEmacs.)
221
222 ;; To enable early loading of custom.el, uncomment the following line:
223 ;(setq Init-inhibit-custom-file-p (not (assoc custom-file load-history)))
224
225 ;; Code to implement early loading where late loading is the default.
226 ;; A crucial snippet of code must be the last thing in this file.
227
228 ;; defvars only initialize uninitialized variables; if the setq above
229 ;; is active, the variable below is defined but the value will not be
230 ;; altered.
231 (defvar Init-inhibit-custom-file-p nil
232 "Internal user init flag. Don't use this yourself.
233
234 Non-nil if we need to inhibit XEmacs from loading custom.el after init.el.")
235
236 (when Init-inhibit-custom-file-p
237 ;; This is the default custom-file.
238 (let ((file (expand-file-name "~/.xemacs/custom.el")))
239 (add-one-shot-hook 'after-init-hook
240 `(lambda () (setq custom-file ,file)))
241 (cond ((file-readable-p file)
242 (load file))
243 ((file-exists-p file)
244 (warn "Existing custom file \"%s\" is not readable!" file)))
245 (cond ((not (file-exists-p file))
246 (display-warning ' resource
247 (format "Custom file \"%s\" not found." file)
248 'info))
249 ((not (file-writable-p file))
250 (warn "Existing custom file \"%s\" is not writable!" file)))))
121 251
122 252
123 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 253 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
124 ;; Basic Customization ;; 254 ;; Basic Customization ;;
125 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 255 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1270 ;(setq mh-lib "/usr/dist/pkgs/mh/lib.svr4/") 1400 ;(setq mh-lib "/usr/dist/pkgs/mh/lib.svr4/")
1271 1401
1272 1402
1273 ;;; ******************** 1403 ;;; ********************
1274 ;;; resize-minibuffer-mode makes the minibuffer automatically 1404 ;;; resize-minibuffer-mode makes the minibuffer automatically
1275 ;;; resize as necessary when it's too big to hold its contents. 1405 ;;; resize as necessary when it's too small to hold its contents.
1276 1406
1277 (when (fboundp 'resize-minibuffer-mode) 1407 (when (fboundp 'resize-minibuffer-mode)
1278 (resize-minibuffer-mode) 1408 (resize-minibuffer-mode)
1279 (setq resize-minibuffer-window-exactly nil)) 1409 (setq resize-minibuffer-window-exactly nil))
1280 1410
1300 ; ;; 1430 ; ;;
1301 ; ;; If your Telnet program adds lines of junk at the beginning 1431 ; ;; If your Telnet program adds lines of junk at the beginning
1302 ; ;; of the session, specify the number of lines here. 1432 ; ;; of the session, specify the number of lines here.
1303 ; w3-telnet-header-length 4 1433 ; w3-telnet-header-length 4
1304 ; ) 1434 ; )
1435
1436 ;;; Inhibit loading of custom-file
1437
1438 ;; make-temp-name returns a name which does not refer to an existing file,
1439 ;; and thus the named file is unreadable.
1440 (when Init-inhibit-custom-file-p
1441 (setq custom-file (make-temp-name "/tmp/non-existent-")))
1442