annotate emacs/pers-init.el @ 13:1cd5c7952aaa default tip

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