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

Re: unwrapa invisible?



** Reply to message from "Myron Gochnauer"  on Sat, 11 May 2002
08:41:11 -0300

Myron:

> Robert,

> I should have known that UNWRAPA would be more thoughtful
> and intelligent than I suspected! Since thinking comprises
> most of the time-cost, I'm content to watch it *think*. As
> a teacher I love to watch others think.

> I'm looking forward to the next edition... it's always
> like an unexpected gift. I never cease to marvel at the
> efficiency of XPL and U2 frames. Why in the world hasn't
> at least some of this been copied by the "tall people"?
> Most programs seem so inefficient, storing and accessing
> macros individually.

> BTW, whenever I download a new version of XYWWWEB.U2, the
> first thing I do is add some of Tim Baehr's routines. The
> one I cannot live without is the cdx command: it changes
> the directory to that of the file current on screen. This
> is extremely useful if you frequently have several files
> from several locations open at the same time. Perhaps Tim
> would consent to having it added to your-&-Carl's U2.

Please send me the Baehr routines that you like, I'm not
aware of them. But U2 has long contained two complementary
routines that do the same thing: GOFILEDD (GFD for short),
which sets the current drive:\directory to that of the
current window's open file; and GOXYDD (GXD), which sets the
current d:\path to Editor's Drive:\Directory. I use them so
often that they're assigned KBD file keys:

nn=NOJM2,.,g,f,d,Q2
 and
nn=NOJM2,.,g,x,d,Q2

> And also on the wish list: a routine for defining pseudo-
> commands that change the directory to specific locations.
> Right now I "hard code" this into the beginning of
> XYWWWEB.u2 (along with cdx and some LaTeX-running
> routines)...
> For example, if I put "docs" on the command line and press
> the xywwweb.u2 activation key (is that what it's called?
> --- I can't remember... it's just F10 for me: right next
> door to the traditional F9 execute key), the directory is
> changed to my documents subdirectory. "xy" acts as a
> short-cut command or alias for "cd c:\progra~1\xy2" and so
> on. It would be nice to have a routine that would read
> and set these shortcuts on the basis of an ASCI file that
> existed independently of U2 itself. Another set of
> routines might be used to maintain the file of shortcut
> definitions and prevent attempts to use names/commands
> already in use by U2. I think I could probably cobble
> something like this together myself, but it would
> undoubtedly lack the sophistication of an official
> version... and I would still have to add the routines
> every time I got a new U2 version.

Because we plan to move from embedded User Variables within
the U2 file, to an independent UserVar Registry file that
users can edit without the hassle of having to alter and re-
load the (intimidating, for many users) U2 file, I would set
up a system like this (there are other approaches, although
most would involve manipulating Save/Gets -- again,
intimidating to many):

I'd establish a dedicated filename such as CHDRVDIR.REG, in
Editor's directory, with this format:

-------------
; CHDRVDIR.REG
; Registry of aliases for drive:\directory changes (U2 frame CDD)
;
[CDD_Aliases]
SentMail=E:\POLARBAR\MailData\Mailer\Holmgren\sent
Letter=G:\XY4\DOCS\LETTERS
Bookmarks=C:\DOCUME~1\ADMINI~1\APPLIC~1\MOZILLA\PROFILES\DEFAULT\PCCEUPZS.SLT
; Etc etc etc -- as many as you wish, infinitely expandable
-------------

Obviously, you can use much shorter aliases, just one or two
letters, as long as each alias is _unique_ (and you can
remember them). This registry would then interface to a
generalized U2 routine, let's call it CDD -- something like
this:

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5cdd}} Fetch Change Drive:\Directory spec from CHDRVDIR.RE
G RJH 5/13/02[cr|lf]{2}{<}IF{<}VA|50{>}>0{>}[BX_]unload -PJ[
Q2_]{<}SX01,"{<}VA=CHDRVDIR.REG,"+{<}IS50{>}+"={>}"{>}{<}SX01
,{<}PV01{>}{>}{<}IF{<}VA-PJ{>}>0{>}{<}IF{<}VA|01{>}>2{>}{<}IF
":"{238}{<}IS01{>}==1{>}{<}SX02,{<}VAWA{>}{>}[BX_]d wa=0[Q2_]
[BX_]es 1[Q2_][BX_][Q2_][BX_]es 0[Q2_][BX_]d wa={<}PV02{>}[Q2
_]{<}SV02,:{>}{<}XS01,02,03,,04{>}{<}SX02,{<}VA$DV{>}{>}[BX_]
{<}PV03{>}:[Q2_]{<}IF{<}VA$ER{>}==227{>}{<}SX01,"Bad drive "+
{<}IS03{>}+":"{>}{<}LBA{>}{<}PR@01{>}{<}EX{>}{<}EI{>}[BX_]cd{32}
{<}PV04{>}[Q2_]{<}IF{<}ER{>}{>}[BX_]{<}PV02{>}:[Q2_]{<}SX01,"
Bad dir "+{<}IS01{>}{>}{<}GLA{>}{<}EI{>}{<}SX01,"cd "+{<}IS01
{>}{>}{<}PR@01{>}{<}EX{>}{<}EI{>}{<}EI{>}{<}LBB{>}{<}PRComman
d: CDD alias{>}{<}EX{>}{<}EI{>};*;[cr|lf]{<}SX50,{<}VA$ED{>}{
>}[JM_]2.GetPath[Q2_]{<}SX50,"You *must* create "+{<}IS50{>}+
"\CHDRVDIR.REG"{>}{<}PR@50{>}{<}EX1{>}{<}EI{>}{<}GLB{>}{2}[cr
|lf]
-nd
XPLeNCODE

This scheme is ready-to-go. "Decode" the program
above, plug it into U2, and establish a CHDRVDIR.REG
file per the above template (sans the dashed lines, of
course) in Editor's dir (I assume Editor's dir is in the DOS
Path -- it should be, if nothing else just to get the
speller to work).

Later, when we introduce the "real" U2 Registry, this scheme
can be modified easily and CHDRVDIR.REG can be integrated
into the main registry. For now, it works.

> [I suppose I should at least write an XPL
> routine that will automatically personalize new versions
> of U2. At the moment it's purely cut and paste by hand.]

Why not make a separate file of all your personal routines,
in U2 format, then just MErge it as a block into new U2
versions? Should be effortless and easy to maintain...

BTW, I misspoke when I said that REWRAP[A] was the complement
of UNWRAP[A]. Actually I wrote three routines: WRAP[A],
UNWRAP[A], and REWRAP[A]. Without the "A", they do one line
at a time; with the "A", they operate from current CurPos to
EOF. *WRAP* is the complement of UNWRAP; REWRAP does an unwrap
followed by a new wrap (presumably at a new line length).
Try them out, you'll see the differences.

Thanks for the feedback! Lemme know if CDD works for you...

Best,

-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------