annotate etc/sample.emacs @ 151:59463afc5666 r20-3b2

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