chiark / gitweb /
sh mode do not electric <<
[ian-dotfiles.git] / home / emacs / ian.el
1 ; This is my real emacs start-up file (for chiark).
2
3
4 (defalias 'perl-mode 'cperl-mode)
5 (setq cperl-invalid-face nil
6       cperl-indent-level 4
7       cperl-continued-statement-offset 4)
8
9 (make-variable-buffer-local 'indent-line-function)
10 ; Un-disable narrow and eval-expression
11 (put 'narrow-to-region 'disabled nil)
12 (put 'eval-expression 'disabled nil)
13 (standard-display-european t)
14 ;
15 (setq browse-url-netscape-program "mozilla")
16 (setq common-lisp-hyperspec-root "/usr/share/doc/hyperspec/")
17 ;
18 ; Make sure we don't disturb links or change ownership, use numbers
19 (setq backup-by-copying-when-mismatch t)
20 (setq backup-by-copying-when-linked t)
21 ;(setq version-control t
22 ;      kept-new-versions 4
23 ;      kept-old-versions 4
24 ;      trim-versions-without-asking t)
25 ;
26 ; Various one-liners
27 (setq require-final-newline "ask")
28 (if (string= window-system 'x) (load-library "ian-x"))
29 (load-library "ian-aliases")
30 ; (load-library "auto-pgp")
31 ; (load-library "debian-changelog-mode")
32 ; (if (string= (getenv "TERM") "bbcb32") (setq term-file-prefix nil))
33 ; (setq explicit-shell-file-name "/usr/local/bin/tcsh")
34 (setq inhibit-local-variables t)
35 (setq enable-local-variables 'ask-me)
36 (setq enable-recursive-minibuffers t)
37 (setq compile-command "make")
38 (setq next-line-add-newlines t)
39 (setq diff-switches "-u")
40 (setq line-move-visual nil)
41 (display-time)
42 ;
43 (set-variable 'search-repeat-char 28)
44 (set-fringe-mode (cons 0 nil))
45 (if (string-match "^19\." emacs-version)
46     (progn
47 ;      (setq file-name-handler-alist     ; Disable nasty auto-loading of ange-ftp
48 ;            (delq (rassq 'ange-ftp-completion-hook-function file-name-handler-alist)
49 ;                  file-name-handler-alist))
50       (require 'find-alternate-18style)
51       (defun unset-down-mouse-23 ()
52         (local-set-key [mouse-2] 'mouse-yank-at-click)
53         (local-unset-key [down-mouse-2])
54         (local-unset-key [down-mouse-3])
55         (local-unset-key [C-down-mouse-3]))
56       (add-hook 'vm-mode-hook 'unset-down-mouse-23)
57       (add-hook 'vm-mail-mode-hook 'unset-down-mouse-23)
58       (add-hook 'text-mode-hook 'unset-down-mouse-23)
59       (add-hook 'Info-mode-hook
60                 (function (lambda ()
61                             (local-set-key " " 'scroll-up)
62                             (local-set-key "\7f" 'scroll-down))))
63       (add-hook 'sh-mode-hook
64                 (function (lambda ()
65                             (local-set-key "<" 'self-insert-command))))
66       (define-key isearch-mode-map "\1c" 'isearch-repeat-forward)
67       (define-key isearch-mode-map "\1d" 'isearch-quote-char)))
68 ;
69 (menu-bar-mode -1)
70 (defun terminal-keybindings ()
71   "This function should be called by the term-setup-hook mechanism"
72   (interactive)
73   ; Set my own keybindings
74   ;
75   ; Set keybindings generally (including I-search on C-\)
76 ;  (global-set-key "    " 'self-insert-command)
77   (global-set-key "\1c" 'isearch-forward)
78 ;  (global-set-key "\r" 'newline)
79   (global-set-key "\ f" 'set-mark-command)
80   (global-set-key "\1d" 'quoted-insert)
81   ;
82   ; Set keybindings on esc-map
83   (global-set-key "\e#" 'query-replace-regexp)
84   (global-set-key "\e+" 'toggle-truncate-lines)
85   (global-set-key "\eg" 'goto-line)
86   (global-set-key "\es" 'isearch-forward-regexp)
87   (global-set-key "\e\e" 'eval-expression)
88   ;
89   ; Set keybindings on ^X-map.
90   (global-set-key "\18m" 'vm-mail)
91   (global-set-key "\18\1c" 'save-buffer)
92   (global-set-key "\18\1d" 'toggle-read-only)
93   (global-set-key "\18#" 'recover-file)
94   (global-set-key "\18\12" 'bury-buffer)
95   (global-set-key "\18\v" 'quicker-compile)
96   (global-set-key "\18\18" 'exchange-point-and-mark)
97   (global-set-key "\18\1a" 'load-tramp)
98   (global-set-key "\184\16" 'scroll-other-window)
99   (global-set-key "\184m" 'vm-mail-other-window)
100   (global-set-key "\189" 'vm-visit-folder)
101   (global-set-key "\188" 'rmail-input)
102   (global-set-key "\18p" 'cite-region)
103   (global-set-key "\18F" 'mail-formletter)
104   ;
105   ; Set keybindings for Sun numeric pad.
106   (setq esc-bracket-map (make-keymap))
107   (define-key esc-bracket-map "D" 'backward-char)
108   (define-key esc-bracket-map "C" 'forward-char)
109   (define-key esc-bracket-map "A" 'previous-line)
110   (define-key esc-bracket-map "B" 'next-line)
111   (define-key esc-map "[" esc-bracket-map)
112   (global-set-key "\e[214z" 'beginning-of-buffer)
113   (global-set-key "\e[220z" 'end-of-buffer)
114   (global-set-key "\e[216z" 'scroll-down)
115   (global-set-key "\e[222z" 'scroll-up)
116   (global-set-key "\e[192z" 'save-buffer)
117   (global-set-key "\e[194z" 'save-some-buffers)
118   (global-set-key "\e[195z" 'undo)
119   (global-set-key "\e[193z" 'call-last-kbd-macro)
120   (global-set-key "\e[196z" 'switch-to-buffer-other-window)
121   (global-set-key "\e[197z" 'copy-region-as-kill)
122   (global-set-key "\e[198z" 'find-file)
123   (global-set-key "\e[199z" 'yank)
124   (global-set-key "\e[198z" 'find-alternate-file)
125   (global-set-key "\e[200z" 'find-file)
126   (global-set-key "\e[201z" 'kill-region)
127   (global-set-key "\e[-1z" 'info)
128   ;
129   ; Set keybindings for Chiarks' x11emacs
130   (global-set-key "\e[5~" 'scroll-down)
131   (global-set-key "\e[6~" 'scroll-up)
132   ;
133   ; Set keybindings for knackered vt100-like terminal emulators.
134   (global-set-key "\eOt" 'scroll-down)
135   (global-set-key "\eOu" 'scroll-up)
136   (global-set-key "\eOD" 'backward-char)
137   (global-set-key "\eOC" 'forward-char)
138   (global-set-key "\eOA" 'previous-line)
139   (global-set-key "\eOB" 'next-line))
140 (setq term-setup-hook 'terminal-keybindings)     ; remap keys in due course
141 ;
142 ; Autoload definitions
143 (autoload 'tar-mode "tar-mode")
144 (autoload 'uncompress-while-visiting "uncompress")
145 ; (autoload 'c++-mode "c++-mode" "Mode for editing C and C++ programs" t)
146 (autoload 'hide-ifdef-mode "hideif" "For editing code with #ifdefs" t)
147 ;(setq-default indent-tabs-mode nil)
148 (autoload 'dired-find-alternate-file "dired-alternate" "Find alternately" t)
149 (autoload 'dired-run-file "dired-alternate" "Run this file" t)
150 (autoload 'perl-mode "perl-mode" "Mode for Perl code" t)
151 ; (autoload 'rmail "rmail-fixed" "Patched mail reader" t)
152 (autoload 'quicker-compile "quicker-compile" "Patched Compile mode" t)
153
154 (autoload 'vm "vm" "Start VM on your primary inbox." t)
155 (autoload 'vm-visit-folder "vm" "Start VM on an arbitrary folder." t)
156 (autoload 'vm-visit-virtual-folder "vm" "Visit a VM virtual folder." t)
157 (autoload 'vm-mode "vm" "Run VM major mode on a buffer" t)
158 (autoload 'vm-mail "vm" "Send a mail message using VM." t)
159 (autoload 'vm-submit-bug-report "vm" "Send a bug report about VM." t)
160 ;
161 ; (autoload 'info "info-fixed" "Patched info browser" t)
162 (setq shell-mode-hook
163       '(lambda ()
164          (make-variable-buffer-local 'scroll-step)
165          (setq scroll-step 1)))
166 (setq inferior-lisp-program "sbcl")
167 ;(setq jit-lock-chunk-size 100
168 ;      jit-lock-stealth-time 1.00)
169 (setq dired-mode-hook
170       '(lambda ()
171          (define-key dired-mode-map "F" 'dired-find-alternate-file)
172          (define-key dired-mode-map "X" 'dired-run-file)))
173 ;
174 ; Prevent loading of default init file and do some of the things it did
175 ; (setq inhibit-default-init t)
176 ;
177 ; Additional alist handling function
178 ;(defun alist-remove-elem (s s-list)
179 ;  "Delete the element of the alist S-LIST whose car is S"
180 ;  (if s-list (if (equal s (car (car s-list)))
181 ;                (cdr s-list)
182 ;              (cons (car s-list) (alist-remove-elem s (cdr s-list))))
183 ;    (nil)))
184 ;
185 ; Load C++ mode and edit Perl in perl mode
186 (setq auto-mode-alist
187       (append '(("\\.[ch]$" . c-mode)
188                 ("\\.[CH]$" . c++-mode)
189                 ("\\.cc$" . c++-mode)
190                 ("\\.hh$" . c++-mode)
191 ;                ("\\.tar$" . tar-mode)
192                 ("\\.pl$" . perl-mode)
193                 ("\\.ci$" . tex-mode)
194                 ("\\.asm$" . fundamental-mode)
195                 ("\\.Z$" . uncompress-while-visiting))
196               auto-mode-alist))
197 (setq interpreter-mode-alist
198       (append '(("sh" . fundamental-mode)
199                 ("bash" . fundamental-mode))
200               interpreter-mode-alist))
201 ;
202 ; Use auto-fill when editing text
203 (add-hook 'text-mode-hook '(lambda () (auto-fill-mode 1)))
204 ; (add-hook 'text-mode-hook '(lambda () (local-set-key "        " 'self-insert-command)))
205 ;
206 ; Set up newline to auto-indent & other stuff for perl, c++ and c modes.
207 (setq perl-mode-hook '(lambda () 
208                         (local-set-key ";" 'self-insert-command)))
209 (setq c++-mode-hook '(lambda ()
210                        (hide-ifdef-mode 1)
211                        (local-set-key "," 'self-insert-command)
212                        (local-set-key ":" 'electric-c++-terminator)))
213 ; c++-electric-colon
214 (setq c-mode-hook '(lambda ()
215                      (hide-ifdef-mode 1)
216                      (c-set-offset 'substatement-open 0 nil)
217                      (local-set-key "," 'self-insert-command)
218                      (local-set-key ";" 'self-insert-command)
219                      (local-set-key "/" 'self-insert-command)
220                      (local-set-key "*" 'self-insert-command)
221                      (local-set-key "#" 'self-insert-command)
222                      (local-set-key "(" 'self-insert-command)
223                      (local-set-key ")" 'self-insert-command)
224                      (local-set-key "{" 'self-insert-command)
225                      (local-set-key "\r" 'newline-and-indent)))
226 (setq c-hanging-comment-ender-p nil)
227 ;
228 (defun vm-mail-other-window ()
229   "Like `vm-mail' command, but display buffer in another window."
230   (interactive)
231   (switch-to-buffer-other-window (current-buffer))
232   (vm-mail))
233 ;
234 ; mail precedences
235 (setq mail-precedence-key-alist
236       '((?0  . "special-delivery")
237         (?1  . "air-mail")
238         (?2  . "first-class")
239         (?3  . "second-class")
240         (?5  . "third-class")
241         (?\  . nil)
242         (?6  . "bulk")
243         (?9  . "junk")))
244 ;
245 (defun mail-precedence-as-key ()
246   "Set precedence by looking up last command char in mail-precedence-key-alist"
247   (interactive)
248   (message "%s" (concat "Precedence ["
249                         (mapconcat '(lambda (c) (char-to-string (car c)))
250                                    mail-precedence-key-alist "")
251                         "] ?"))
252   (let* ((key (read-char))
253          (prec (assoc key mail-precedence-key-alist)))
254     (if prec (mail-precedence (cdr prec))
255       (error "mail-precedence-as-key `%s' not found" key))))
256 ;
257 (defun mail-precedence-as-key-send-and-exit (arg)
258   "Set precedence by looking up last command char in mail-precedence-key-alist,
259 then call send-and-exit."
260   (interactive "P")
261   (mail-precedence-as-key)
262   (execute-kbd-macro "\ 3\ 3"))
263 ;
264 (defun mail-precedence (prec)
265   (save-excursion
266     (mail-position-on-field "Precedence")
267     (let ((p (point)))
268       (beginning-of-line)
269       (delete-region (point) p)
270       (if prec
271           (insert "Precedence: " prec)
272         (delete-char 1)))))
273 ;
274 (defun mail-mode-setup-keys ()
275   (local-set-key "\ 3\10" 'mail-precedence-as-key)
276   (local-set-key "\ 3p" 'mail-precedence-as-key-send-and-exit))
277 (add-hook 'mail-mode-hook 'mail-mode-setup-keys)
278 (add-hook 'vm-mail-mode-hook 'mail-mode-setup-keys)
279 ;
280 (defun vm-mail-other-window ()
281   "Like `vm-mail' command, but display buffer in another window."
282   (interactive)
283   (switch-to-buffer-other-window (current-buffer))
284   (vm-mail))
285 ;
286 (defun mail-formletter ()
287   "Run VM-mail with ,Formletter"
288   (interactive)
289   (vm-mail)
290   (rename-buffer (generate-new-buffer-name "form letter") t)
291   (delete-region (point-min) (point-max))
292   (insert-file (concat vm-folder-directory ",Formletter")))
293 ;
294 ; This function bound to C-x C-z
295 (defun load-tramp ()
296   "Load tramp using require, if it isn't loaded already"
297   (interactive)
298   (message "Loading tramp...")
299   (require 'tramp) ; -extended
300   (message "Loading tramp...done"))
301 ;
302 ; This function bound to M-+
303 (defun toggle-truncate-lines ()
304   "Toggle truncation or folding of long lines"
305   (interactive)
306   (set-variable 'truncate-lines (not truncate-lines))
307   (redraw-display))
308 ;
309 ; RMAIL stuff
310 ;(setq rmail-file-name "~/mail/RMAIL"
311 ;      mail-archive-file-name "~/mail/Outbound"
312 ;      rmail-primary-inbox-list '("~/mbox" "~/mail/Outbound" "~/mail/Record"
313 ;                                 "~/mail/Import" "/var/spool/mail/ian")
314 ;      rmail-delete-after-output t
315 ;      rmail-last-rmail-file ""
316 ;      rmail-ignored-headers (concat
317 ;                             "^Content-Identifier:\\|^X400-[^O][A-Za-z-]+:\\|"
318 ;                             rmail-ignored-headers))
319 ;
320 (defun make-regexps-ignore-non-address (list)
321   (apply 'append (mapcar
322                   '(lambda (item)
323                      (let ((item (mapconcat
324                                   '(lambda (ch)
325                                      (let ((s (char-to-string ch)))
326                                        (if (string-match "[][.*+?^$\\]" s)
327                                            (concat "\\" s)
328                                          s)))
329                                   item "")))
330                        (list
331                         (concat "<" item ">")
332                         (concat "^" item " *\\((.*)\\)?$"))))
333                   list)))
334 ;
335 ; BBDB
336 (setq bbdb-north-american-phone-numbers-p nil
337       bbdb/mail-auto-create-p t
338       bbdb-auto-revert-p t
339       bbdb-notice-auto-save-file-p t
340       bbdb-message-caching-enabled t)      
341 ;
342 ; VM stuff
343 ;(load-file "~/private/private.el")
344 (if (file-exists-p "~/private/private2.el")
345   (load-file "~/private/private2.el"))
346 (setq vm-included-text-attribution-format "%F writes (\"%s\"):\n"
347       vm-reply-subject-prefix "Re: "
348       vm-folder-directory "~/mail/"
349       vm-delete-after-saving t
350       vm-delete-empty-folders t
351       vm-mutable-windows t
352       vm-auto-get-new-mail nil
353       vm-auto-next-message nil
354       vm-jump-to-new-messages nil
355       vm-jump-to-unread-messages nil
356       vm-mime-digest-discard-header-regexp "only-drop-this-header"
357       vm-preview-lines nil
358       vm-included-text-prefix "> "
359       vm-confirm-quit 1
360       vm-auto-center-summary t
361       vm-confirm-new-folders t
362       vm-circular-folders nil
363       vm-visit-when-saving 0
364       vm-move-after-deleting t
365       vm-keep-sent-messages t
366       vm-follow-summary-cursor t
367       vm-frame-per-composition nil
368       vm-frame-per-edit nil
369       vm-frame-per-summary nil
370       vm-frame-per-folder nil
371       vm-tale-is-an-idiot t
372       vm-primary-inbox (concat vm-folder-directory "INBOX")
373       vm-sinbin-inbox (concat vm-folder-directory "SINBOX")
374       vm-uninteresting-senders "ian"
375       vm-reply-ignored-addresses
376       (make-regexps-ignore-non-address
377        '("ian@chiark.chu.cam.ac.uk" "ian" "iwj10@cus.cam.ac.uk"
378          "ian@chiark.greenend.org.uk"
379          "ijackson@nyx.cs.du.edu" "ijackson@gnu.ai.mit.edu"))
380       vm-primary-inbox (concat vm-folder-directory "INBOX")
381
382       vm-uninteresting-senders "ian"
383       vm-reply-ignored-addresses
384       (make-regexps-ignore-non-address
385        '("ijackson@chiark.chu.cam.ac.uk" "ijackson"
386          "iwj10@thor.cam.ac.uk" "iwj10@hermes.cam.ac.uk" "iwj10@cl.cam.ac.uk"
387          "iwj10@cam.ac.uk" "Ian.Jackson@cl.cam.ac.uk"))
388       mail-archive-file-name "~/mail/Outbound"
389
390
391       vm-spool-files
392       '((vm-primary-inbox "/var/spool/mail/ian"
393                           "~/mail/INBOX.CRASH")
394         (vm-primary-inbox "~/News/r" "~/mail/INBOX.CRASH")
395         (vm-primary-inbox "~/mbox" "~/mail/INBOX.CRASH")
396         (vm-primary-inbox "~/mail/Outbound" "~/mail/INBOX.CRASH")
397         (vm-primary-inbox "~/mail/Import" "~/mail/INBOX.CRASH")
398         (vm-primary-inbox "~/mail/Record" "~/mail/INBOX.CRASH")
399         (vm-sinbin-inbox "/var/spool/mail/ian" "~/mail/SINBOX.CRASH"))
400       vm-startup-with-summary t
401
402       user-mail-address "ijackson@chiark.greenend.org.uk"
403
404
405 ;      vm-spool-files
406 ;      (list
407 ;       (list vm-primary-inbox "~/mbox" "~/mail/INBOX.CRASH")
408 ;       (list vm-primary-inbox "~/mail/Outbound" "~/mail/INBOX.CRASH")
409 ;       (list vm-primary-inbox "~/mail/Record" "~/mail/INBOX.CRASH")
410 ;       (list vm-primary-inbox "~/mail/Import" "~/mail/INBOX.CRASH")
411 ;       (list vm-primary-inbox "/var/spool/mail/ian" "~/mail/INBOX.CRASH")
412 ;       (list vm-primary-inbox "~/News/r" "~/mail/INBOX.CRASH")
413 ;       (list vm-sysadmin-inbox "~/mbox" "~/mail/SINBOX.CRASH")
414 ;       (list vm-sysadmin-inbox "~/mail/SOutbound" "~/mail/SINBOX.CRASH")
415 ;       (list vm-sysadmin-inbox "~/mail/Import" "~/mail/SINBOX.CRASH")
416 ;       (list vm-sysadmin-inbox "/var/spool/mail/sysadmin" "~/mail/SINBOX.CRASH")
417 ; (list "/u/ijackson/mail/INBOX" "/u/ijackson/mbox" "/u/ijackson/mail/INBOX.CRASH")
418 ; (list "/u/ijackson/mail/INBOX" "/u/ijackson/mail/Outbound"
419 ;       "/u/ijackson/mail/INBOX.CRASH")
420 ; (list "/u/ijackson/mail/INBOX" "/u/ijackson/mail/Record" "/u/ijackson/mail/INBOX.CRASH")
421 ; (list "/u/ijackson/mail/INBOX" "/u/ijackson/mail/Import" "/u/ijackson/mail/INBOX.CRASH")
422 ;        (list "/u/ijackson/mail/INBOX"
423 ;         (concat "localhost:110:pass:ijackson:" ijackson-pop-password)
424 ;         "/u/ijackson/mail/INBOX.CRASH"))
425       vm-startup-with-summary nil
426       vm-summary-format "%3n %a %2d %3m  %-19.19F  %s\n"
427       mail-archive-file-name "~/mail/Outbound"
428       vm-mime-8bit-text-transfer-encoding '8bit)
429 ;
430 (add-hook 'vm-mode-hook
431           '(lambda ()
432              (local-set-key "Q" 'vm-quit)
433              (local-set-key "q" "###Q")))
434 (add-hook 'mail-mode-hook
435           '(lambda ()
436              (if (and (boundp 'folder-buffer)
437                       folder-buffer
438                       (string= (buffer-file-name folder-buffer)
439                                (file-truename vm-sysadmin-inbox)))
440                  (progn
441                    (make-local-variable 'vm-mail-header-from)
442                    (setq vm-mail-header-from
443                          "sysadmin@chiark.greenend.org.uk (Ian Jackson)")
444                    (make-local-variable 'mail-archive-file-name)
445                    (setq mail-archive-file-name
446                          "~/mail/SOutbound")))))
447 ;
448 ;(defun vmi ()
449 ;  (interactive)
450 ;  (vm "/u/ijackson/mail/INBOX"))
451 ;;
452 (defun vms ()
453   (interactive)
454   (vm vm-sinbin-inbox))
455 ;
456 (defun make-session ()
457   "Makes this emacs hard to kill by requiring ^X^Cy to kill it
458 instead of just ^X^C."
459   (interactive)
460   (global-unset-key "\18\ 3")
461   (global-set-key "\18\ 3y" 'save-buffers-kill-emacs))
462 ;
463 ; Fix problems with M-| setting window title of emacs' parent xterm
464 (defun envdelete-term-termcap-windowid (list)
465   (let ((l list))
466     (mapcar '(lambda (x)
467                (if x (delq x l)))
468             (mapcar '(lambda (x)
469                        (if (or (string-match "^TERM=" x)
470                                (string-match "^TERMCAP=" x)
471                                (string-match "^WINDOWID=" x))
472                            x
473                          nil))
474                     l))
475     l))
476 (setq process-environment
477       (envdelete-term-termcap-windowid process-environment))
478 ;
479 (defun add-insertion-keys (table)
480   "Adds keybindings according to TABLE.  Each element of
481 TABLE should be a four-element list.
482
483 BINDING should be the key to bind; FUNCTION will be the name of the
484 function defined to do the insertion; DESCRIPTION will be inserted
485 into \"Inserts ... .\", and used as the descriptive string for the
486 generated function; STRING is the string which will actually be
487 inserted into the buffer when the keystroke is pressed."
488   (while table
489     (let* ((head (car table))
490            (key (car head))
491            (func (nth 1 head))
492            (desc (nth 2 head))
493            (string (nth 3 head)))
494       (defalias func
495         (list
496          'lambda () 
497          (concat "Inserts " desc ".")
498          '(interactive)
499          (list 'insert string)))
500       (funcall 'local-set-key key func))
501     (setq table (cdr table))))
502
503 (defun ian-sgml-setup ()
504   (interactive)
505   (add-insertion-keys
506    '(("\ 3\r" sgml-insert-new-para "new paragraph markup" "\n<p>\n")
507      ("\ 3\14" sgml-insert-tt-emph "tt emph markup" "<tt/")
508      ("\ 3\10" sgml-insert-prgn-emph "prgn emph markup" "<prgn/")
509      ("\ 3\ 5" sgml-insert-em-emph "em emfh markup" "<em/")
510      ("\ 3\16" sgml-insert-var-empfh "var emph markup" "<var/"))))
511 (setq sgml-local-catalogs '("/jura:/usr/lib/debiandoc-sgml/sgml/catalog"))
512   
513 (add-hook 'sgml-mode-hook 'ian-sgml-setup)
514 ;
515 (defvar cite-string "> " "String to insert when citing")
516 ;
517 (defun cite-region (start end)
518   "Quote each line in the region with an angle-bracket and space.
519
520 The citation string is taken from cite-string."
521   (interactive "r")
522   (save-excursion
523     (save-restriction
524       (narrow-to-region start end)
525       (goto-char (point-min))
526       (insert cite-string)
527       (while
528           (and
529            (= (forward-line) 0)
530            (> (point-max) (point)))
531         (insert cite-string)))))
532 ;
533 ; End of this file.