comparison pers-init.el @ 6:dccf9e53f179

*** empty log message ***
author ht
date Mon, 29 Aug 2005 08:51:09 +0100
parents
children b53b1f1f2d4a 0e4eb9db8a93
comparison
equal deleted inserted replaced
-1:000000000000 6:dccf9e53f179
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"))
186 (setq gnus-message-archive-method
187 '(nnfolder "archive"
188 (nnfolder-directory "/home/ht/MT/ht/mail/cpy")
189 (nnfolder-active-file "/home/ht/MT/ht/mail/cpy/active")
190 (nnfolder-get-new-mail nil)
191 (nnfolder-inhibit-expiry t)))
192 (load "gnus-init" nil t)
193
194 ; (require 'gnus-min)
195 ))
196
197 ;; (require 'idle)
198 ;; (idle-save 15)
199
200 (if (string-match "Lucid" emacs-version)
201 ;; lemacs only goes here
202 (progn
203 (setq bbdb-north-american-phone-numbers-p nil)
204 (setq bbdb-use-pop-up nil)
205 (require 'bbdb)
206 (add-hook 'rmail-mode-hook 'bbdb-insinuate-rmail)
207 (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
208 (add-hook 'mail-setup-hook 'bbdb-insinuate-sendmail)
209 (add-hook 'mail-setup-hook 'bbdb-define-all-aliases)
210 (add-hook 'gnus-message-setup-hook 'bbdb-define-all-aliases)
211
212
213
214 (if window-system
215 (progn
216 (require 'highlight-headers)
217 (defun rmail-fontify-headers ()
218 (highlight-headers (point-min) (point-max) t))
219 (add-hook 'rmail-show-message-hook 'rmail-fontify-headers)
220 (setq dired-mode-hook
221 '(lambda ()
222 (font-lock-mode 1)
223 (define-key dired-mode-map
224 [button2] '(lambda (click)
225 (interactive "e")
226 (mouse-set-point click)
227 (dired-advertised-find-file)))))
228 ;; (setq highlight-headers-follow-url-function
229 ;; 'highlight-headers-ht-follow-url-netscape
230 ;; browse-url-browser-function
231 ;;'highlight-headers-ht-follow-url-netscape)
232 ))
233 ;; (load "~rjc/public_html/device-type-hacking.el")
234 (load "perl-mode" nil t)
235 (defun ht-rooms-setup (&optional arg)
236 (interactive)
237 (require 'mail-extras)
238 (require 'diary)
239 (require 'my-news)
240 ;; override changed default, except in gnus
241 (setq mail-use-rfc822 nil)
242 (add-hook 'gnus-summary-mode-hook
243 (function (lambda ()
244 (make-local-variable 'mail-use-rfc822)
245 (setq mail-use-rfc822 t))))
246 (if (>= emacs-major-version 21)
247 (progn
248 (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
249 (add-hook 'gnus-startup-hook 'bbdb-insinuate-message)))
250 (defun ht-rooms-setup (&optional arg)
251 (interactive)
252 (require 'mail-extras)
253 (require 'diary)
254 (let ((scr (selected-frame)))
255 ; (sit-for 5)
256 (load "ht-rooms.config" nil t)
257 (unwind-protect (make-screen-for-room "diary" "0" "+62"))
258 ; (sit-for 5)
259 (unwind-protect (make-screen-for-room "elisp" "-25" "+79"))
260 ; (sit-for 5)
261 (unwind-protect (make-screen-for-room "news" "-50" "+96"))
262 ; (sit-for 5)
263 (unwind-protect (make-screen-for-room "mail" "-75" "+113"))
264 (sit-for 1)
265 (delete-screen scr))
266 (setq ht-default-config (current-window-configuration)))))
267 ;; vanilla v19 goes here
268 (if window-system
269 (progn
270 (defvar ht-frame-parameter-mods
271 '((auto-raise . t)
272 (auto-lower . nil)
273 (cursor-type . bar)))
274 (nconc
275 (site-caseq (laptop (list '(height . 35)))
276 (t
277 (list
278 '(font .
279 "-adobe-courier-medium-r-normal--14-*"))))
280 ht-frame-parameter-mods
281 )
282 ;; if we have X, we have ISO-Latin-1, so
283 ;; set char codes 128--255 to display as themselves.
284 (require 'disp-table)
285 (standard-display-8bit 161 255)
286 ; (transient-mark-mode t)
287 ;; hightlight searching in bold
288 (setq search-highlight t)
289 (make-face 'isearch)
290 (copy-face 'bold 'isearch)
291 ; (set-face-underline-p 'region t)
292 ; (set-face-background 'region "white")
293 ; (set-face-foreground 'region "black")
294 ; (setq c++-font-lock-keywords 'undef)
295 ; (setq c-font-lock-keywords 'undef)
296 (modify-frame-parameters
297 nil
298 ht-frame-parameter-mods)
299 (setq default-frame-alist
300 (append
301 ht-frame-parameter-mods default-frame-alist))
302 ;; fix cut and paste
303 (setq interprogram-paste-function nil
304 interprogram-cut-function nil)
305 (defun ht-mouse-set-region (click) "set region and primary selection"
306 (interactive "e")
307 (mouse-set-region click)
308 (x-set-selection "PRIMARY" (buffer-substring (point)(mark))))
309 (defun ht-mouse-drag-region (click)
310 "drag region and set primary selection"
311 (interactive "e")
312 (mouse-drag-region click)
313 (if mark-active
314 (x-set-selection "PRIMARY" (buffer-substring (point)(mark)))))
315 (global-set-key [drag-mouse-1] (function ht-mouse-set-region))
316 (global-set-key [down-mouse-1] (function ht-mouse-drag-region))
317 (defun ht-mouse-insert-primary (click)
318 "set point and insert primary selection"
319 (interactive "e")
320 (mouse-set-point click)
321 (push-mark nil nil t)
322 (insert (x-selection)))
323 (global-set-key [mouse-2] (function ht-mouse-insert-primary))
324 (setq dired-mode-hook
325 '(lambda ()
326 (font-lock-mode 1)
327 (define-key dired-mode-map
328 [mouse-2] '(lambda (click)
329 (interactive "e")
330 (mouse-set-point click)
331 (dired-advertised-find-file)))))
332
333 (defun ht-rooms-setup (&optional arg)
334 (interactive)
335 (require 'mail-extras)
336 (require 'diary)
337 (require 'my-news)
338 ;; override changed default, except in gnus
339 (setq mail-use-rfc822 nil)
340 (add-hook 'gnus-summary-mode-hook
341 (function (lambda ()
342 (make-local-variable 'mail-use-rfc822)
343 (setq mail-use-rfc822 t))))
344 (let ((scr (selected-frame)))
345 (load "ht-rooms.config" nil t)
346 (unwind-protect (make-frame-for-room "elisp" "-25" "-58"))
347 (unwind-protect (progn
348 (make-frame-for-room "news" "-50" "-40")
349 ))
350 (unwind-protect (progn
351 (make-frame-for-room "mail" "-75" "-22")
352 ))
353 (unwind-protect (progn
354 (make-frame-for-room
355 "diary"
356 "-0"
357 (concat
358 "+"
359 (format
360 "%d"
361 (-
362 (cdr
363 (assoc
364 'top
365 (frame-parameters
366 (cdr
367 (assoc
368 "elisp"
369 frames-table)))))
370 18))))
371 ))
372 (make-frame-invisible scr))
373 (setq ht-default-config (current-window-configuration)))))
374 (setq sgml-insert-missing-element-comment nil)
375 (add-hook 'sgml-mode-hook 'sgml-fix-para)
376 ))
377 ;; v18 emacs only goes here
378 (progn
379 (require 'compress)
380 (defun ht-rooms-setup (&optional arg)
381 (interactive)
382 (require 'mail-extras)
383 (require 'diary)
384 (require 'my-news)
385 (load "ht-rooms.config" nil t)
386 (setq ht-default-config (current-window-configuration)))))
387
388 (defun sgml-fix-para ()
389 (setq paragraph-separate
390 "</[^>]*>\n\\([ \t]+\\| \\)")
391 (setq paragraph-start
392 "^[ \t]*</?[A-Za-z._-]+[ >]"))
393
394 (defun highlight-headers-ht-follow-url-netscape (url)
395 (message "Sending URL to Netscape...")
396 (save-excursion
397 (set-buffer (get-buffer-create "*Shell Command Output*"))
398 (erase-buffer)
399 (if (equal 0 (call-process "netscape" nil t nil "-display" ":0.0"
400 "-remote"
401 (concat "openURL(" url ")")))
402 ;; it worked
403 nil
404 ;; it didn't work, so start a new Netscape process.
405 (call-process "netscape" nil 0 nil url)))
406 (message "Sending URL to Netscape... done"))
407
408 (site-caseq (laptop (defun system-name () "francis.markup.co.uk")))
409
410 (cd (user-home-directory))
411 (site-caseq (laptop (if (= (device-pixel-width (selected-device)) 1600)
412 ;; we're on a big external monitor
413 (progn
414 (set-frame-pixel-size (selected-frame) 900 1140)
415 (set-frame-position (selected-frame) -3 -20)))))