comparison shared/pers-init.el @ 1:6c73c7af9cdb

DICE versions, before pruning
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Mon, 08 Feb 2021 12:28:16 +0000
parents
children dd557432d846
comparison
equal deleted inserted replaced
0:107d592c5f4a 1:6c73c7af9cdb
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 ;;; HACK to deal with current x-crash workaround that I use a tty-launched
11 ;;; xemacs via gnuclient from an X environment
12 (if (and (eq
13 (device-type (frame-device (get-frame-for-buffer (current-buffer))))
14 'x)
15 (not (getenv "DISPLAY")))
16 (progn (message "setting DISPLAY in env")
17 (setenv "DISPLAY" ":0")))
18
19 ;;; mail stuff
20 (setq mail-archive-file-name (concat "/disk/scratch/mail/cpy/general/"
21 (format-time-string
22 "%Y-%m" (current-time))
23 ".mbox"))
24
25 (defun hand ()
26 (interactive)
27 (insert-file "~/pers/hand.txt"))
28
29 (setq rmail-dont-reply-to-names "hthompso*\\|h\\.thompso*\\|ht@*" )
30 (setq rmail-show-mime nil)
31 (set-default 'ht-last-file (expand-file-name "/disk/scratch/mail/"))
32 (setq ht-diary-file-name "/disk/scratch/mail/diary.babyl")
33 (setq mail-append-host "inf.ed.ac.uk")
34 (setq mail-host-address "inf.ed.ac.uk")
35
36 ;; new mail hackery
37 (site-caseq ((edin ircs ldc)
38 (setq rmail-spool-directory (file-name-as-directory
39 (concat rmail-spool-directory
40 "ht-mail")))))
41 ;; don't know why this is necessary
42 (site-caseq ((edin)
43 (setq rmail-primary-inbox-list
44 (list (concat rmail-spool-directory "ht")))))
45
46 (setq minibuffer-max-depth nil)
47 (defun run-kcl ()
48 "Run an inferior kcl process"
49 (interactive)
50 (switch-to-buffer (make-shell "kcl" "kcl"))
51 (inferior-lisp-mode))
52
53 (require 'mdn-extras)
54 (require 'passwd) ; for shell login for kerberos
55 (setq auto-mode-alist
56 (append '(("/perl/" . perl-mode)
57 ("\\.scm$" . lisp-mode)
58 ("\\.dsl$" . lisp-mode))
59 auto-mode-alist))
60 (setq inferior-lisp-program "scheme")
61 ;;; for scheme
62 (put 'letrec 'lisp-indent-function 1)
63 (put 'case 'lisp-indent-function 1)
64
65 (site-caseq (parc (nconc load-path '("/import/local/emacs/gnus-3.13/"))
66 (setq rmail-primary-inbox-list
67 '("~/mbox" "/net/piglet/usr/spool/mail/$USER"))))
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
83 (require 'hist)
84 (rplacd (assoc "*shell*" hk-pat-table)
85 "[a-z]+<[0-9]+>: ")
86
87 ;; turn off suspend-emacs -- use pause-emacs (^X.) instead
88 (global-unset-key "\C-Z")
89 (global-unset-key "\C-x\C-z")
90
91 (global-set-key "\C-xl" (function goto-line))
92
93 (require 'repl-comment)
94
95 (require 'compress)
96
97 (if (string-match "Lucid" emacs-version)
98 (progn
99 (require 'lemacs-compat)))
100
101 (if (boundp 'epoch::version)
102 ;; epoch only goes here
103 (progn
104 (if (string-match "4\\."emacs-version)
105 (load "motion4" nil t)
106 (load "motion" nil t))
107 (redisplay-frame)
108
109 (require 'alarm)
110
111 (defun ht-rooms-setup (&optional arg)
112 (interactive)
113 (redisplay-frame)
114 (require 'mail-extras)
115 (require 'diary)
116 (require 'my-news)
117 (let ((scr (current-frame)))
118 (load "ht-rooms-epoch.config" nil t)
119 (unwind-protect (make-frame-for-room "diary" "-0" "+130"))
120 (unwind-protect (make-frame-for-room "elisp" "-25" "+148"))
121 (unwind-protect (make-frame-for-room "news" "-50" "+166"))
122 (unwind-protect (make-frame-for-room "mail" "-75" "+184"))
123 (epoch::delete-frame scr))
124 ;; presumably this is now frame local, so not quite the right thing.
125 (setq ht-default-config (current-window-configuration)))
126 ))
127 (if (string-match "^\\(19\\|2\\)" emacs-version)
128 (progn
129 ;; common v19
130 (if window-system
131 (progn
132 (add-hook 'sh-mode-hook '(lambda ()
133 (font-lock-mode 1)))
134 (setq perl-mode-hook '(lambda ()
135 (font-lock-mode 1)))
136 (setq emacs-lisp-mode-hook '(lambda ()
137 (font-lock-mode 1)))
138 (setq lisp-mode-hook '(lambda ()
139 (font-lock-mode 1)))
140 (setq sgml-mode-hook '(lambda ()
141 (if (not
142 (boundp 'sgml-font-lock-keywords))
143 (load "sgml-font-lock-keywords" t t))
144 (font-lock-mode 1)
145 ))
146 (setq c-mode-hook '(lambda ()
147 (font-lock-mode 1)))
148 (setq c++-mode-hook '(lambda ()
149 (font-lock-mode 1)))
150 (setq scheme-mode-hook
151 '(lambda ()
152 (setq
153 scheme-font-lock-keywords
154 (if (or
155 (boundp 'lisp-font-lock-keywords)
156 (load "lisp-font-lock-keywords" t t))
157 lisp-font-lock-keywords))
158 (font-lock-mode 1)))
159 (setq python-mode-hook '(lambda ()
160 (font-lock-mode 1)))
161 ))
162
163
164 (setq sgml-catalog-files '("catalog" "/afs/inf.ed.ac.uk/user/h/ht/lib/sgml/catalog"))
165
166 (if (string-match "Lucid" emacs-version)
167 ;; lemacs only goes here
168 (progn
169 (if (< emacs-major-version 21)
170 (setq load-path
171 (append '("/usr/contrib/lib/xemacs/site-lisp/xml"
172 "/usr/contrib/lib/xemacs/site-lisp/psgml")
173 load-path))
174 ; (pui-add-install-directory
175 ; "/net/sunsite.doc.ic.ac.uk/public/pub/Mirrors/ftp.xemacs.org/pub/xemacs/packages")
176 ; (setq load-path (remove "/usr/contrib/lib/xemacs/xemacs-packages/lisp/gnus/" load-path))
177 ;; DICE comes here 2012-01-13
178 (setq package-get-remove-copy nil)
179 (setq bbdb-north-american-phone-numbers-p nil)
180 (setq bbdb-use-pop-up nil)
181 (setq bbdb-complete-name-allow-cycling t
182 bbdb-completion-type 'primary-or-name)
183 (setq bbdb-quiet-about-name-mismatches t)
184 (setq bbdb-always-add-addresses t)
185 (setq bbdb-new-nets-always-primary t)
186 (setq bbdb-file "/disk/scratch/mail/.bbdb")
187 (setq bbdb-hashtable-size 24203)
188 (require 'bbdb)
189 ;(require 'bbdb-rmail)
190 (require 'bbdb-com) ; to fix auto-fill
191 (fset 'bbdb-auto-fill-function (lambda () t)) ; ditto
192 (fmakunbound 'bbdb-orig-rmail-expunge)
193 ;(add-hook 'rmail-mode-hook 'bbdb-insinuate-rmail)
194 (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
195 (add-hook 'mail-setup-hook 'bbdb-insinuate-sendmail)
196 (add-hook 'mail-setup-hook 'bbdb-define-all-aliases)
197 (add-hook 'gnus-message-setup-hook 'bbdb-define-all-aliases)
198 (if (not (fboundp 'define-mail-abbrev))
199 ;; fix a bug which crashes occasionally -- see also
200 ;; bbdb-com
201 (progn
202 (require 'sendmail)
203 (defadvice sendmail-pre-abbrev-expand-hook
204 (before bbdb-rebuilt-all-aliases activate)
205 (bbdb-rebuilt-all-aliases))))
206 (defun gnuserv-start-maybe ()
207 (if (not (frame-live-p gnuserv-frame))
208 (gnuserv-start)))
209 ;;; (require 'itimer)
210 ;;; (start-itimer "gsr" 'gnuserv-start-maybe
211 ;;; 1200 1200 nil nil)
212 )
213
214 (if window-system
215 (progn
216 ;; DICE comes here 2012-01-13
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 'browse-url-firefox
231 ;;browse-url-browser-function
232 ;;'browse-url-mozilla
233 )
234 (setq browse-url-browser-function 'browse-url-firefox)
235 (set-face-background 'modeline '((x) . "lightgrey"))))
236 ;; DICE comes here 2012-01-13
237 (load "device-type-hacking" t t)
238 ;; (setq browse-url-mozilla-program "/usr/bin/X11/mozilla")
239
240 ;; gnus
241 (setq nnml-directory (expand-file-name "/disk/scratch/mail/Mail")
242 gnus-secondary-select-methods
243 '((nnml "ht"
244 (gnus-show-threads nil)
245 (gnus-article-sort-functions
246 (gnus-article-sort-by-subject
247 gnus-article-sort-by-date))))
248 gnus-home-directory "/disk/scratch/gnus" ; local disk
249 gnus-article-save-directory (expand-file-name "/disk/scratch/mail/Mail")
250 gnus-message-archive-method
251 `(nnfolder "archive"
252 (nnfolder-directory ,(expand-file-name
253 "/disk/scratch/mail/cpy"))
254 (nnfolder-active-file ,(expand-file-name
255 "/disk/scratch/cpy/active"))
256 (nnfolder-get-new-mail nil)
257 (nnfolder-inhibit-expiry t)))
258
259 (load "gnus-init" nil t)
260
261 ;; override changed default, except in gnus
262 (setq mail-use-rfc822 nil)
263 (add-hook 'gnus-summary-mode-hook
264 (function (lambda ()
265 (make-local-variable 'mail-use-rfc822)
266 (setq mail-use-rfc822 t))))
267 (if (>= emacs-major-version 21)
268 (progn
269 (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
270 (add-hook 'gnus-startup-hook 'bbdb-insinuate-message)))
271 ;; DICE comes here 2012-01-13
272 (defun ht-rooms-setup (&optional arg)
273 (interactive)
274 (require 'mail-extras)
275 (require 'diary)
276 (let ((scr (selected-frame)))
277 ; (sit-for 5)
278 (load "ht-rooms.config" nil t)
279 ; Formerly, for troutbeck
280 ; (unwind-protect (make-screen-for-room "diary" "0" "+60"))
281 ; ; (sit-for 5)
282 ; (unwind-protect (make-screen-for-room "elisp" "0" "+73"))
283 ; ; (sit-for 5)
284 ; (unwind-protect (make-screen-for-room "news" "-50" "+85"))
285 ;; for ecclerig
286 (unwind-protect (make-screen-for-room "diary" "+1888" "+0"))
287 ; (sit-for 5)
288 (unwind-protect (make-screen-for-room "elisp" "+1888" "+0"))
289 ; (sit-for 5)
290 (unwind-protect (make-screen-for-room "news" "+1223" "+0"))
291 ; (sit-for 5)
292 ; (unwind-protect (make-screen-for-room "mail" "-75" "+98"))
293 (sit-for 1)
294 (delete-frame scr))
295 (setq ht-default-config (current-window-configuration))))
296 ;; vanilla v19 goes here
297 (if window-system
298 (progn
299 (defvar ht-frame-parameter-mods
300 '((font . "-adobe-courier-medium-r-normal--14-*")
301 (auto-raise . t)
302 (auto-lower . nil)
303 (cursor-type . bar)))
304 ;; if we have X, we have ISO-Latin-1, so
305 ;; set char codes 128--255 to display as themselves.
306 (require 'disp-table)
307 (standard-display-8bit 161 255)
308 (transient-mark-mode t)
309 ;; hightlight searching in bold
310 (setq search-highlight t)
311 (make-face 'isearch)
312 (copy-face 'bold 'isearch)
313 (set-face-underline-p 'region t)
314 (set-face-background 'region "white")
315 (set-face-foreground 'region "black")
316 (setq c++-font-lock-keywords 'undef)
317 (setq c-font-lock-keywords 'undef)
318 (modify-frame-parameters
319 nil
320 ht-frame-parameter-mods)
321 (setq default-frame-alist
322 (append ht-frame-parameter-mods default-frame-alist))
323 ;; fix cut and paste
324 (setq interprogram-paste-function nil
325 interprogram-cut-function nil)
326 (defun ht-mouse-set-region (click) "set region and primary selection"
327 (interactive "e")
328 (mouse-set-region click)
329 (x-set-selection "PRIMARY" (buffer-substring (point)(mark))))
330 (defun ht-mouse-drag-region (click)
331 "drag region and set primary selection"
332 (interactive "e")
333 (mouse-drag-region click)
334 (if mark-active
335 (x-set-selection "PRIMARY" (buffer-substring (point)(mark)))))
336 (global-set-key [drag-mouse-1] (function ht-mouse-set-region))
337 (global-set-key [down-mouse-1] (function ht-mouse-drag-region))
338 (defun ht-mouse-insert-primary (click)
339 "set point and insert primary selection"
340 (interactive "e")
341 (mouse-set-point click)
342 (push-mark nil nil t)
343 (insert (x-selection)))
344 (global-set-key [mouse-2] (function ht-mouse-insert-primary))
345 (setq dired-mode-hook
346 '(lambda ()
347 (font-lock-mode 1)
348 (define-key dired-mode-map
349 [mouse-2] '(lambda (click)
350 (interactive "e")
351 (mouse-set-point click)
352 (dired-advertised-find-file)))))
353
354 (defun ht-rooms-setup (&optional arg)
355 (interactive)
356 (require 'mail-extras)
357 (require 'diary)
358 (require 'my-news)
359 ;; override changed default, except in gnus
360 (setq mail-use-rfc822 nil)
361 (add-hook 'gnus-summary-mode-hook
362 (function (lambda ()
363 (make-local-variable 'mail-use-rfc822)
364 (setq mail-use-rfc822 t))))
365 (let ((scr (selected-frame)))
366 (load "ht-rooms.config" nil t)
367 (unwind-protect (make-frame-for-room "elisp" "-25" "-58"))
368 (unwind-protect (progn
369 (make-frame-for-room "news" "-50" "-40")
370 ))
371 (unwind-protect (progn
372 (make-frame-for-room "mail" "-75" "-22")
373 ))
374 (unwind-protect (progn
375 (make-frame-for-room
376 "diary"
377 "-0"
378 (concat
379 "+"
380 (format
381 "%d"
382 (-
383 (cdr
384 (assoc
385 'top
386 (frame-parameters
387 (cdr
388 (assoc
389 "elisp"
390 frames-table)))))
391 18))))
392 ))
393 (make-frame-invisible scr))
394 (setq ht-default-config (current-window-configuration)))))
395 (setq load-path
396 (append '("/usr/contrib/lib/emacs/lisp/xml"
397 "/usr/contrib/lib/emacs/lisp/psgml")
398 load-path)))
399 (setq sgml-insert-missing-element-comment nil)
400 (load "psgml" nil t)
401 (load "psgml-edit" nil t)
402 (load "xml-hack" nil t)
403 (add-hook 'sgml-mode-hook 'sgml-fix-para)
404 )
405 ;; v18 emacs only goes here
406 (progn
407 (require 'compress)
408 (defun ht-rooms-setup (&optional arg)
409 (interactive)
410 (require 'mail-extras)
411 (require 'diary)
412 (require 'my-news)
413 (load "ht-rooms.config" nil t)
414 (setq ht-default-config (current-window-configuration)))))
415
416 (defun ht-rooms-resetup ()
417 (interactive)
418 (setq rooms-table nil)
419 (setq frames-table nil)
420 (ht-rooms-setup))
421
422 (defun sgml-fix-para ()
423 (setq paragraph-separate
424 "</[^>]*>\n\\([ \t]+\\| \\)")
425 (setq paragraph-start
426 "^[ \t]*</?[A-Za-z._-]+[ >]"))
427
428 (defun highlight-headers-ht-follow-url-netscape (url &optional arg)
429 (message "Sending URL to Netscape...")
430 (save-excursion
431 (set-buffer (get-buffer-create "*Shell Command Output*"))
432 (erase-buffer)
433 (if (equal 0 (call-process "netscape" nil t nil "-display" ":0.0"
434 "-remote"
435 (concat "openURL(" url ")")))
436 ;; it worked
437 nil
438 ;; it didn't work, so start a new Netscape process.
439 (call-process "netscape" nil 0 nil url)))
440 (message "Sending URL to Netscape... done"))
441
442 ;;; Moved from custom.el -- not customisable, I think. . .
443 (setq
444 ecb-options-version "2.27"
445 gnus-treat-display-smileys nil
446 gnus-treat-from-picon nil
447 gnus-treat-mail-picon nil
448 gnus-treat-newsgroups-picon nil
449 jde-enable-abbrev-mode t
450 package-get-require-signed-base-updates nil
451 pgg-passphrase-cache-expiry 36000
452 pui-package-install-dest-dir "/afs/inf.ed.ac.uk/user/h/ht/.xemacs/xemacs-packages"
453 efs-ftp-program-args '("-i" "-n" "-g" "-v")
454 efs-use-passive-mode t ; actually turns it _off_ !
455 )
456
457 ;;; The following duplicate settings in custom.el????
458 (custom-set-faces
459 '(font-lock-builtin-face ((((type x mswindows)(class color)(background light))(:foreground "Purple"))(((type tty)(class color))(:foreground "magenta"))))
460 '(font-lock-comment-face ((((type x mswindows)(class color)(background light))(:foreground "blue4"))(((type tty)(class color))(:foreground "blue"))))
461 '(font-lock-constant-face ((((type x mswindows)(class color)(background light))(:foreground "CadetBlue"))(((type tty)(class color))(:foreground "cyan"))))
462 '(font-lock-doc-string-face ((((type x mswindows)(class color)(background light))(:foreground "green4"))(((type tty)(class color))(:foreground "green"))))
463 '(font-lock-function-name-face ((((type x mswindows)(class color)(background light))(:foreground "brown4"))(((type tty)(class color))(:foreground "cyan" :bold))))
464 '(font-lock-keyword-face ((((type x mswindows)(class color)(background light))(:foreground "red4"))(((type tty)(class color))(:foreground "red" :bold))))
465 '(font-lock-preprocessor-face ((((type x mswindows)(class color)(background light))(:foreground "blue3"))(((type tty)(class color))(:foreground "cyan" :bold))))
466 '(font-lock-reference-face ((((type x mswindows)(class color)(background light))(:foreground "red3"))(((type tty)(class color))(:foreground "red"))))
467 '(font-lock-string-face ((((type x mswindows)(class color)(background light))(:foreground "green4"))(((type tty)(class color))(:foreground "green" :bold))))
468 '(font-lock-type-face ((((type x mswindows)(class color)(background light))(:foreground "steelblue"))(((type tty)(class color))(:foreground "cyan" :bold))))
469 '(font-lock-variable-name-face ((((type x mswindows)(class color)(background light))(:foreground "magenta4"))(((type tty)(class color))(:foreground "magenta" :bold))))
470 '(font-lock-warning-face ((((type x mswindows)(class color)(background light))(:foreground "Red" :bold))(((type tty)(class color))(:foreground "red" :bold))))
471 )
472
473 (custom-set-faces
474 '(modeline (
475 (((type x mswindows)(class color))
476 (:foreground "black" :background "gray80"))
477 (t
478 (:foreground "black" :background "white"))))
479 '(modeline-buffer-id (
480 (((type x mswindows)(class color))
481 (:foreground "blue4" :background "gray80"))
482 (((type tty)(class color))
483 (:foreground "blue" :background "white"))
484 (t
485 (:foreground "black" :background "white" :bold t))))
486 '(modeline-mousable (
487 (((type x mswindows)(class color))
488 (:foreground "firebrick" :background "gray80"))
489 (((type tty)(class color))
490 (:foreground "red" :background "white"))
491 (t
492 (:foreground "black" :background "white"))))
493 '(modeline-mousable-minor-mode (
494 (((type x mswindows)(class color))
495 (:foreground "green4" :background "gray80"))
496 (((type tty)(class color))
497 (:foreground "green" :background "white" :bold t))
498 (t
499 (:foreground "black" :background "white"))))
500 )
501
502 (defalias 'review (read-kbd-macro
503 "PhD SPC applicant SPC review, SPC please 4*<C-n> M-x insert- f SPC RET bus/ilc SPC new SPC RET 9*<C-n> C-e"))