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