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))
|
19
|
57 (setq inferior-lisp-program "/c/Progra~1/ChezSc~1.4/bin/i3nt/petite")
|
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
|
|
192 (setq bbdb-north-american-phone-numbers-p nil)
|
|
193 (setq bbdb-use-pop-up nil)
|
|
194 (require 'bbdb)
|
|
195 (add-hook 'rmail-mode-hook 'bbdb-insinuate-rmail)
|
|
196 (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
|
|
197 (add-hook 'mail-setup-hook 'bbdb-insinuate-sendmail)
|
|
198 (add-hook 'mail-setup-hook 'bbdb-define-all-aliases)
|
|
199 (add-hook 'gnus-message-setup-hook 'bbdb-define-all-aliases)
|
|
200
|
|
201
|
|
202
|
|
203 (if window-system
|
|
204 (progn
|
|
205 (require 'highlight-headers)
|
|
206 (defun rmail-fontify-headers ()
|
|
207 (highlight-headers (point-min) (point-max) t))
|
|
208 (add-hook 'rmail-show-message-hook 'rmail-fontify-headers)
|
|
209 (setq dired-mode-hook
|
|
210 '(lambda ()
|
|
211 (font-lock-mode 1)
|
|
212 (define-key dired-mode-map
|
|
213 [button2] '(lambda (click)
|
|
214 (interactive "e")
|
|
215 (mouse-set-point click)
|
|
216 (dired-advertised-find-file)))))
|
|
217 ;; (setq highlight-headers-follow-url-function
|
|
218 ;; 'highlight-headers-ht-follow-url-netscape
|
|
219 ;; browse-url-browser-function
|
|
220 ;;'highlight-headers-ht-follow-url-netscape)
|
|
221 ))
|
|
222 ;; (load "~rjc/public_html/device-type-hacking.el")
|
|
223 (load "perl-mode" nil t)
|
|
224 (defun ht-rooms-setup (&optional arg)
|
|
225 (interactive)
|
|
226 (require 'mail-extras)
|
|
227 (require 'diary)
|
|
228 (require 'my-news)
|
|
229 ;; override changed default, except in gnus
|
|
230 (setq mail-use-rfc822 nil)
|
|
231 (add-hook 'gnus-summary-mode-hook
|
|
232 (function (lambda ()
|
|
233 (make-local-variable 'mail-use-rfc822)
|
|
234 (setq mail-use-rfc822 t))))
|
|
235 (if (>= emacs-major-version 21)
|
|
236 (progn
|
|
237 (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
|
|
238 (add-hook 'gnus-startup-hook 'bbdb-insinuate-message)))
|
|
239 (defun ht-rooms-setup (&optional arg)
|
|
240 (interactive)
|
|
241 (require 'mail-extras)
|
|
242 (require 'diary)
|
|
243 (let ((scr (selected-frame)))
|
|
244 ; (sit-for 5)
|
|
245 (load "ht-rooms.config" nil t)
|
|
246 (unwind-protect (make-screen-for-room "diary" "0" "+62"))
|
|
247 ; (sit-for 5)
|
|
248 (unwind-protect (make-screen-for-room "elisp" "-25" "+79"))
|
|
249 ; (sit-for 5)
|
|
250 (unwind-protect (make-screen-for-room "news" "-50" "+96"))
|
|
251 ; (sit-for 5)
|
|
252 (unwind-protect (make-screen-for-room "mail" "-75" "+113"))
|
|
253 (sit-for 1)
|
|
254 (delete-screen scr))
|
|
255 (setq ht-default-config (current-window-configuration)))))
|
|
256 ;; vanilla v19 goes here
|
|
257 (if window-system
|
|
258 (progn
|
|
259 (defvar ht-frame-parameter-mods
|
|
260 '((auto-raise . t)
|
|
261 (auto-lower . nil)
|
|
262 (cursor-type . bar)))
|
|
263 (nconc
|
19
|
264 (site-caseq ((laptop maritain) (list '(height . 35)))
|
6
|
265 (t
|
|
266 (list
|
|
267 '(font .
|
|
268 "-adobe-courier-medium-r-normal--14-*"))))
|
|
269 ht-frame-parameter-mods
|
|
270 )
|
|
271 ;; if we have X, we have ISO-Latin-1, so
|
|
272 ;; set char codes 128--255 to display as themselves.
|
|
273 (require 'disp-table)
|
|
274 (standard-display-8bit 161 255)
|
|
275 ; (transient-mark-mode t)
|
|
276 ;; hightlight searching in bold
|
|
277 (setq search-highlight t)
|
|
278 (make-face 'isearch)
|
|
279 (copy-face 'bold 'isearch)
|
|
280 ; (set-face-underline-p 'region t)
|
|
281 ; (set-face-background 'region "white")
|
|
282 ; (set-face-foreground 'region "black")
|
|
283 ; (setq c++-font-lock-keywords 'undef)
|
|
284 ; (setq c-font-lock-keywords 'undef)
|
|
285 (modify-frame-parameters
|
|
286 nil
|
|
287 ht-frame-parameter-mods)
|
|
288 (setq default-frame-alist
|
|
289 (append
|
|
290 ht-frame-parameter-mods default-frame-alist))
|
|
291 ;; fix cut and paste
|
|
292 (setq interprogram-paste-function nil
|
|
293 interprogram-cut-function nil)
|
|
294 (defun ht-mouse-set-region (click) "set region and primary selection"
|
|
295 (interactive "e")
|
|
296 (mouse-set-region click)
|
|
297 (x-set-selection "PRIMARY" (buffer-substring (point)(mark))))
|
|
298 (defun ht-mouse-drag-region (click)
|
|
299 "drag region and set primary selection"
|
|
300 (interactive "e")
|
|
301 (mouse-drag-region click)
|
|
302 (if mark-active
|
|
303 (x-set-selection "PRIMARY" (buffer-substring (point)(mark)))))
|
|
304 (global-set-key [drag-mouse-1] (function ht-mouse-set-region))
|
|
305 (global-set-key [down-mouse-1] (function ht-mouse-drag-region))
|
|
306 (defun ht-mouse-insert-primary (click)
|
|
307 "set point and insert primary selection"
|
|
308 (interactive "e")
|
|
309 (mouse-set-point click)
|
|
310 (push-mark nil nil t)
|
|
311 (insert (x-selection)))
|
|
312 (global-set-key [mouse-2] (function ht-mouse-insert-primary))
|
|
313 (setq dired-mode-hook
|
|
314 '(lambda ()
|
|
315 (font-lock-mode 1)
|
|
316 (define-key dired-mode-map
|
|
317 [mouse-2] '(lambda (click)
|
|
318 (interactive "e")
|
|
319 (mouse-set-point click)
|
|
320 (dired-advertised-find-file)))))
|
|
321
|
|
322 (defun ht-rooms-setup (&optional arg)
|
|
323 (interactive)
|
|
324 (require 'mail-extras)
|
|
325 (require 'diary)
|
|
326 (require 'my-news)
|
|
327 ;; override changed default, except in gnus
|
|
328 (setq mail-use-rfc822 nil)
|
|
329 (add-hook 'gnus-summary-mode-hook
|
|
330 (function (lambda ()
|
|
331 (make-local-variable 'mail-use-rfc822)
|
|
332 (setq mail-use-rfc822 t))))
|
|
333 (let ((scr (selected-frame)))
|
|
334 (load "ht-rooms.config" nil t)
|
|
335 (unwind-protect (make-frame-for-room "elisp" "-25" "-58"))
|
|
336 (unwind-protect (progn
|
|
337 (make-frame-for-room "news" "-50" "-40")
|
|
338 ))
|
|
339 (unwind-protect (progn
|
|
340 (make-frame-for-room "mail" "-75" "-22")
|
|
341 ))
|
|
342 (unwind-protect (progn
|
|
343 (make-frame-for-room
|
|
344 "diary"
|
|
345 "-0"
|
|
346 (concat
|
|
347 "+"
|
|
348 (format
|
|
349 "%d"
|
|
350 (-
|
|
351 (cdr
|
|
352 (assoc
|
|
353 'top
|
|
354 (frame-parameters
|
|
355 (cdr
|
|
356 (assoc
|
|
357 "elisp"
|
|
358 frames-table)))))
|
|
359 18))))
|
|
360 ))
|
|
361 (make-frame-invisible scr))
|
|
362 (setq ht-default-config (current-window-configuration)))))
|
|
363 (setq sgml-insert-missing-element-comment nil)
|
|
364 (add-hook 'sgml-mode-hook 'sgml-fix-para)
|
|
365 ))
|
|
366 ;; v18 emacs only goes here
|
|
367 (progn
|
|
368 (require 'compress)
|
|
369 (defun ht-rooms-setup (&optional arg)
|
|
370 (interactive)
|
|
371 (require 'mail-extras)
|
|
372 (require 'diary)
|
|
373 (require 'my-news)
|
|
374 (load "ht-rooms.config" nil t)
|
|
375 (setq ht-default-config (current-window-configuration)))))
|
|
376
|
|
377 (defun sgml-fix-para ()
|
|
378 (setq paragraph-separate
|
|
379 "</[^>]*>\n\\([ \t]+\\| \\)")
|
|
380 (setq paragraph-start
|
|
381 "^[ \t]*</?[A-Za-z._-]+[ >]"))
|
|
382
|
|
383 (defun highlight-headers-ht-follow-url-netscape (url)
|
|
384 (message "Sending URL to Netscape...")
|
|
385 (save-excursion
|
|
386 (set-buffer (get-buffer-create "*Shell Command Output*"))
|
|
387 (erase-buffer)
|
|
388 (if (equal 0 (call-process "netscape" nil t nil "-display" ":0.0"
|
|
389 "-remote"
|
|
390 (concat "openURL(" url ")")))
|
|
391 ;; it worked
|
|
392 nil
|
|
393 ;; it didn't work, so start a new Netscape process.
|
|
394 (call-process "netscape" nil 0 nil url)))
|
|
395 (message "Sending URL to Netscape... done"))
|
|
396
|
|
397 (site-caseq (laptop (defun system-name () "francis.markup.co.uk")))
|
|
398
|
|
399 (cd (user-home-directory))
|
19
|
400
|
|
401 (defun ht-custom-size ()
|
|
402 (interactive)
|
|
403 (site-caseq ((laptop maritain)
|
|
404 (message (format "pw: %s" (device-pixel-width (selected-device))))))
|
|
405 (if (fboundp 'device-pixel-width)
|
|
406 (let ((pw (device-pixel-width (selected-device)))
|
|
407 (ph (device-pixel-height (selected-device))))
|
|
408 (cond ((= pw 2048)
|
|
409 ;; we're on a _really_ big external monitor
|
|
410 (set-frame-pixel-size (selected-frame) 900 1050)
|
|
411 (set-frame-position (selected-frame) 0 0))
|
21
|
412 ((= pw 1920)
|
|
413 ;; we're on a 27" curved external monitor
|
|
414 (set-frame-pixel-size (selected-frame) 720 980)
|
|
415 (set-frame-position (selected-frame) -8 2))
|
19
|
416 ((= pw 1680)
|
|
417 ;; we're on a big external monitor
|
|
418 (font-menu-set-font nil nil 10)
|
|
419 (set-frame-pixel-size (selected-frame) 900 1000)
|
|
420 (set-frame-position (selected-frame) -3 -20))
|
|
421 ((= pw 1097)
|
|
422 ;; we're on an XPS 13, mag. 300%
|
|
423 (require 'font-menu)
|
|
424 (font-menu-set-font nil nil 9)
|
|
425 (set-frame-pixel-size (selected-frame) 583 583); 80 x 39
|
|
426 (set-frame-position (selected-frame) -5 -26))
|
|
427 ((= pw 1536)
|
|
428 ;; we're on an XPS 13, mag. 250%
|
|
429 (require 'font-menu)
|
|
430 (font-menu-set-font nil nil 10)
|
|
431 (set-frame-pixel-size (selected-frame) 670 782); 81 x 49
|
|
432 (set-frame-position (selected-frame) -5 -26))
|
|
433 ((= ph 768)
|
|
434 ;; we're on a narrow cinema-ratio laptop
|
|
435 (set-frame-pixel-size (selected-frame) 690 710)
|
|
436 (set-frame-position (selected-frame) -5 -26))
|
|
437 ((= ph 900)
|
|
438 ;; we're on a cinema-ratio laptop
|
|
439 (set-frame-pixel-size (selected-frame) 800 820)
|
|
440 (set-frame-position (selected-frame) -3 -20))
|
|
441 ((= pw 1600)
|
|
442 ;; we're on a big external monitor
|
|
443 (set-frame-pixel-size (selected-frame) 900 1120)
|
|
444 (set-frame-position (selected-frame) -3 -20))
|
|
445 ((= pw 1280)
|
|
446 (cond ((= ph 720)
|
|
447 (set-frame-pixel-size (selected-frame) 700 655)
|
|
448 (set-frame-position (selected-frame) -3 -30))
|
|
449 (t
|
|
450 (set-frame-pixel-size (selected-frame) 700 960)
|
|
451 (set-frame-position (selected-frame) -3 -20))))))))
|
|
452
|
|
453 (ht-custom-size)
|
|
454
|
|
455 ;;; make dired list directories first
|
|
456 (defadvice dired-insert-directory (before my-dired-insert-directory
|
|
457 (dir-or-list switches &optional wildcard full-p))
|
|
458 (setq switches (concat switches " --group-directories-first")))
|
|
459
|
|
460 (ad-activate 'dired-insert-directory)
|