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