[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: defining words



Reply to note from "Myron Gochnauer"  Tue, 30 Sep 2003
09:27:57 -0300

Myron:

Here's a step or two in the direction you point to, though not the
whole nine yards. The first part, adapted from the innards of a U2
routine, addresses the issue of func DW's overinclusiveness
(DeFining trailing separators, punctuation, etc.). There's also a
variant that handles hyphenated words. The second part is a
personal routine of mine (not in the published U2) which may or may
not appeal to you. It enables, depending on the context, either
(a) adding a MoDe to DeFined text or (b) changing the MoDe of
already-MoDed text without the need to reDeFine it first. (FWIW,
YMMV, as is, caveat emptor, blah blah blah.) In combination, they
do some of what you're looking for.

XPLeNCODE v2.0
b-gin [UNTITLED]
I. Enhanced Func DW (Define Word)[cr|lf][cr|lf]A) DeFine fram
e(s) below, then issue ADD2U2 to add them to the loa
ded U2 file[cr|lf]B) Assign to key(s) with:[cr|lf][cr|lf]nn=N
OXHJM2,.,D,W,o,n,l,y,Q2[cr|lf]nn=NOXHJM2,.,D,W,o,n,l,y,2,Q2[c
r|lf][cr|lf]{{;5DWonly}} DeFine Word only (no trailing separa
tor, etc.) [CLD 9/30/03][cr|lf]{002}[YD_][DW_]{<}SV01{>}{<}LB
a{>}{<}SX01,{<}IS01{>}+"[255+192+142]"{>}{<}SV02,{027}S[255+1
92+142]{>}{<}SV03,{>}{<}XS01,02,02,03,04{>}{<}IF{<}VA|03{>}>0
{>}{<}SX01,{<}IS02{>}{>}[CL_][DM_][DZ_]{<}GLa{>}{<}EI{>}{002}
[cr|lf][cr|lf]{{;5DWonly2}} DeFine Word only (no trailing sep
arator, etc.) [CLD 9/30/03][cr|lf]{002};*; This variant DeFin
es hyphenated expressions from cursor onward[cr|lf][YD_]{<}SX
01,-1{>}{<}LBa{>}[DW_]{<}SV02{>}{<}IF({<}IS02{>}+"[255+192+14
2]"){240}"-[255+192+142]"{>}{<}IF{<}VA|02{>}-{<}PV01{>}>1{>}{
<}SX01,{<}VA|02{>}{>}{<}GLa{>}{<}EI{>}{<}EI{>}{<}LBb{>}{<}SX0
2,{<}IS02{>}+"[255+192+142]"{>}{<}SV01,{027}S[255+192+142]{>}
{<}SV03,{>}{<}XS02,01,01,03,04{>}{<}IF{<}VA|03{>}>0{>}{<}SX02
,{<}IS01{>}{>}[CL_][DM_][DZ_]{<}GLb{>}{<}EI{>}{002}[cr|lf][cr
|lf]II.[cr|lf][cr|lf]REMODE.PM -- CLD 4/1/91 (rev. 6/6/93, 8/
11/95)[cr|lf]Change or remove character mode of non-NorMal te
xt without DeFining[cr|lf]Change prevailing MoDe or MoDe of D
eFine block (via funcs M0-M9)[cr|lf][cr|lf]Usage:[cr|lf]With{032}
cursor on text to be changed: REMODE[cr|lf]Or assig
n to key with nn=NOXHJM2,.,r,e,m,o,d,e,Q2[cr|lf][cr|lf]When P
Rompted, choose *number* of desired MoDe from menu.[cr|lf] -{032}
MoDe of DF block changes if text is DeFined.[cr|lf] - Prevail
ing mode changes if text under cursor is MoDe NorMal or eXPan
ded view.[cr|lf][cr|lf]{{;5remode}} CLD 4/1/91 (rev. 6/6/93,
 8/11/95, 4/21/98)[cr|lf]{002}{<}SV01,{>}{<}IF{<}VA$WS{>}<>1{
>}{<}SV02,No file{>}{<}LBa{>}{<}PV01{>}[DO_][FF_]{<}PR@02{>}{
<}
EX{>}{<}EI{>}{<}IF{<}VAUM{>}<1{>}{<}SX01,{<}IS01{>}+"[BX_]d u
m=0[Q2_]"{>}{<}EI{>}{<}IF{<}VA$OO{>}>0{>}{<}SX01,{<}IS01{>}+"
[BX_]oo[Q2_]"{>}[BX_]ox[Q2_]{<}EI{>}[XH_][GT_][DX_][BX_]es 1[
Q2_][BX_]d um=1[Q2_][DZ_]{<}SX03,{<}CP{>}{>}{<}SV04,Prevailin
g {>}{<}SV02,Modes: 0={>}{<}SX02,{<}IS02{>}+{<}IS04{>}+"1=NM{032}
2=BO 3=UL 4=RV 5=BU 6=BR 7=SU 8=SD 9=IT [Esc]"{>}{<}IF{<}VA|0
0{>}==1{>}{<}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{<}IS04{>}+"Mode: "+{<}IS02{>}{>}{<}G
La{>}{002}[cr|lf][cr|lf]
-nd
XPLeNCODE

--
Carl Distefano
cld@xxxxxxxx
http://users.datarealm.com/xywwweb/