From:	ADVAX::"nat@drao.nrc.ca" "Natalie Prowse" 26-NOV-1990 18:58:33.41
To:	<ISIS08@ecostat.aau.dk>, <miller@ria.ccs.uwo.ca>, <alberto@pseudo.berkeley.edu>, <ROSS@bio-medical-physics.aberdeen.ac.uk>, <CAIRNS@upei.ca>, <davis@pacific.mps.ohio-state.edu>, <mike@elec.canterbury.ac.nz>, <FAUCONNE%FRSIM51.BITNET@cunyvm.cuny.edu>, <nreadwin@micrognosis.co.uk>, <DMH100@csc1.anu.oz.au>, <mats@efd.lth.se>, <GOLDICK@vulcan.psc.edu>, <peirce@gumby.cc.wmich.edu>, <NRA%ipg.ph.kcl.ac.uk@nsfnet-relay.ac.uk>, <arisia::EVERHART>
CC:	
Subj:	EVEP emulation Part 5 of 5

Received: by ADVAX.DECnet (utk-mail11 v1.5) ; Mon, 26 Nov 90 18:56:42 EST
Received:  from mcnc by ge-dab.GE.COM (5.61/GE-DAB 1.15) with UUCP
	id AA04395 for everhart; Mon, 26 Nov 90 18:55:17 -0500
Received: from relay.CDNnet.CA by mcnc.mcnc.org (5.59/MCNC/6-11-90)
	id AA08477; Mon, 26 Nov 90 18:17:57 -0500
	for arisia.dnet.ge.com!EVERHART
Received: by relay.CDNnet.CA (4.1/1.14)
	id AA02279; Mon, 26 Nov 90 14:37:31 PST
Date: 26 Nov 90 20:14 -0800
From: Natalie Prowse <nat@drao.nrc.ca>
To: <ISIS08@ecostat.aau.dk>, <miller@ria.ccs.uwo.ca>,
        <alberto@pseudo.berkeley.edu>,
        <ROSS@bio-medical-physics.aberdeen.ac.uk>, <CAIRNS@upei.ca>,
        <davis@pacific.mps.ohio-state.edu>, <mike@elec.canterbury.ac.nz>,
        <FAUCONNE%FRSIM51.BITNET@cunyvm.cuny.edu>,
        <nreadwin@micrognosis.co.uk>, <DMH100@csc1.anu.oz.au>,
        <mats@efd.lth.se>, <GOLDICK@vulcan.psc.edu>,
        <peirce@gumby.cc.wmich.edu>, <NRA%ipg.ph.kcl.ac.uk@nsfnet-relay.ac.uk>,
        <arisia::EVERHART>
Message-Id: <209*nat@drao.nrc.CA>
Subject: EVEP emulation Part 5 of 5
 
-+-+-+-+-+-+-+-+ START OF PART 5 -+-+-+-+-+-+-+-+
X      (forward-line -1)
X      (let ((from (point)))
X`009(forward-paragraph)
X`009;; Forward to real paragraph end if not in lisp mode
X`009(or *lsp* (re-search-forward (concat "\\'\\`124" paragraph-separate)))
X`009(beginning-of-line)
X`009(or leave-prefix
X`009    (replace-fill-str
X`009      (or fill-prefix fill-prefix-prev)
X`009      "" nil region-start (point)))
X`009(fill-region-as-paragraph from (point) justify-flag)))))
X
X(defun replace-fill-str (fill-str-prev fill-str &optional suffix start end)
X  "Replace whitespace separated FILL-STR-PREV with FILL-STR.
XOptional SUFFIX non-nil means replace at ends of lines, default is beginning
Vs.
XOptional arguments START and END specify the replace region, default is the
Xcurrent region."
X  (if fill-str-prev
X      (progn (if (not start) (setq start (min (point) (mark))))
X`009     (if (not end)   (setq end   (max (point) (mark))))
X`009     (if (not fill-str) (setq fill-str ""))
X`009     (save-excursion
X`009       (save-restriction
X`009`009 (narrow-to-region start end)
X`009`009 (goto-char (point-min))
X`009`009 (perform-replace
X`009`009   (concat
X`009`009     (if suffix nil "`094")
X`009`009     "`091 \t`093*"
X`009`009     (regexp-quote
X`009`009       ;; Get non-whitespace separated fill-str-prev
X`009`009       (substring
X`009`009`009 fill-str-prev
X`009`009`009 (or (string-match "`091`094 \t`093" fill-str-prev) 0)
X`009`009`009 (if (string-match
X`009`009`009       "`091 \t`093*\\(.*`091`094 \t`093\\)`091 \t`093*$" fill-s
Vtr-prev)
X`009`009`009     (match-end 1))))
X`009`009       "`091 \t`093*"
X`009`009       (if suffix "$"))
X`009`009   fill-str nil t nil))))))
X
X(defun c-comment-make-prefix-only ()
X  "Make multiply-delimited C comments in region singly delimited.
XConverts comments of form:
X/*  <text>  */      to    /*
X/*  <text>  */             * <text>
X                           * <text>
X                           */"
X  (interactive)
X  (replace-fill-str "/*" " * ")
X  (replace-fill-str "*/" "" t)
X  (save-excursion
X    (goto-char (min (point) (mark)))
X    (insert "/*\n"))
X  (save-excursion
X    (goto-char (max (point) (mark)))
X    (insert (if (bolp) " */\n" "\n */"))))
X
X;;; Auto-justify minor mode
X;;;
X;;; From: jka@hpfcso.HP.COM (Jay Adams)
X;;; Newsgroups: comp.emacs
X;;; Subject:  auto-justify
X;;; Date: 7 Sep 89 01:30:18 GMT
X;;; Organization: Hewlett-Packard, Fort Collins, CO, USA
X
X(defvar auto-justify-mode '()
X  "Non-nil if auto-justifying minor mode is on.")
X
X(or (assoc 'auto-justify-mode minor-mode-alist)
X    (setq minor-mode-alist
X          (cons '(auto-justify-mode " Justify")
X                minor-mode-alist)))
X          `032
X(defun auto-justify-mode ()
X  "Toggle auto-justify minor mode."
X  (interactive)
X  (if (eq auto-fill-hook 'do-auto-fill-justify)
X      (setq auto-fill-hook 'do-auto-fill auto-justify-mode nil)
X    (setq auto-fill-hook 'do-auto-fill-justify
X          auto-justify-mode t)))
X
X(defun do-auto-fill-justify ()
X  "Same as do-auto-fill but justifies current line."
X  (do-auto-fill)
X  (save-excursion
X    (forward-line -1)
X    (justify-current-line)))
X
X(provide 'par-align)
X
$ CALL UNPACK EM-FILL.EL;1 644285420
$ create/nolog 'f'
X;emacs file (to be copied in your login dir):
X;
X;(this file is also designed to be used system-wide. In this case, you need
X;to comment out the following line, comments start with ";").
X;;   (setq inhibit-default-init t)         ; in your .emacs file
X;;
X;;-----------
X;; Default system-wide initialisation file for GNU-emacs.
X;;
X;;                                      Pierre VALIRON, 29 jan 1990
X;;                                      Modifie PV le 4 apr 90
X;;                                      Modified NOV/90 Natalie Prowse
X;;`009`009`009`009`009`009        (nat@drao.nrc.ca)
X;; * Remaps `094S and `094Q keys to avoid serious trouble with xon/xoff prot
Vocol.
X;; * Remaps control characters used in the isearch sub-mode. The new mapping
X;;   is compatible with xon/xoff, and allows to exit nicely from isearch
X;;   with arrow keys or function keys.
X;; * Enables by default the VT200 keypad and invokes evep-emulation-on.
X;; * Remaps some keys to support all the keys of the mini-keypad of the
X;;   vt200 and to improve the evep compatibility.
X;;
X;; To customise this file, just copy it as .emacs in your home
X;; directory and set the variable inhibit-default-init to non-nil
X;; in order to avoid loading the default.el file after your .emacs file.`032
X;; (this is already done -N.P.)
X
X;; Example to redefine the load-path for the *.el and *.elc files
X;; Make the first specification refer to your local directory, where you
X;; have the em-fill.el, and evep.el files.  Make the second specification
X;; refer to the system-wide lisp directory for emacs.  Note, that in
X;; our system, some were in the /lib/lisp directory, and some (like vt200.el
V)
X;; were in the /lib/term directory, and so could not be found.  The solution
X;; was to copy all the stuff from the /term directory into the /lisp directo
Vry.(N.P.)
X
X         (setq load-path '("/users/newobs/einit" "/usr/new/emacs/lib/lisp"))
X
X
X;; XON/XOFF stuff
X
X(global-unset-key "\C-s")                       ; XOFF char
X(global-unset-key "\C-q")                       ; XON  char
X(defconst search-repeat-char ?\C-a "forward")
X(defconst search-reverse-char ?\C-b "backwards")
X(defconst search-exit-char ?\C-e "exit incremental search")
X(defconst search-quote-char ?\C-u "quote char")
X(load "em-fill")
X(setq text-mode-hook 'turn-on-auto-fill)
X;; I have encountered serious problems using the following
X;; elaborate routine which saves the deleted characters in the
X;; "undelete" buffer. The lisp code seems much more complex than
X;; the staightforward code used for deleting words or lines.
X;;
X;;      (define-key function-keymap "," 'delete-current-char)
X;;
X;;  The problem MIGHT be related to the escape function generated by the
X;;  function key, because the same function works when mapped to `094D.
X
X
X;; The following MUST be done through the term-setup-hook.
X
X(defun vax-terminal ()
X  "This function should  be called by the term-setup-hook mechanism in your
X  .emacs file in order to tailor the VT200 keypad map to your own purposes"
X  (interactive)
X  (load "evep")          ; I have tried moving this around or getting rid of
X  (enable-arrow-keys)    ; it, but it only seems to work _here_.
X  (evep-emulation-on)   `032
X  (define-key GOLD-map "q" 'quoted-insert)         ; GOLD q
X  (define-key GOLD-map "Q" 'quoted-insert)         ; GOLD Q
X  (define-key global-map "\C-r" 'map-keyboard-macro)    ; `094r
X  (define-key global-map "\C-R" 'map-keyboard-macro)    ; `094R  `032
X  (define-key global-map "\C-e" 'call-last-kbd-macro)    ; `094e
X  (define-key global-map "\C-E" 'call-last-kbd-macro)    ; `094E  `032
X  (define-key global-map "\C-a" 'overwrite-mode)   ; `094a
X  (define-key global-map "\C-A" 'overwrite-mode)   ; `094A  `032
X  (define-key global-map "\C-d" 'change-direction) ; `094d
X  (define-key global-map "\C-D" 'change-direction) ; `094D  `032
X  (keypad-default "x" 'execute-extended-command)   ; GOLD 7 et DO
X  (define-key repeat-complex-command-map "\e`091A" 'previous-complex-command
V)
X  (define-key repeat-complex-command-map "\e`091B" 'next-complex-command)
X  (define-key repeat-complex-command-map "\eOA" 'previous-complex-command)
X  (define-key repeat-complex-command-map "\eOB" 'next-complex-command))
X
X
X
X;; Defines safe functions exit and quit for beginners
X;; (hint: should be defined twice, in uppercase and lowercase)
X
X(defun exit ()
X   "Synonym for kill-emacs with no args."
X   (interactive)
X   (save-buffers-kill-emacs))
X
X(defun quit ()
X   "Synonym for save-buffers-kill-emacs with no args."
X   (interactive)
X   (kill-emacs))
X
X(defun EXIT ()
X   "Synonym for save-buffers-kill-emacs with no args."
X   (interactive)
X   (save-buffers-kill-emacs))
X
X(defun QUIT ()
X   "Synonym for kill-emacs with no args."
X   (interactive)
X   (kill-emacs))
X
X(setq inhibit-default-init t)         ; in your .emacs file
X
X(setq require-final-newline t)           ; remap keys in due time
X(setq term-setup-hook 'vax-terminal)     ; remap keys in due time
X(redraw-display)
$ CALL UNPACK EMACS.;1 189463070
$ v=f$verify(v)
$ EXIT
