Mercurial > hg > lib > markup
comparison emacs/pers-init.el @ 1:f005daf4488a
local changes since 2007
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Tue, 25 May 2021 13:58:37 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:509549c55989 | 1:f005daf4488a |
---|---|
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 (concat "~/mail/cpy/general/" | |
12 (format-time-string | |
13 "%Y-%m" (current-time)) | |
14 ".mbox")) | |
15 | |
16 | |
17 (setq rmail-dont-reply-to-names "hthompso*\\|h\\.thompso*\\|ht@*" ) | |
18 (setq rmail-show-mime nil) | |
19 (set-default 'ht-last-file (expand-file-name "~/mail/")) | |
20 (setq ht-diary-file-name "~/mail/diary.babyl") | |
21 (setq mail-append-host "markup.co.uk") | |
22 (setq user-full-name "Henry S. Thompson") | |
23 (setq user-mail-address "ht@markup.co.uk") | |
24 (setq mail-host-address "markup.co.uk") | |
25 | |
26 ;; new mail hackery | |
27 (site-caseq ((edin ircs ldc) | |
28 (setq rmail-spool-directory (file-name-as-directory | |
29 (concat rmail-spool-directory | |
30 "ht-mail"))))) | |
31 ;; don't know why this is necessary | |
32 (site-caseq ((edin) | |
33 (setq rmail-primary-inbox-list | |
34 (list (concat rmail-spool-directory "ht"))))) | |
35 | |
36 (setq minibuffer-max-depth nil) | |
37 (defun run-kcl () | |
38 "Run an inferior kcl process" | |
39 (interactive) | |
40 (switch-to-buffer (make-shell "kcl" "kcl")) | |
41 (inferior-lisp-mode)) | |
42 | |
43 (require 'mdn-extras) | |
44 (setq auto-mode-alist | |
45 (append '(("/perl/" . perl-mode) | |
46 ("\\.scm$" . lisp-mode) | |
47 ("\\.dsl$" . lisp-mode)) | |
48 auto-mode-alist)) | |
49 (setq inferior-lisp-program "scheme") | |
50 ;;; for scheme | |
51 (put 'letrec 'lisp-indent-function 1) | |
52 (put 'case 'lisp-indent-function 1) | |
53 | |
54 (site-caseq (parc (nconc load-path '("/import/local/emacs/gnus-3.13/")) | |
55 (setq rmail-primary-inbox-list | |
56 '("~/mbox" "/net/piglet/usr/spool/mail/$USER")))) | |
57 | |
58 (defun run-sicstus () | |
59 "Run an inferior Prolog process, input and output via buffer *prolog*." | |
60 (interactive) | |
61 (if (not (boundp 'prolog-mode-map)) | |
62 (let ((load-path (cons | |
63 (site-caseq (parc "/import/prolog-1.8/emacs") | |
64 (edin "??")) | |
65 load-path))) | |
66 (load "prolog" nil t))) | |
67 (require 'shell) | |
68 (switch-to-buffer (make-shell "prolog" (site-caseq (edin "sicstus") | |
69 (parc "prolog")))) | |
70 (inferior-prolog-mode)) | |
71 | |
72 (site-caseq ((laptop markup iWeb)) | |
73 (t(require 'hist) | |
74 (rplacd (assoc "*shell*" hk-pat-table) | |
75 "[a-z]+<[0-9]+>: "))) | |
76 | |
77 ;; turn off suspend-emacs -- use pause-emacs (^X.) instead | |
78 (global-unset-key "\C-Z") | |
79 (global-unset-key "\C-x\C-z") | |
80 | |
81 (global-set-key "\C-xl" (function goto-line)) | |
82 | |
83 (require 'repl-comment) | |
84 | |
85 (require 'compress) | |
86 | |
87 (if (string-match "Lucid" emacs-version) | |
88 (site-caseq ((laptop markup iWeb)) | |
89 (t(require 'lemacs-compat)))) | |
90 | |
91 (if (boundp 'epoch::version) | |
92 ;; epoch only goes here | |
93 (progn | |
94 (if (string-match "4\\."emacs-version) | |
95 (load "motion4" nil t) | |
96 (load "motion" nil t)) | |
97 (redisplay-frame) | |
98 | |
99 (require 'alarm) | |
100 | |
101 (defun ht-rooms-setup (&optional arg) | |
102 (interactive) | |
103 (redisplay-frame) | |
104 (require 'mail-extras) | |
105 (require 'diary) | |
106 (require 'my-news) | |
107 (let ((scr (current-frame))) | |
108 (load "ht-rooms-epoch.config" nil t) | |
109 (unwind-protect (make-frame-for-room "diary" "-0" "+130")) | |
110 (unwind-protect (make-frame-for-room "elisp" "-25" "+148")) | |
111 (unwind-protect (make-frame-for-room "news" "-50" "+166")) | |
112 (unwind-protect (make-frame-for-room "mail" "-75" "+184")) | |
113 (epoch::delete-frame scr)) | |
114 ;; presumably this is now frame local, so not quite the right thing. | |
115 (setq ht-default-config (current-window-configuration))) | |
116 )) | |
117 (if (string-match "^\\(19\\|2\\)" emacs-version) | |
118 (progn | |
119 ;; common v19 | |
120 (if window-system | |
121 (progn | |
122 (add-hook 'sh-mode-hook '(lambda () | |
123 (font-lock-mode 1))) | |
124 (setq perl-mode-hook '(lambda () | |
125 (font-lock-mode 1))) | |
126 (setq emacs-lisp-mode-hook '(lambda () | |
127 (font-lock-mode 1))) | |
128 (setq lisp-mode-hook '(lambda () | |
129 (font-lock-mode 1))) | |
130 (setq sgml-mode-hook '(lambda () | |
131 (if (not | |
132 (boundp 'sgml-font-lock-keywords)) | |
133 (load "sgml-font-lock-keywords" t t)) | |
134 (setq adaptive-fill-mode nil) | |
135 (font-lock-mode 1) | |
136 )) | |
137 (setq c-mode-hook '(lambda () | |
138 (font-lock-mode 1))) | |
139 (setq c++-mode-hook '(lambda () | |
140 (font-lock-mode 1))) | |
141 (setq scheme-mode-hook | |
142 '(lambda () | |
143 (setq | |
144 scheme-font-lock-keywords | |
145 (if (or | |
146 (boundp 'lisp-font-lock-keywords) | |
147 (load "lisp-font-lock-keywords" t t)) | |
148 lisp-font-lock-keywords)) | |
149 (font-lock-mode 1))) | |
150 (setq python-mode-hook '(lambda () | |
151 (font-lock-mode 1))) | |
152 )) | |
153 | |
154 | |
155 (setq sgml-catalog-files '("catalog" "/home/ht/lib/sgml/catalog")) | |
156 | |
157 (if (string-match "Lucid" emacs-version) | |
158 ;; lemacs only goes here | |
159 (progn | |
160 (if (< emacs-major-version 21) | |
161 (setq load-path | |
162 (append '("/usr/contrib/lib/xemacs/site-lisp/xml" | |
163 "/usr/contrib/lib/xemacs/site-lisp/psgml") | |
164 load-path)) | |
165 (setq load-path (cons "/home/ht/lib/emacs/bbdb" load-path)) | |
166 (custom-set-variables '(bbdb-hashtable-size 24203)) | |
167 (setq bbdb-north-american-phone-numbers-p nil) | |
168 (setq bbdb-use-pop-up nil) | |
169 (setq bbdb-auto-revert-p t) | |
170 (require 'bbdb) | |
171 (add-hook 'rmail-mode-hook 'bbdb-insinuate-rmail) | |
172 (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus) | |
173 (add-hook 'mail-setup-hook 'bbdb-insinuate-sendmail) | |
174 (add-hook 'mail-setup-hook 'bbdb-define-all-aliases) | |
175 (add-hook 'gnus-message-setup-hook 'bbdb-define-all-aliases) | |
176 | |
177 (defun gnuserv-start-maybe () | |
178 (if (not (frame-live-p gnuserv-frame)) | |
179 (gnuserv-start))) | |
180 ;;; (require 'itimer) | |
181 ;;; (start-itimer "gsr" 'gnuserv-start-maybe | |
182 ;;; 1200 1200 nil nil) | |
183 ) | |
184 | |
185 (if window-system | |
186 (progn | |
187 (require 'highlight-headers) | |
188 (defun rmail-fontify-headers () | |
189 (highlight-headers (point-min) (point-max) t)) | |
190 (add-hook 'rmail-show-message-hook 'rmail-fontify-headers) | |
191 (setq dired-mode-hook | |
192 '(lambda () | |
193 (font-lock-mode 1) | |
194 (define-key dired-mode-map | |
195 [button2] '(lambda (click) | |
196 (interactive "e") | |
197 (mouse-set-point click) | |
198 (dired-advertised-find-file))))) | |
199 (setq highlight-headers-follow-url-function | |
200 'highlight-headers-ht-follow-url-netscape | |
201 browse-url-browser-function | |
202 'highlight-headers-ht-follow-url-netscape) | |
203 (defun fix-frame (frame) | |
204 ;; hack to fix x screen initialisation problem | |
205 (if (string-equal (device-name) "grogan-0-0") | |
206 (progn | |
207 (add-spec-to-specifier | |
208 (face-font font-lock-function-name-face) | |
209 [bold] | |
210 frame) | |
211 (add-spec-to-specifier | |
212 (face-font font-lock-comment-face) | |
213 [italic] | |
214 frame) | |
215 (add-spec-to-specifier | |
216 (face-font font-lock-doc-string-face) | |
217 [italic] | |
218 frame)))) | |
219 (fix-frame (window-frame)) | |
220 (add-hook 'create-frame-hook 'fix-frame))) | |
221 | |
222 ;; gnus | |
223 (setq nnml-directory (expand-file-name "~/mail/Mail")) | |
224 (setq gnus-secondary-select-methods | |
225 '((nnml "ht" | |
226 (gnus-show-threads nil) | |
227 (gnus-article-sort-functions | |
228 (gnus-article-sort-by-subject | |
229 gnus-article-sort-by-number))))) | |
230 (setq gnus-article-save-directory (expand-file-name "~/mail/Mail")) | |
231 (setq gnus-message-archive-method | |
232 `(nnfolder "archive" | |
233 (nnfolder-directory ,(expand-file-name | |
234 "~/mail/cpy")) | |
235 (nnfolder-active-file ,(expand-file-name | |
236 "~/mail/cpy/active")) | |
237 (nnfolder-get-new-mail nil) | |
238 (nnfolder-inhibit-expiry t))) | |
239 (load "gnus-init" nil t) | |
240 | |
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" "+47")) | |
259 ; (sit-for 5) | |
260 (unwind-protect (make-screen-for-room "elisp" "-25" "+64")) | |
261 ; (sit-for 5) | |
262 (unwind-protect (make-screen-for-room "news" "-50" "+81")) | |
263 ; (sit-for 5) | |
264 ; (unwind-protect (make-screen-for-room "mail" "-75" "+98")) | |
265 (sit-for 1) | |
266 (delete-frame 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 '((font . "-adobe-courier-medium-r-normal--14-*") | |
273 (auto-raise . t) | |
274 (auto-lower . nil) | |
275 (cursor-type . bar))) | |
276 ;; if we have X, we have ISO-Latin-1, so | |
277 ;; set char codes 128--255 to display as themselves. | |
278 (require 'disp-table) | |
279 (standard-display-8bit 161 255) | |
280 (transient-mark-mode t) | |
281 ;; hightlight searching in bold | |
282 (setq search-highlight t) | |
283 (make-face 'isearch) | |
284 (copy-face 'bold 'isearch) | |
285 (set-face-underline-p 'region t) | |
286 (set-face-background 'region "white") | |
287 (set-face-foreground 'region "black") | |
288 (setq c++-font-lock-keywords 'undef) | |
289 (setq c-font-lock-keywords 'undef) | |
290 (modify-frame-parameters | |
291 nil | |
292 ht-frame-parameter-mods) | |
293 (setq default-frame-alist | |
294 (append ht-frame-parameter-mods default-frame-alist)) | |
295 ;; fix cut and paste | |
296 (setq interprogram-paste-function nil | |
297 interprogram-cut-function nil) | |
298 (defun ht-mouse-set-region (click) "set region and primary selection" | |
299 (interactive "e") | |
300 (mouse-set-region click) | |
301 (x-set-selection "PRIMARY" (buffer-substring (point)(mark)))) | |
302 (defun ht-mouse-drag-region (click) | |
303 "drag region and set primary selection" | |
304 (interactive "e") | |
305 (mouse-drag-region click) | |
306 (if mark-active | |
307 (x-set-selection "PRIMARY" (buffer-substring (point)(mark))))) | |
308 (global-set-key [drag-mouse-1] (function ht-mouse-set-region)) | |
309 (global-set-key [down-mouse-1] (function ht-mouse-drag-region)) | |
310 (defun ht-mouse-insert-primary (click) | |
311 "set point and insert primary selection" | |
312 (interactive "e") | |
313 (mouse-set-point click) | |
314 (push-mark nil nil t) | |
315 (insert (x-selection))) | |
316 (global-set-key [mouse-2] (function ht-mouse-insert-primary)) | |
317 (setq dired-mode-hook | |
318 '(lambda () | |
319 (font-lock-mode 1) | |
320 (define-key dired-mode-map | |
321 [mouse-2] '(lambda (click) | |
322 (interactive "e") | |
323 (mouse-set-point click) | |
324 (dired-advertised-find-file))))) | |
325 | |
326 (defun ht-rooms-setup (&optional arg) | |
327 (interactive) | |
328 (require 'mail-extras) | |
329 (require 'diary) | |
330 (require 'my-news) | |
331 ;; override changed default, except in gnus | |
332 (setq mail-use-rfc822 nil) | |
333 (add-hook 'gnus-summary-mode-hook | |
334 (function (lambda () | |
335 (make-local-variable 'mail-use-rfc822) | |
336 (setq mail-use-rfc822 t)))) | |
337 (let ((scr (selected-frame))) | |
338 (load "ht-rooms.config" nil t) | |
339 (unwind-protect (make-frame-for-room "elisp" "-25" "-58")) | |
340 (unwind-protect (progn | |
341 (make-frame-for-room "news" "-50" "-40") | |
342 )) | |
343 (unwind-protect (progn | |
344 (make-frame-for-room "mail" "-75" "-22") | |
345 )) | |
346 (unwind-protect (progn | |
347 (make-frame-for-room | |
348 "diary" | |
349 "-0" | |
350 (concat | |
351 "+" | |
352 (format | |
353 "%d" | |
354 (- | |
355 (cdr | |
356 (assoc | |
357 'top | |
358 (frame-parameters | |
359 (cdr | |
360 (assoc | |
361 "elisp" | |
362 frames-table))))) | |
363 18)))) | |
364 )) | |
365 (make-frame-invisible scr)) | |
366 (setq ht-default-config (current-window-configuration)))))) | |
367 (setq sgml-insert-missing-element-comment nil) | |
368 (load "psgml" nil t) | |
369 (load "psgml-edit" nil t) | |
370 (load "xml-hack" nil t) | |
371 (add-hook 'sgml-mode-hook 'sgml-fix-para) | |
372 ) | |
373 ;; v18 emacs only goes here | |
374 (progn | |
375 (require 'compress) | |
376 (defun ht-rooms-setup (&optional arg) | |
377 (interactive) | |
378 (require 'mail-extras) | |
379 (require 'diary) | |
380 (require 'my-news) | |
381 (load "ht-rooms.config" nil t) | |
382 (setq ht-default-config (current-window-configuration))))) | |
383 | |
384 (defun sgml-fix-para () | |
385 (setq paragraph-separate | |
386 "</[^>]*>\n\\([ \t]+\\| \\)") | |
387 (setq paragraph-start | |
388 "^[ \t]*</?[A-Za-z._-]+[ >]")) | |
389 | |
390 (defun highlight-headers-ht-follow-url-netscape (url) | |
391 (message "Sending URL to Netscape...") | |
392 (save-excursion | |
393 (set-buffer (get-buffer-create "*Shell Command Output*")) | |
394 (erase-buffer) | |
395 (if (equal 0 (call-process "netscape" nil t nil "-display" ":0.0" | |
396 "-remote" | |
397 (concat "openURL(" url ")"))) | |
398 ;; it worked | |
399 nil | |
400 ;; it didn't work, so start a new Netscape process. | |
401 (call-process "netscape" nil 0 nil url))) | |
402 (message "Sending URL to Netscape... done")) | |
403 | |
404 (cd (user-home-directory)) | |
405 (provide 'pers-init) |