6
|
1 ;;; GNU Emacs init file for Henry Thompson
|
|
2 ;;; This part shared between all hosts
|
|
3 ;;; This part is my personal stuff, not for other incarnations
|
|
4 ;;; initialisation file for Emacs, that is, (l)emacs and epoch common
|
|
5 ;;; Last edited: Fri Sep 25 09:22:22 1992
|
|
6 ;;; Edit history since port: made load-path not site-dependant
|
|
7 ;;; split into common-init for all my incarnations and pers-init for private
|
|
8 ;;; added lemacs compatibility
|
|
9
|
|
10 ;;; mail stuff
|
|
11 (setq mail-archive-file-name "~/mail/cpy/general")
|
|
12 (setq rmail-dont-reply-to-names "hthompso*\\|h\\.thompso*\\|ht@*" )
|
|
13 (set-default 'ht-last-file (expand-file-name "~/mail/"))
|
|
14 (setq ht-diary-file-name "~/mail/diary.babyl")
|
|
15 (setq mail-append-host "inf.ed.ac.uk")
|
|
16 (setq user-full-name "Henry S. Thompson")
|
|
17 (setq user-mail-address "ht@inf.ed.ac.uk")
|
|
18 (setq mail-host-address "inf.ed.ac.uk")
|
|
19
|
|
20 ;; new mail hackery
|
|
21 (site-caseq ((edin ircs ldc)
|
|
22 (setq rmail-spool-directory (file-name-as-directory
|
|
23 (concat rmail-spool-directory
|
|
24 "ht-mail")))))
|
|
25
|
|
26 ;; sending mail on the road
|
21
|
27 ;; [moved to mail-from-m.el, which is required by gnus-init.el
|
6
|
28
|
|
29 ;; don't know why this is necessary
|
|
30 (site-caseq ((edin)
|
|
31 (setq rmail-primary-inbox-list
|
|
32 (list (concat rmail-spool-directory "ht")))))
|
|
33
|
|
34 ;; Perforce
|
|
35
|
|
36 ;;(setq p4-global-server-port "zorg.milowski.com:1666")
|
|
37 ;;(setenv "P4PORT" "zorg.milowski.com:1666")
|
|
38 ;;(setenv "P4CLIENT" "MarkupMan")
|
|
39 ;;(setenv "P4CONFIG" ".p4env")
|
|
40 ;;(load-library "p4")
|
|
41 ;;(setq p4-use-p4config-exclusively t)
|
|
42 ;;(p4-set-p4-executable "/c/Program Files/Perforce/p4.exe")
|
|
43 (setq vc-command-messages t)
|
|
44
|
|
45 (setq minibuffer-max-depth nil)
|
|
46 (defun run-kcl ()
|
|
47 "Run an inferior kcl process"
|
|
48 (interactive)
|
|
49 (switch-to-buffer (make-shell "kcl" "kcl"))
|
|
50 (inferior-lisp-mode))
|
|
51
|
|
52 (require 'mdn-extras)
|
|
53 (setq auto-mode-alist
|
|
54 (append '(("/perl/" . perl-mode)
|
19
|
55 ("\\.scm$" . scheme-mode))
|
6
|
56 auto-mode-alist))
|
24
|
57 (setq inferior-lisp-program "scheme")
|
6
|
58 ;;; for scheme
|
|
59 (put 'letrec 'lisp-indent-function 1)
|
|
60 (put 'case 'lisp-indent-function 1)
|
|
61
|
|
62 (site-caseq (parc (nconc load-path '("/import/local/emacs/gnus-3.13/"))
|
|
63 (setq rmail-primary-inbox-list
|
|
64 '("~/mbox" "/net/piglet/usr/spool/mail/$USER")))
|
|
65 (edin (setq load-path (cons
|
|
66 "/home/ht/emacs/shared/gnus-5.0.15/lisp"
|
|
67 load-path))))
|
|
68
|
|
69 (defun run-sicstus ()
|
|
70 "Run an inferior Prolog process, input and output via buffer *prolog*."
|
|
71 (interactive)
|
|
72 (if (not (boundp 'prolog-mode-map))
|
|
73 (let ((load-path (cons
|
|
74 (site-caseq (parc "/import/prolog-1.8/emacs")
|
|
75 (edin "??"))
|
|
76 load-path)))
|
|
77 (load "prolog" nil t)))
|
|
78 (require 'shell)
|
|
79 (switch-to-buffer (make-shell "prolog" (site-caseq (edin "sicstus")
|
|
80 (parc "prolog"))))
|
|
81 (inferior-prolog-mode))
|
|
82
|
19
|
83 (site-caseq ((laptop maritain))
|
6
|
84 (t(require 'hist)
|
|
85 (rplacd (assoc "*shell*" hk-pat-table)
|
|
86 "[a-z]+<[0-9]+>: ")))
|
|
87
|
|
88 ;; turn off suspend-emacs -- use pause-emacs (^X.) instead
|
|
89 (global-unset-key "\C-Z")
|
|
90 (global-unset-key "\C-x\C-z")
|
|
91
|
|
92 (global-set-key "\C-xl" (function goto-line))
|
|
93
|
|
94 ;(require 'repl-comment)
|
|
95
|
|
96 ;(require 'compress)
|
|
97
|
|
98 (if (string-match "Lucid" emacs-version)
|
19
|
99 (site-caseq ((laptop maritain))
|
6
|
100 (t(require 'lemacs-compat))))
|
|
101
|
|
102 (if (boundp 'epoch::version)
|
|
103 ;; epoch only goes here
|
|
104 (progn
|
|
105 (if (string-match "4\\."emacs-version)
|
|
106 (load "motion4" nil t)
|
|
107 (load "motion" nil t))
|
|
108 (redisplay-frame)
|
|
109
|
|
110 (require 'alarm)
|
|
111 (idle-save 15)
|
|
112
|
|
113 (defun ht-rooms-setup (&optional arg)
|
|
114 (interactive)
|
|
115 (redisplay-frame)
|
|
116 (require 'mail-extras)
|
|
117 (require 'diary)
|
|
118 (require 'my-news)
|
|
119 (let ((scr (current-frame)))
|
|
120 (load "ht-rooms-epoch.config" nil t)
|
|
121 (unwind-protect (make-frame-for-room "diary" "-0" "+130"))
|
|
122 (unwind-protect (make-frame-for-room "elisp" "-25" "+148"))
|
|
123 (unwind-protect (make-frame-for-room "news" "-50" "+166"))
|
|
124 (unwind-protect (make-frame-for-room "mail" "-75" "+184"))
|
|
125 (epoch::delete-frame scr))
|
|
126 ;; presumably this is now frame local, so not quite the right thing.
|
|
127 (setq ht-default-config (current-window-configuration)))
|
|
128 ))
|
|
129 (if (string-match "^\\(19\\|2\\)" emacs-version)
|
|
130 (progn
|
|
131 ;; common v19
|
|
132 (if window-system
|
|
133 (progn
|
|
134 (add-hook 'sh-mode-hook '(lambda ()
|
|
135 (font-lock-mode 1)))
|
19
|
136 (add-hook 'lsl-mode-hook '(lambda ()
|
6
|
137 (font-lock-mode 1)))
|
19
|
138 (add-hook 'perl-mode-hook '(lambda ()
|
6
|
139 (font-lock-mode 1)))
|
19
|
140 (add-hook 'emacs-lisp-mode-hook '(lambda ()
|
6
|
141 (font-lock-mode 1)))
|
19
|
142 (add-hook 'lisp-mode-hook '(lambda ()
|
6
|
143 (font-lock-mode 1)))
|
19
|
144 (add-hook 'sgml-mode-hook '(lambda ()
|
6
|
145 (if (not
|
|
146 (boundp 'sgml-font-lock-keywords))
|
|
147 (load "sgml-font-lock-keywords" t t))
|
|
148 (setq adaptive-fill-mode nil)
|
|
149 (font-lock-mode 1)
|
|
150 ))
|
19
|
151 (add-hook 'c-mode-hook '(lambda ()
|
6
|
152 (font-lock-mode 1)))
|
19
|
153 (add-hook 'c++-mode-hook '(lambda ()
|
6
|
154 (font-lock-mode 1)))
|
19
|
155 (add-hook 'scheme-mode-hook
|
6
|
156 '(lambda ()
|
|
157 (setq
|
|
158 scheme-font-lock-keywords
|
|
159 (if (or
|
|
160 (boundp 'lisp-font-lock-keywords)
|
|
161 (load "lisp-font-lock-keywords" t t))
|
|
162 lisp-font-lock-keywords))
|
|
163 (font-lock-mode 1)))
|
19
|
164 (add-hook 'python-mode-hook '(lambda ()
|
6
|
165 (font-lock-mode 1)))
|
|
166 (setq py-python-command "//c/Program Files/Python22/python")
|
|
167 (setq sgml-insert-missing-element-comment nil)
|
|
168 (load "psgml" nil t)
|
|
169 (load "psgml-edit" nil t)
|
|
170 ;; (load "xml-hack" nil t)
|
|
171 ; (setq sgml-catalog-files '("CATALOG" "f:/lib/sgml/catalog"))
|
|
172 (if (string-match "i386" (emacs-version))
|
|
173 (progn (defun win32-get-clipboard-data-cmd ()
|
|
174 (interactive)(insert (win32-get-clipboard-data)))
|
|
175 (global-set-key
|
|
176 "\C-x\C-y" 'win32-get-clipboard-data-cmd)))
|
|
177 ;; gnus
|
12
|
178 ; (setq mail-signature t)
|
19
|
179
|
12
|
180 ;; loading gnus postponed to e.g. mail-from-delphix, q.v.
|
6
|
181
|
|
182 ; (require 'gnus-min)
|
|
183 ))
|
21
|
184 (load "gnus-init" nil t)
|
6
|
185
|
|
186 ;; (require 'idle)
|
|
187 ;; (idle-save 15)
|
|
188
|
|
189 (if (string-match "Lucid" emacs-version)
|
|
190 ;; lemacs only goes here
|
|
191 (progn
|
24
|
192 (message "lem")
|
6
|
193 (setq bbdb-north-american-phone-numbers-p nil)
|
|
194 (setq bbdb-use-pop-up nil)
|
24
|
195 (require 'mail-abbrevs)
|
6
|
196 (require 'bbdb)
|
24
|
197 ;(require 'bbdb-rmail)
|
|
198 (require 'bbdb-com) ; to fix auto-fill
|
|
199 (setq mail-use-rfc822 nil)
|
|
200 (add-hook 'gnus-summary-mode-hook
|
|
201 (function (lambda ()
|
|
202 (make-local-variable 'mail-use-rfc822)
|
|
203 (setq mail-use-rfc822 t))))
|
|
204 (if (>= emacs-major-version 21)
|
|
205 (progn
|
|
206 (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
|
|
207 (add-hook 'gnus-startup-hook 'bbdb-insinuate-message)))
|
|
208 (fset 'bbdb-auto-fill-function (lambda () t)) ; ditto
|
|
209 (fmakunbound 'bbdb-orig-rmail-expunge)
|
|
210 ;(add-hook 'rmail-mode-hook 'bbdb-insinuate-rmail)
|
6
|
211 (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
|
|
212 (add-hook 'mail-setup-hook 'bbdb-insinuate-sendmail)
|
24
|
213 (setq bbdb-dwim-net-address-allow-redundancy t)
|
6
|
214 (add-hook 'mail-setup-hook 'bbdb-define-all-aliases)
|
|
215 (add-hook 'gnus-message-setup-hook 'bbdb-define-all-aliases)
|
24
|
216 (if (not (fboundp 'define-mail-abbrev))
|
|
217 ;; fix a bug which crashes occasionally -- see also
|
|
218 ;; bbdb-com
|
|
219 (progn
|
|
220 (require 'sendmail)
|
|
221 ;(defadvice sendmail-pre-abbrev-expand-hook
|
|
222 ; (before bbdb-rebuilt-all-aliases activate)
|
|
223 ; (bbdb-rebuilt-all-aliases))
|
|
224 ))
|
|
225 (defun gnuserv-start-maybe ()
|
|
226 (if (not (frame-live-p gnuserv-frame))
|
|
227 (gnuserv-start)))
|
|
228 ;;; (require 'itimer)
|
|
229 ;;; (start-itimer "gsr" 'gnuserv-start-maybe
|
|
230 ;;; 1200 1200 nil nil)
|
6
|
231
|
|
232 (if window-system
|
|
233 (progn
|
|
234 (require 'highlight-headers)
|
|
235 (defun rmail-fontify-headers ()
|
|
236 (highlight-headers (point-min) (point-max) t))
|
|
237 (add-hook 'rmail-show-message-hook 'rmail-fontify-headers)
|
|
238 (setq dired-mode-hook
|
|
239 '(lambda ()
|
|
240 (font-lock-mode 1)
|
|
241 (define-key dired-mode-map
|
|
242 [button2] '(lambda (click)
|
|
243 (interactive "e")
|
|
244 (mouse-set-point click)
|
|
245 (dired-advertised-find-file)))))
|
|
246 ;; (setq highlight-headers-follow-url-function
|
|
247 ;; 'highlight-headers-ht-follow-url-netscape
|
|
248 ;; browse-url-browser-function
|
|
249 ;;'highlight-headers-ht-follow-url-netscape)
|
|
250 ))
|
|
251 ;; (load "~rjc/public_html/device-type-hacking.el")
|
|
252 (load "perl-mode" nil t)
|
|
253 (defun ht-rooms-setup (&optional arg)
|
|
254 (interactive)
|
|
255 (require 'mail-extras)
|
|
256 (require 'diary)
|
|
257 (require 'my-news)
|
|
258 ;; override changed default, except in gnus
|
|
259 (setq mail-use-rfc822 nil)
|
|
260 (add-hook 'gnus-summary-mode-hook
|
|
261 (function (lambda ()
|
|
262 (make-local-variable 'mail-use-rfc822)
|
|
263 (setq mail-use-rfc822 t))))
|
|
264 (if (>= emacs-major-version 21)
|
|
265 (progn
|
|
266 (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
|
|
267 (add-hook 'gnus-startup-hook 'bbdb-insinuate-message)))
|
|
268 (defun ht-rooms-setup (&optional arg)
|
|
269 (interactive)
|
|
270 (require 'mail-extras)
|
|
271 (require 'diary)
|
|
272 (let ((scr (selected-frame)))
|
|
273 ; (sit-for 5)
|
|
274 (load "ht-rooms.config" nil t)
|
|
275 (unwind-protect (make-screen-for-room "diary" "0" "+62"))
|
|
276 ; (sit-for 5)
|
|
277 (unwind-protect (make-screen-for-room "elisp" "-25" "+79"))
|
|
278 ; (sit-for 5)
|
|
279 (unwind-protect (make-screen-for-room "news" "-50" "+96"))
|
|
280 ; (sit-for 5)
|
|
281 (unwind-protect (make-screen-for-room "mail" "-75" "+113"))
|
|
282 (sit-for 1)
|
|
283 (delete-screen scr))
|
|
284 (setq ht-default-config (current-window-configuration)))))
|
|
285 ;; vanilla v19 goes here
|
|
286 (if window-system
|
|
287 (progn
|
|
288 (defvar ht-frame-parameter-mods
|
|
289 '((auto-raise . t)
|
|
290 (auto-lower . nil)
|
|
291 (cursor-type . bar)))
|
|
292 (nconc
|
19
|
293 (site-caseq ((laptop maritain) (list '(height . 35)))
|
6
|
294 (t
|
|
295 (list
|
|
296 '(font .
|
|
297 "-adobe-courier-medium-r-normal--14-*"))))
|
|
298 ht-frame-parameter-mods
|
|
299 )
|
|
300 ;; if we have X, we have ISO-Latin-1, so
|
|
301 ;; set char codes 128--255 to display as themselves.
|
|
302 (require 'disp-table)
|
|
303 (standard-display-8bit 161 255)
|
|
304 ; (transient-mark-mode t)
|
|
305 ;; hightlight searching in bold
|
|
306 (setq search-highlight t)
|
|
307 (make-face 'isearch)
|
|
308 (copy-face 'bold 'isearch)
|
|
309 ; (set-face-underline-p 'region t)
|
|
310 ; (set-face-background 'region "white")
|
|
311 ; (set-face-foreground 'region "black")
|
|
312 ; (setq c++-font-lock-keywords 'undef)
|
|
313 ; (setq c-font-lock-keywords 'undef)
|
|
314 (modify-frame-parameters
|
|
315 nil
|
|
316 ht-frame-parameter-mods)
|
|
317 (setq default-frame-alist
|
|
318 (append
|
|
319 ht-frame-parameter-mods default-frame-alist))
|
|
320 ;; fix cut and paste
|
|
321 (setq interprogram-paste-function nil
|
|
322 interprogram-cut-function nil)
|
|
323 (defun ht-mouse-set-region (click) "set region and primary selection"
|
|
324 (interactive "e")
|
|
325 (mouse-set-region click)
|
|
326 (x-set-selection "PRIMARY" (buffer-substring (point)(mark))))
|
|
327 (defun ht-mouse-drag-region (click)
|
|
328 "drag region and set primary selection"
|
|
329 (interactive "e")
|
|
330 (mouse-drag-region click)
|
|
331 (if mark-active
|
|
332 (x-set-selection "PRIMARY" (buffer-substring (point)(mark)))))
|
|
333 (global-set-key [drag-mouse-1] (function ht-mouse-set-region))
|
|
334 (global-set-key [down-mouse-1] (function ht-mouse-drag-region))
|
|
335 (defun ht-mouse-insert-primary (click)
|
|
336 "set point and insert primary selection"
|
|
337 (interactive "e")
|
|
338 (mouse-set-point click)
|
|
339 (push-mark nil nil t)
|
|
340 (insert (x-selection)))
|
|
341 (global-set-key [mouse-2] (function ht-mouse-insert-primary))
|
|
342 (setq dired-mode-hook
|
|
343 '(lambda ()
|
|
344 (font-lock-mode 1)
|
|
345 (define-key dired-mode-map
|
|
346 [mouse-2] '(lambda (click)
|
|
347 (interactive "e")
|
|
348 (mouse-set-point click)
|
|
349 (dired-advertised-find-file)))))
|
|
350
|
|
351 (defun ht-rooms-setup (&optional arg)
|
|
352 (interactive)
|
|
353 (require 'mail-extras)
|
|
354 (require 'diary)
|
|
355 (require 'my-news)
|
|
356 ;; override changed default, except in gnus
|
|
357 (setq mail-use-rfc822 nil)
|
|
358 (add-hook 'gnus-summary-mode-hook
|
|
359 (function (lambda ()
|
|
360 (make-local-variable 'mail-use-rfc822)
|
|
361 (setq mail-use-rfc822 t))))
|
|
362 (let ((scr (selected-frame)))
|
|
363 (load "ht-rooms.config" nil t)
|
|
364 (unwind-protect (make-frame-for-room "elisp" "-25" "-58"))
|
|
365 (unwind-protect (progn
|
|
366 (make-frame-for-room "news" "-50" "-40")
|
|
367 ))
|
|
368 (unwind-protect (progn
|
|
369 (make-frame-for-room "mail" "-75" "-22")
|
|
370 ))
|
|
371 (unwind-protect (progn
|
|
372 (make-frame-for-room
|
|
373 "diary"
|
|
374 "-0"
|
|
375 (concat
|
|
376 "+"
|
|
377 (format
|
|
378 "%d"
|
|
379 (-
|
|
380 (cdr
|
|
381 (assoc
|
|
382 'top
|
|
383 (frame-parameters
|
|
384 (cdr
|
|
385 (assoc
|
|
386 "elisp"
|
|
387 frames-table)))))
|
|
388 18))))
|
|
389 ))
|
|
390 (make-frame-invisible scr))
|
24
|
391 (setq ht-default-config (current-window-configuration))))))
|
6
|
392 (setq sgml-insert-missing-element-comment nil)
|
|
393 (add-hook 'sgml-mode-hook 'sgml-fix-para)
|
24
|
394 )
|
6
|
395 ;; v18 emacs only goes here
|
|
396 (progn
|
|
397 (require 'compress)
|
|
398 (defun ht-rooms-setup (&optional arg)
|
|
399 (interactive)
|
|
400 (require 'mail-extras)
|
|
401 (require 'diary)
|
|
402 (require 'my-news)
|
|
403 (load "ht-rooms.config" nil t)
|
|
404 (setq ht-default-config (current-window-configuration)))))
|
|
405
|
24
|
406 (defun ht-rooms-resetup ()
|
|
407 (interactive)
|
|
408 (setq rooms-table nil)
|
|
409 (setq frames-table nil)
|
|
410 (ht-rooms-setup))
|
|
411
|
6
|
412 (defun sgml-fix-para ()
|
|
413 (setq paragraph-separate
|
|
414 "</[^>]*>\n\\([ \t]+\\| \\)")
|
|
415 (setq paragraph-start
|
|
416 "^[ \t]*</?[A-Za-z._-]+[ >]"))
|
|
417
|
24
|
418 (defun highlight-headers-ht-follow-url-netscape (url &optional arg)
|
6
|
419 (message "Sending URL to Netscape...")
|
|
420 (save-excursion
|
|
421 (set-buffer (get-buffer-create "*Shell Command Output*"))
|
|
422 (erase-buffer)
|
|
423 (if (equal 0 (call-process "netscape" nil t nil "-display" ":0.0"
|
|
424 "-remote"
|
|
425 (concat "openURL(" url ")")))
|
|
426 ;; it worked
|
|
427 nil
|
|
428 ;; it didn't work, so start a new Netscape process.
|
|
429 (call-process "netscape" nil 0 nil url)))
|
|
430 (message "Sending URL to Netscape... done"))
|
|
431
|
|
432 (site-caseq (laptop (defun system-name () "francis.markup.co.uk")))
|
|
433
|
|
434 (cd (user-home-directory))
|
19
|
435
|
24
|
436 (require 'misc) ; used to be in common-init...
|
19
|
437
|
|
438 (ht-custom-size)
|