2
|
1 ;; -*- Mode: Emacs-Lisp -*-
|
0
|
2
|
|
3 ;;; This is a sample .emacs file.
|
|
4 ;;;
|
|
5 ;;; The .emacs file, which should reside in your home directory, allows you to
|
|
6 ;;; customize the behavior of Emacs. In general, changes to your .emacs file
|
|
7 ;;; will not take effect until the next time you start up Emacs. You can load
|
|
8 ;;; it explicitly with `M-x load-file RET ~/.emacs RET'.
|
|
9 ;;;
|
|
10 ;;; There is a great deal of documentation on customization in the Emacs
|
|
11 ;;; manual. You can read this manual with the online Info browser: type
|
|
12 ;;; `C-h i' or select "Emacs Info" from the "Help" menu.
|
|
13
|
|
14
|
|
15 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
16 ;; Basic Customization ;;
|
|
17 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
18
|
|
19 ;; Enable the commands `narrow-to-region' ("C-x n n") and
|
2
|
20 ;; `eval-expression' ("M-:", or "ESC :"). Both are useful
|
0
|
21 ;; commands, but they can be confusing for a new user, so they're
|
|
22 ;; disabled by default.
|
|
23 (put 'narrow-to-region 'disabled nil)
|
2
|
24 (put 'eval-expression 'disabled nil)
|
0
|
25
|
|
26 ;;; Define a variable to indicate whether we're running XEmacs/Lucid Emacs.
|
|
27 ;;; (You do not have to defvar a global variable before using it --
|
|
28 ;;; you can just call `setq' directly like we do for `emacs-major-version'
|
|
29 ;;; below. It's clearer this way, though.)
|
|
30
|
|
31 (defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))
|
|
32
|
|
33 ;; Make the sequence "C-x w" execute the `what-line' command,
|
|
34 ;; which prints the current line number in the echo area.
|
|
35 (global-set-key "\C-xw" 'what-line)
|
|
36
|
|
37 ;; set up the function keys to do common tasks to reduce Emacs pinky
|
|
38 ;; and such.
|
|
39
|
|
40 ;; Make F1 invoke help
|
70
|
41 (global-set-key 'f1 'help-command)
|
0
|
42 ;; Make F2 be `undo'
|
70
|
43 (global-set-key 'f2 'undo)
|
0
|
44 ;; Make F3 be `find-file'
|
|
45 ;; Note: it does not currently work to say
|
|
46 ;; (global-set-key 'f3 "\C-x\C-f")
|
|
47 ;; The reason is that macros can't do interactive things properly.
|
|
48 ;; This is an extremely longstanding bug in Emacs. Eventually,
|
|
49 ;; it will be fixed. (Hopefully ..)
|
70
|
50 (global-set-key 'f3 'find-file)
|
0
|
51
|
|
52 ;; Make F4 be "mark", F5 be "copy", F6 be "paste"
|
|
53 ;; Note that you can set a key sequence either to a command or to another
|
|
54 ;; key sequence.
|
70
|
55 (global-set-key 'f4 'set-mark-command)
|
|
56 (global-set-key 'f5 "\M-w")
|
|
57 (global-set-key 'f6 "\C-y")
|
0
|
58
|
|
59 ;; Shift-F4 is "pop mark off of stack"
|
|
60 (global-set-key '(shift f4) (lambda () (interactive) (set-mark-command t)))
|
|
61
|
|
62 ;; Make F7 be `save-buffer'
|
70
|
63 (global-set-key 'f7 'save-buffer)
|
0
|
64
|
|
65 ;; Make F8 be "start macro", F9 be "end macro", F10 be "execute macro"
|
70
|
66 (global-set-key 'f8 'start-kbd-macro)
|
|
67 (global-set-key 'f9 'end-kbd-macro)
|
|
68 (global-set-key 'f10 'call-last-kbd-macro)
|
0
|
69
|
|
70 ;; Here's an alternative binding if you don't use keyboard macros:
|
|
71 ;; Make F8 be `save-buffer' followed by `delete-window'.
|
|
72 ;;(global-set-key 'f8 "\C-x\C-s\C-x0")
|
|
73
|
|
74 ;; If you prefer delete to actually delete forward then you want to
|
|
75 ;; uncomment the next line.
|
|
76 ;; (load-library "delbackspace")
|
|
77
|
|
78
|
|
79 (cond (running-xemacs
|
|
80 ;;
|
|
81 ;; Code for any version of XEmacs/Lucid Emacs goes here
|
|
82 ;;
|
|
83
|
|
84 ;; Change the values of some variables.
|
|
85 ;; (t means true; nil means false.)
|
|
86 ;;
|
|
87 ;; Use the "Describe Variable..." option on the "Help" menu
|
|
88 ;; to find out what these variables mean.
|
|
89 (setq find-file-use-truenames nil
|
|
90 find-file-compare-truenames t
|
|
91 minibuffer-confirm-incomplete t
|
|
92 complex-buffers-menu-p t
|
|
93 next-line-add-newlines nil
|
|
94 mail-yank-prefix "> "
|
|
95 kill-whole-line t
|
|
96 )
|
|
97
|
|
98 ;; When running ispell, consider all 1-3 character words as correct.
|
|
99 (setq ispell-extra-args '("-W" "3"))
|
|
100
|
70
|
101 ;; Change the way the buffer name is displayed in the
|
|
102 ;; modeline. The variable for this is called
|
|
103 ;; 'modeline-buffer-identification but was called
|
|
104 ;; 'mode-line-buffer-identification in older XEmacsen.
|
|
105 (if (boundp 'modeline-buffer-identification)
|
|
106 ;; Note that if you want to put more than one form in the
|
|
107 ;; `THEN' clause of an IF-THEN-ELSE construct, you have to
|
|
108 ;; surround the forms with `progn'. You don't have to
|
|
109 ;; do this for the `ELSE' clauses.
|
|
110 (progn
|
|
111 (setq-default modeline-buffer-identification '("XEmacs: %17b"))
|
|
112 (setq modeline-buffer-identification '("XEmacs: %17b")))
|
|
113 (setq-default mode-line-buffer-identification '("XEmacs: %17b"))
|
|
114 (setq mode-line-buffer-identification '("XEmacs: %17b")))
|
|
115
|
0
|
116 (cond ((or (not (fboundp 'device-type))
|
|
117 (equal (device-type) 'x))
|
|
118 ;; Code which applies only when running emacs under X goes here.
|
|
119 ;; (We check whether the function `device-type' exists
|
|
120 ;; before using it. In versions before 19.12, there
|
|
121 ;; was no such function. If it doesn't exist, we
|
|
122 ;; simply assume we're running under X -- versions before
|
|
123 ;; 19.12 only supported X.)
|
|
124
|
|
125 ;; Remove the binding of C-x C-c, which normally exits emacs.
|
|
126 ;; It's easy to hit this by mistake, and that can be annoying.
|
|
127 ;; Under X, you can always quit with the "Exit Emacs" option on
|
|
128 ;; the File menu.
|
|
129 (global-set-key "\C-x\C-c" nil)
|
|
130
|
|
131 ;; Uncomment this to enable "sticky modifier keys" in 19.13
|
|
132 ;; and up. With sticky modifier keys enabled, you can
|
|
133 ;; press and release a modifier key before pressing the
|
|
134 ;; key to be modified, like how the ESC key works always.
|
|
135 ;; If you hold the modifier key down, however, you still
|
|
136 ;; get the standard behavior. I personally think this
|
|
137 ;; is the best thing since sliced bread (and a *major*
|
|
138 ;; win when it comes to reducing Emacs pinky), but it's
|
|
139 ;; disorienting at first so I'm not enabling it here by
|
|
140 ;; default.
|
|
141
|
|
142 ;;(setq modifier-keys-are-sticky t)
|
|
143
|
|
144 ;; This changes the variable which controls the text that goes
|
|
145 ;; in the top window title bar. (However, it is not changed
|
|
146 ;; unless it currently has the default value, to avoid
|
|
147 ;; interfering with a -wn command line argument I may have
|
|
148 ;; started emacs with.)
|
|
149 (if (equal frame-title-format "%S: %b")
|
|
150 (setq frame-title-format
|
|
151 (concat "%S: " invocation-directory invocation-name
|
|
152 " [" emacs-version "]"
|
|
153 (if nil ; (getenv "NCD")
|
|
154 ""
|
|
155 " %b"))))
|
|
156
|
|
157 ;; If we're running on display 0, load some nifty sounds that
|
|
158 ;; will replace the default beep. But if we're running on a
|
|
159 ;; display other than 0, which probably means my NCD X terminal,
|
|
160 ;; which can't play digitized sounds, do two things: reduce the
|
|
161 ;; beep volume a bit, and change the pitch of the sound that is
|
|
162 ;; made for "no completions."
|
|
163 ;;
|
|
164 ;; (Note that sampled sounds only work if XEmacs was compiled
|
|
165 ;; with sound support, and we're running on the console of a
|
|
166 ;; Sparc, HP, or SGI machine, or on a machine which has a
|
|
167 ;; NetAudio server; otherwise, you just get the standard beep.)
|
|
168 ;;
|
|
169 ;; (Note further that changing the pitch and duration of the
|
|
170 ;; standard beep only works with some X servers; many servers
|
|
171 ;; completely ignore those parameters.)
|
|
172 ;;
|
|
173 (cond ((string-match ":0" (getenv "DISPLAY"))
|
|
174 (load-default-sounds))
|
|
175 (t
|
|
176 (setq bell-volume 40)
|
|
177 (setq sound-alist
|
|
178 (append sound-alist '((no-completion :pitch 500))))
|
|
179 ))
|
|
180
|
|
181 ;; Make `C-x C-m' and `C-x RET' be different (since I tend
|
|
182 ;; to type the latter by accident sometimes.)
|
|
183 (define-key global-map [(control x) return] nil)
|
|
184
|
|
185 ;; Change the pointer used when the mouse is over a modeline
|
|
186 (set-glyph-image modeline-pointer-glyph "leftbutton")
|
|
187
|
78
|
188 ;; Change the continuation glyph face so it stands out more
|
|
189 (and (fboundp 'set-glyph-property)
|
|
190 (boundp 'continuation-glyph)
|
|
191 (set-glyph-property continuation-glyph 'face 'bold))
|
|
192
|
0
|
193 ;; Change the pointer used during garbage collection.
|
|
194 ;;
|
|
195 ;; Note that this pointer image is rather large as pointers go,
|
|
196 ;; and so it won't work on some X servers (such as the MIT
|
|
197 ;; R5 Sun server) because servers may have lamentably small
|
|
198 ;; upper limits on pointer size.
|
|
199 ;;(if (featurep 'xpm)
|
|
200 ;; (set-glyph-image gc-pointer-glyph
|
|
201 ;; (expand-file-name "trash.xpm" data-directory)))
|
|
202
|
|
203 ;; Here's another way to do that: it first tries to load the
|
|
204 ;; pointer once and traps the error, just to see if it's
|
|
205 ;; possible to load that pointer on this system; if it is,
|
|
206 ;; then it sets gc-pointer-glyph, because we know that
|
|
207 ;; will work. Otherwise, it doesn't change that variable
|
|
208 ;; because we know it will just cause some error messages.
|
|
209 (if (featurep 'xpm)
|
|
210 (let ((file (expand-file-name "recycle.xpm" data-directory)))
|
|
211 (if (condition-case error
|
|
212 ;; check to make sure we can use the pointer.
|
|
213 (make-image-instance file nil
|
|
214 '(pointer))
|
|
215 (error nil)) ; returns nil if an error occurred.
|
|
216 (set-glyph-image gc-pointer-glyph file))))
|
|
217
|
|
218 ;; Add `dired' to the File menu
|
2
|
219 (add-menu-button '("File") ["Edit Directory" dired t])
|
0
|
220
|
|
221 ;; Here's a way to add scrollbar-like buttons to the menubar
|
2
|
222 (add-menu-button nil ["Top" beginning-of-buffer t])
|
|
223 (add-menu-button nil ["<<<" scroll-down t])
|
|
224 (add-menu-button nil [" . " recenter t])
|
|
225 (add-menu-button nil [">>>" scroll-up t])
|
|
226 (add-menu-button nil ["Bot" end-of-buffer t])
|
0
|
227
|
|
228 ;; Change the behavior of mouse button 2 (which is normally
|
|
229 ;; bound to `mouse-yank'), so that it inserts the selected text
|
|
230 ;; at point (where the text cursor is), instead of at the
|
|
231 ;; position clicked.
|
|
232 ;;
|
|
233 ;; Note that you can find out what a particular key sequence or
|
|
234 ;; mouse button does by using the "Describe Key..." option on
|
|
235 ;; the Help menu.
|
|
236 (setq mouse-yank-at-point t)
|
|
237
|
|
238 ;; When editing C code (and Lisp code and the like), I often
|
|
239 ;; like to insert tabs into comments and such. It gets to be
|
|
240 ;; a pain to always have to use `C-q TAB', so I set up a more
|
|
241 ;; convenient binding. Note that this does not work in
|
2
|
242 ;; TTY frames, where tab and shift-tab are indistinguishable.
|
0
|
243 (define-key global-map '(shift tab) 'self-insert-command)
|
|
244
|
|
245 ;; LISPM bindings of Control-Shift-C and Control-Shift-E.
|
|
246 ;; Note that "\C-C" means Control-C, not Control-Shift-C.
|
|
247 ;; To specify shifted control characters, you must use the
|
|
248 ;; more verbose syntax used here.
|
|
249 (define-key emacs-lisp-mode-map '(control C) 'compile-defun)
|
|
250 (define-key emacs-lisp-mode-map '(control E) 'eval-defun)
|
|
251
|
|
252 ;; If you like the FSF Emacs binding of button3 (single-click
|
|
253 ;; extends the selection, double-click kills the selection),
|
|
254 ;; uncomment the following:
|
|
255
|
|
256 ;; Under 19.13, the following is enough:
|
|
257 ;(define-key global-map 'button3 'mouse-track-adjust)
|
|
258
|
|
259 ;; But under 19.12, you need this:
|
|
260 ;(define-key global-map 'button3
|
|
261 ; (lambda (event)
|
|
262 ; (interactive "e")
|
|
263 ; (let ((default-mouse-track-adjust t))
|
|
264 ; (mouse-track event))))
|
|
265
|
|
266 ;; Under both 19.12 and 19.13, you also need this:
|
|
267 ;(add-hook 'mouse-track-click-hook
|
|
268 ; (lambda (event count)
|
|
269 ; (if (or (/= (event-button event) 3)
|
|
270 ; (/= count 2))
|
|
271 ; nil ;; do the normal operation
|
|
272 ; (kill-region (point) (mark))
|
|
273 ; t ;; don't do the normal operations.
|
|
274 ; )))
|
|
275
|
|
276
|
|
277 ))
|
|
278
|
|
279 ))
|
|
280
|
|
281 ;;; Older versions of emacs did not have these variables
|
|
282 ;;; (emacs-major-version and emacs-minor-version.)
|
|
283 ;;; Let's define them if they're not around, since they make
|
|
284 ;;; it much easier to conditionalize on the emacs version.
|
|
285
|
|
286 (if (and (not (boundp 'emacs-major-version))
|
|
287 (string-match "^[0-9]+" emacs-version))
|
|
288 (setq emacs-major-version
|
|
289 (string-to-int (substring emacs-version
|
|
290 (match-beginning 0) (match-end 0)))))
|
|
291 (if (and (not (boundp 'emacs-minor-version))
|
|
292 (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version))
|
|
293 (setq emacs-minor-version
|
|
294 (string-to-int (substring emacs-version
|
|
295 (match-beginning 1) (match-end 1)))))
|
|
296
|
|
297 ;;; Define a function to make it easier to check which version we're
|
|
298 ;;; running.
|
|
299
|
|
300 (defun running-emacs-version-or-newer (major minor)
|
|
301 (or (> emacs-major-version major)
|
|
302 (and (= emacs-major-version major)
|
|
303 (>= emacs-minor-version minor))))
|
|
304
|
|
305 (cond ((and running-xemacs
|
|
306 (running-emacs-version-or-newer 19 6))
|
|
307 ;;
|
|
308 ;; Code requiring XEmacs/Lucid Emacs version 19.6 or newer goes here
|
|
309 ;;
|
|
310 ))
|
|
311
|
|
312 (cond ((>= emacs-major-version 19)
|
|
313 ;;
|
|
314 ;; Code for any vintage-19 emacs goes here
|
|
315 ;;
|
|
316 ))
|
|
317
|
|
318 (cond ((and (not running-xemacs)
|
|
319 (>= emacs-major-version 19))
|
|
320 ;;
|
|
321 ;; Code specific to FSF Emacs 19 (not XEmacs/Lucid Emacs) goes here
|
|
322 ;;
|
|
323 ))
|
|
324
|
|
325 (cond ((< emacs-major-version 19)
|
|
326 ;;
|
|
327 ;; Code specific to emacs 18 goes here
|
|
328 ;;
|
|
329 ))
|
|
330
|
|
331
|
|
332 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
333 ;; Customization of Specific Packages ;;
|
|
334 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
335
|
|
336
|
|
337 ;;; ********************
|
70
|
338 ;;; Load ange-ftp, which uses the FTP protocol as a pseudo-filesystem.
|
0
|
339 ;;; When this is loaded, the pathname syntax /user@host:/remote/path
|
|
340 ;;; refers to files accessible through ftp.
|
|
341 ;;;
|
|
342 (require 'dired)
|
70
|
343 (require 'ange-ftp)
|
|
344 (setq ange-ftp-default-user "anonymous" ; id to use for /host:/remote/path
|
|
345 ange-ftp-generate-anonymous-password t ; use $USER@`hostname`
|
|
346 ange-ftp-binary-file-name-regexp "." ; always transfer in binary mode
|
|
347 )
|
24
|
348
|
0
|
349
|
|
350 ;;; ********************
|
|
351 ;;; Load the auto-save.el package, which lets you put all of your autosave
|
|
352 ;;; files in one place, instead of scattering them around the file system.
|
|
353 ;;;
|
|
354 (setq auto-save-directory (expand-file-name "~/autosave/")
|
|
355 auto-save-directory-fallback auto-save-directory
|
|
356 auto-save-hash-p nil
|
70
|
357 ange-ftp-auto-save t
|
|
358 ange-ftp-auto-save-remotely nil
|
0
|
359 ;; now that we have auto-save-timeout, let's crank this up
|
|
360 ;; for better interactive response.
|
|
361 auto-save-interval 2000
|
|
362 )
|
|
363 ;; We load this afterwards because it checks to make sure the
|
|
364 ;; auto-save-directory exists (creating it if not) when it's loaded.
|
|
365 (require 'auto-save)
|
|
366
|
|
367 ;; This adds additional extensions which indicate files normally
|
|
368 ;; handled by cc-mode.
|
|
369 (setq auto-mode-alist
|
|
370 (append '(("\\.C$" . c++-mode)
|
|
371 ("\\.cc$" . c++-mode)
|
|
372 ("\\.hh$" . c++-mode)
|
|
373 ("\\.c$" . c-mode)
|
|
374 ("\\.h$" . c-mode))
|
|
375 auto-mode-alist))
|
|
376
|
|
377
|
|
378 ;;; ********************
|
|
379 ;;; cc-mode (the mode you're in when editing C, C++, and Objective C files)
|
|
380
|
|
381 ;; Tell cc-mode not to check for old-style (K&R) function declarations.
|
|
382 ;; This speeds up indenting a lot.
|
|
383 (setq c-recognize-knr-p nil)
|
|
384
|
|
385 ;; Change the indentation amount to 4 spaces instead of 2.
|
|
386 ;; You have to do it in this complicated way because of the
|
|
387 ;; strange way the cc-mode initializes the value of `c-basic-offset'.
|
|
388 (add-hook 'c-mode-hook (lambda () (setq c-basic-offset 4)))
|
|
389
|
|
390
|
|
391 ;;; ********************
|
|
392 ;;; Load a partial-completion mechanism, which makes minibuffer completion
|
|
393 ;;; search multiple words instead of just prefixes; for example, the command
|
|
394 ;;; `M-x byte-compile-and-load-file RET' can be abbreviated as `M-x b-c-a RET'
|
|
395 ;;; because there are no other commands whose first three words begin with
|
|
396 ;;; the letters `b', `c', and `a' respectively.
|
|
397 ;;;
|
|
398 (load-library "completer")
|
|
399
|
|
400
|
|
401 ;;; ********************
|
|
402 ;;; Load crypt, which is a package for automatically decoding and reencoding
|
|
403 ;;; files by various methods - for example, you can visit a .Z or .gz file,
|
|
404 ;;; edit it, and have it automatically re-compressed when you save it again.
|
|
405 ;;;
|
|
406 (setq crypt-encryption-type 'pgp ; default encryption mechanism
|
|
407 crypt-confirm-password t ; make sure new passwords are correct
|
|
408 ;crypt-never-ever-decrypt t ; if you don't encrypt anything, set this to
|
|
409 ; tell it not to assume that "binary" files
|
|
410 ; are encrypted and require a password.
|
|
411 )
|
|
412 (require 'crypt)
|
|
413
|
|
414
|
|
415 ;;; ********************
|
|
416 ;;; Edebug is a source-level debugger for emacs-lisp programs.
|
|
417 ;;;
|
|
418 (define-key emacs-lisp-mode-map "\C-xx" 'edebug-defun)
|
|
419
|
|
420
|
|
421 ;;; ********************
|
|
422 ;;; Font-Lock is a syntax-highlighting package. When it is enabled and you
|
|
423 ;;; are editing a program, different parts of your program will appear in
|
|
424 ;;; different fonts or colors. For example, with the code below, comments
|
|
425 ;;; appear in red italics, function names in function definitions appear in
|
|
426 ;;; blue bold, etc. The code below will cause font-lock to automatically be
|
|
427 ;;; enabled when you edit C, C++, Emacs-Lisp, and many other kinds of
|
|
428 ;;; programs.
|
|
429 ;;;
|
|
430 ;;; The "Options" menu has some commands for controlling this as well.
|
|
431 ;;;
|
|
432 (cond (running-xemacs
|
|
433
|
|
434 ;; If you want the default colors, you could do this:
|
|
435 ;; (setq font-lock-use-default-fonts nil)
|
|
436 ;; (setq font-lock-use-default-colors t)
|
|
437 ;; but I want to specify my own colors, so I turn off all
|
|
438 ;; default values.
|
|
439 (setq font-lock-use-default-fonts nil)
|
|
440 (setq font-lock-use-default-colors nil)
|
|
441
|
|
442 (require 'font-lock)
|
|
443
|
|
444 ;; Mess around with the faces a bit. Note that you have
|
|
445 ;; to change the font-lock-use-default-* variables *before*
|
|
446 ;; loading font-lock, and wait till *after* loading font-lock
|
|
447 ;; to customize the faces.
|
|
448
|
|
449 ;; string face is green
|
|
450 (set-face-foreground 'font-lock-string-face "forest green")
|
|
451
|
|
452 ;; comments are italic and red; doc strings are italic
|
|
453 ;;
|
|
454 ;; (I use copy-face instead of make-face-italic/make-face-bold
|
|
455 ;; because the startup code does intelligent things to the
|
|
456 ;; 'italic and 'bold faces to ensure that they are different
|
|
457 ;; from the default face. For example, if the default face
|
|
458 ;; is bold, then the 'bold face will be unbold.)
|
|
459 (copy-face 'italic 'font-lock-comment-face)
|
2
|
460 ;; Underlining comments looks terrible on tty's
|
0
|
461 (set-face-underline-p 'font-lock-comment-face nil 'global 'tty)
|
|
462 (set-face-highlight-p 'font-lock-comment-face t 'global 'tty)
|
|
463 (copy-face 'font-lock-comment-face 'font-lock-doc-string-face)
|
|
464 (set-face-foreground 'font-lock-comment-face "red")
|
|
465
|
|
466 ;; function names are bold and blue
|
|
467 (copy-face 'bold 'font-lock-function-name-face)
|
|
468 (set-face-foreground 'font-lock-function-name-face "blue")
|
|
469
|
|
470 ;; misc. faces
|
|
471 (and (find-face 'font-lock-preprocessor-face) ; 19.13 and above
|
|
472 (copy-face 'bold 'font-lock-preprocessor-face))
|
|
473 (copy-face 'italic 'font-lock-type-face)
|
|
474 (copy-face 'bold 'font-lock-keyword-face)
|
|
475 ))
|
|
476
|
|
477
|
|
478 ;;; ********************
|
|
479 ;;; fast-lock is a package which speeds up the highlighting of files
|
|
480 ;;; by saving information about a font-locked buffer to a file and
|
|
481 ;;; loading that information when the file is loaded again. This
|
|
482 ;;; requires a little extra disk space be used.
|
|
483 ;;;
|
|
484 ;;; Normally fast-lock puts the cache file (the filename appended with
|
|
485 ;;; .flc) in the same directory as the file it caches. You can
|
|
486 ;;; specify an alternate directory to use by setting the variable
|
|
487 ;;; fast-lock-cache-directories.
|
|
488
|
|
489 ;; Let's use lazy-lock instead.
|
|
490 ;;(add-hook 'font-lock-mode-hook 'turn-on-fast-lock)
|
|
491 ;;(setq fast-lock-cache-directories '("/foo/bar/baz"))
|
|
492
|
|
493
|
|
494 ;;; ********************
|
|
495 ;;; lazy-lock is a package which speeds up the highlighting of files
|
|
496 ;;; by doing it "on-the-fly" -- only the visible portion of the
|
|
497 ;;; buffer is fontified. The results may not always be quite as
|
|
498 ;;; accurate as using full font-lock or fast-lock, but it's *much*
|
|
499 ;;; faster. No more annoying pauses when you load files.
|
|
500
|
|
501 (add-hook 'font-lock-mode-hook 'turn-on-lazy-lock)
|
|
502 ;; I personally don't like "stealth mode" (where lazy-lock starts
|
|
503 ;; fontifying in the background if you're idle for 30 seconds)
|
|
504 ;; because it takes too long to wake up again on my piddly Sparc 1+.
|
|
505 (setq lazy-lock-stealth-time nil)
|
|
506
|
|
507
|
|
508 ;;; ********************
|
|
509 ;;; func-menu is a package that scans your source file for function
|
|
510 ;;; definitions and makes a menubar entry that lets you jump to any
|
|
511 ;;; particular function definition by selecting it from the menu. The
|
|
512 ;;; following code turns this on for all of the recognized languages.
|
|
513 ;;; Scanning the buffer takes some time, but not much.
|
|
514 ;;;
|
|
515 ;;; Send bug reports, enhancements etc to:
|
|
516 ;;; David Hughes <ukchugd@ukpmr.cs.philips.nl>
|
|
517 ;;;
|
|
518 (cond (running-xemacs
|
|
519 (require 'func-menu)
|
|
520 (define-key global-map 'f8 'function-menu)
|
|
521 (add-hook 'find-file-hooks 'fume-add-menubar-entry)
|
|
522 (define-key global-map "\C-cl" 'fume-list-functions)
|
|
523 (define-key global-map "\C-cg" 'fume-prompt-function-goto)
|
|
524
|
|
525 ;; The Hyperbole information manager package uses (shift button2) and
|
|
526 ;; (shift button3) to provide context-sensitive mouse keys. If you
|
|
527 ;; use this next binding, it will conflict with Hyperbole's setup.
|
|
528 ;; Choose another mouse key if you use Hyperbole.
|
|
529 (define-key global-map '(shift button3) 'mouse-function-menu)
|
|
530
|
|
531 ;; For descriptions of the following user-customizable variables,
|
|
532 ;; type C-h v <variable>
|
|
533 (setq fume-max-items 25
|
|
534 fume-fn-window-position 3
|
|
535 fume-auto-position-popup t
|
|
536 fume-display-in-modeline-p t
|
|
537 fume-menubar-menu-location "File"
|
|
538 fume-buffer-name "*Function List*"
|
|
539 fume-no-prompt-on-valid-default nil)
|
|
540 ))
|
|
541
|
|
542
|
|
543 ;;; ********************
|
|
544 ;;; MH is a mail-reading system from the Rand Corporation that relies on a
|
|
545 ;;; number of external filter programs (which do not come with emacs.)
|
|
546 ;;; Emacs provides a nice front-end onto MH, called "mh-e".
|
|
547 ;;;
|
|
548 ;; Bindings that let you send or read mail using MH
|
2
|
549 ;(global-set-key "\C-xm" 'mh-smail)
|
0
|
550 ;(global-set-key "\C-x4m" 'mh-smail-other-window)
|
2
|
551 ;(global-set-key "\C-cr" 'mh-rmail)
|
0
|
552
|
|
553 ;; Customization of MH behavior.
|
|
554 (setq mh-delete-yanked-msg-window t)
|
|
555 (setq mh-yank-from-start-of-msg 'body)
|
|
556 (setq mh-summary-height 11)
|
|
557
|
|
558 ;; Use lines like the following if your version of MH
|
|
559 ;; is in a special place.
|
|
560 ;(setq mh-progs "/usr/dist/pkgs/mh/bin.svr4/")
|
|
561 ;(setq mh-lib "/usr/dist/pkgs/mh/lib.svr4/")
|
|
562
|
|
563
|
|
564 ;;; ********************
|
|
565 ;;; resize-minibuffer-mode makes the minibuffer automatically
|
|
566 ;;; resize as necessary when it's too big to hold its contents.
|
|
567
|
|
568 (autoload 'resize-minibuffer-mode "rsz-minibuf" nil t)
|
|
569 (resize-minibuffer-mode)
|
|
570 (setq resize-minibuffer-window-exactly nil)
|
|
571
|
78
|
572 ;; Create a single detached minibuffer used by all frames.
|
|
573 ;; Uncomment to try this out.
|
|
574 ;(when running-xemacs
|
|
575 ; (setq initial-frame-plist '(minibuffer nil))
|
|
576 ; (setq default-frame-plist '(minibuffer nil))
|
|
577 ; (setq default-minibuffer-frame
|
|
578 ; (make-frame
|
|
579 ; '(minibuffer only
|
|
580 ; width 86
|
|
581 ; height 1
|
|
582 ; menubar-visible-p nil
|
|
583 ; default-toolbar-visible-p nil
|
|
584 ; name "minibuffer"
|
|
585 ; top -2
|
|
586 ; left -2
|
|
587 ; has-modeline-p nil)))
|
|
588 ; (frame-notice-user-settings))
|
|
589
|
0
|
590 ;;; ********************
|
|
591 ;;; W3 is a browser for the World Wide Web, and takes advantage of the very
|
|
592 ;;; latest redisplay features in XEmacs. You can access it simply by typing
|
|
593 ;;; 'M-x w3'; however, if you're unlucky enough to be on a machine that is
|
|
594 ;;; behind a firewall, you will have to do something like this first:
|
|
595
|
|
596 ;(setq w3-use-telnet t
|
|
597 ; ;;
|
|
598 ; ;; If the Telnet program you use to access the outside world is
|
|
599 ; ;; not called "telnet", specify its name like this.
|
|
600 ; w3-telnet-prog "itelnet"
|
|
601 ; ;;
|
|
602 ; ;; If your Telnet program adds lines of junk at the beginning
|
|
603 ; ;; of the session, specify the number of lines here.
|
|
604 ; w3-telnet-header-length 4
|
|
605 ; )
|