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