(FILECREATED "24-May-84 11:25:22" {DSK}TEDITABBREV.;2 2341 changes to: (FNS \TEDIT.ABBREV.EXPAND) previous date: "21-Apr-84 01:47:43" {DSK}TEDITABBREV.;1) (PRETTYCOMPRINT TEDITABBREVCOMS) (RPAQQ TEDITABBREVCOMS [(FILES TEDITCOMMAND) (FNS \TEDIT.ABBREV.EXPAND) (GLOBALVARS TEDIT.ABBREVS) (VARS (TEDIT.ABBREVS (LIST [CONS "b" (MKSTRING (CHARACTER (CHARCODE #7] [CONS "n" (MKSTRING (CHARACTER (CHARCODE #↑%[] [CONS "m" (MKSTRING (CHARACTER (CHARCODE #↑\] (QUOTE ("%"" . "``"]) (FILESLOAD TEDITCOMMAND) (DEFINEQ (\TEDIT.ABBREV.EXPAND [LAMBDA (STREAM) (* jds "14-Feb-84 16:30") (* Expand an abbvreviation) (PROG ((TEXTOBJ (fetch (TEXTSTREAM TEXTOBJ) of STREAM)) SEL CH# (CH NIL) EXPANSION) (SETQ SEL (fetch SEL of TEXTOBJ)) (SETQ CH# (SELECTQ (fetch POINT of SEL) (LEFT (SUB1 (fetch CH# of SEL))) (RIGHT (fetch CHLIM of SEL)) 0)) [COND ((ZEROP CH#) (* If we're off the front of the document, don't bother trying.) (RETURN)) ((ZEROP (fetch DCH of SEL)) (* Point Selection, so use the character to the left) (\SETUPGETCH CH# TEXTOBJ) [SETQ CH (MKSTRING (CHARACTER (\BIN STREAM] (TEDIT.SETSEL STREAM CH# 1 (QUOTE LEFT))) (T (* We have a selection that isn't just a caret. Use it.) (SETQ CH (TEDIT.SEL.AS.STRING STREAM] (SETQ EXPANSION (SASSOC CH TEDIT.ABBREVS)) (* Find the abbreviation's expansion) (COND (EXPANSION (* It exists, so insert it where the abbrev used to be) (TEDIT.DELETE TEXTOBJ SEL) (TEDIT.INSERT STREAM (CDR EXPANSION) SEL]) ) (DECLARE: DOEVAL@COMPILE DONTCOPY (ADDTOVAR GLOBALVARS TEDIT.ABBREVS) ) (RPAQ TEDIT.ABBREVS (LIST [CONS "b" (MKSTRING (CHARACTER (CHARCODE #7] [CONS "n" (MKSTRING (CHARACTER (CHARCODE #↑%[] [CONS "m" (MKSTRING (CHARACTER (CHARCODE #↑\] (QUOTE ("%"" . "``")))) (DECLARE: DONTCOPY (FILEMAP (NIL (564 2038 (\TEDIT.ABBREV.EXPAND 574 . 2036))))) STOP