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