If you do not have the full Interleaf capabilities (which would make this task easier) then you may use the following procedure.
You may find other uses for this technique.
Sherry Anderson
Garrett Auxiliary Power, Allied-Signal, Phoenix
Charley Lough of McDonnell Douglas Helicopter has offered the following script to help
with this cleanup. It will execute under UNIX System 5 in either a Bourne shell or
Korn shell environment. You may need to precede it with an appropriate line defining
the shell, such as:
#!/sys5/bin/kshdepending upon your computer platform. It may be modified easily for use in BSD environments if needed.
SRC_DIR=`pwd` echo "doing a cleanup of the present" echo " directory $SRC_DIR?" echo "Is this correct? (y/n) : \c" read answer if [ "$answer" = "y" ] then find . -print >/tmp/clean.log grep ,1 /tmp/clean.log > /tmp/clean.new for fn in `cat /tmp/clean.new` do rm $fn done rm /tmp/clean.log /tmp/clean.new else echo "Try again from correct directory\n" fi
You may wish to enhance this script to provide additional checking. For example, you may not wish to delete a backup file if there is a crash copy or if there is no primary copy of the file, or you may wish to delete checkpoint copies of the file as well. We hope it serves as a starting point to help you solve this problem.
Thanks to
Charley Lough
McDonnell Douglas Helicopter Company, Mesa
This little fractionizer lisp script is NOT of professional quality but it seems to work most of the time. It takes selected text and, if there is a slash in it, turns it into a fraction, superscripting the first number, replacing the backslash with the fraction virgule (char 0x120), and subscripting the second number. It does not check to see if there are any non-char tokens in the selection (e.g., a frame).
To use, either:
;; Fractionizer: fractions.lsp 1-8-92 D. Weinberger ;; Not a product of Interleaf, Inc. (lisp-set-implementation "Interleaf Lisp" "2.0") (defun set-props (prop val) (tell *text-editor* mid:set-props prop val) ) (defun fractionizer () (let (virgule m1 m2 m3 markers text virg-pos) (setq virgule "\x120\") (setq markers (tell *text-editor* mid:get-selection)) (setq m1 (car markers)) (setq m2 (cdr markers)) ; selection? (if (not markers) (progn (stk-open "No text selected") (quit))) ; get text (setq text (tell m1 mid:get-substring m2 t t)) ; check for non-text elements -- not implemented ; virgule in it? (if (setq virg-pos (string-contained "/" text)) (progn ; --superscript the first part ; select to before virgule (setq m3 (tell m1 mid:copy)) (tell m3 mid:move-by virg-pos) (tell *text-editor* mid:select m1 m3) (set-props :superscript t) ; -- cut and replace slash with virgule (setq m1 m3) (tell m3 mid:move-by 1) (tell *text-editor* mid:select m1 m3) (tell *text-editor* mid:cut) (tell m1 mid:insert virgule) ; return virgule to normal (setq m3 (tell m1 mid:copy)) (tell m3 mid:move-by 1) (tell *text-editor* mid:select m1 m3) (set-props :superscript nil) ;subscript what's after it (tell m1 mid:move-by 2) (tell *text-editor* mid:select m1 m2) (set-props :subscript t) ; turn off subscript for rest of cmpn (tell *text-editor* mid:deselect) (tell *text-editor* mid:set-props :subscript nil)) ; else not slash (stk-open "No slash to indicate fraction")) )) ;; if loading off the NoSelect custom menu, uncomment ;; the next line: (fractionizer) ;; uncomment the next line if you put this script in your ;; profile.drw and want it bound to ^Xf ; (kbd-bind-doc kbd-doc-map "\^Xf" 'fractionizer "frac-\ntion")