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

Questions



Charles Herold says:
>> I sometimes call FS from the middle of a word. The
>> idea is that if I return to my exact cursor position, I
>> can begin typing the second I've finished with the
>> spell menu, even before the cursor's got back to its
>> position (which takes a second or two on my 386SX), but
>> otherwise I have to find my place again.

Ah, OK, now I understand the problem. In theory, you could accomplish
that by recording CP and adding the difference in length between the
misspelled word and its correction, then JuMP back to that "updated"
CP. In practice, I don't see how that can be done directly, since func
FS won't delay executing while your macro checks the length of the
misspelled word. You could try the following (this is off the top of
my head, I haven't tested it): Have your macro execute FS and
immediately ES (Escape), which (I presume) would leave the misspelled
word intact. DeFine the word and subtract its length from CP. Then
execute func SO to correct the word. Then DeFine the word as corrected
and add its length to CP. Then JuMP back to the updated CP.

In the alternative, you could leave a temporary *physical* placemarker
(e.g., a LaBel or NoTe or -- to insure it works in No Markers mode -- a
single out-of-the-way Ascii character) at the cursor location; then,
when FS is finished, execute a SEarch command to jump back to the
marker, and then BD over the marker. Inelegant, but it would work.
>> Ah, a function I've never heard of. What other
>> undocumented XPL commands do you know of besides RK?

Gee, there are vast undocumented stretchs of XPL! I've never compiled
what I know in a single place, though I probably should've.
(Unfortunately, neither did TTG, and presumably they know
everything[?]). A couple of suggestions: Read the factory-issued .DLG
and .MNU files (DOS and Windows); they're chock full of XPL commands
that TTG developed for its internal use, and left undocumented. Also,
look at the code in REORGNIZ.U2 and its documentation (in
REORGNZ2.ZIP), a set of XPL coding tools ("REORGaNIZe") which Robert
Holgmren and I developed over the years. And peruse SMARTSET.U2 (in
SMART251.ZIP), which I referred to in my earlier note. In terms of
coding tricks and techniques, that's pretty much what I "know" and
regularly use in XPL.
>> I've never tried that [spell check to file],
>> perhaps I should. But I have a bad habit of
>> breaking up words, such as "th ebreak", and I
>> need to know that those two mispelled words
>> are adjacent.

True, SPELLing to file generates an alphabetically-sorted list, so you
wouldn't be aware of the adjacency. But the problem is hardly
intractable. Disliking the idea of manually adding corrections to
SPELL.TMP (required for the CORRECT command to work automatically), I
have a (fairly primitive) macro that lets me invoke the spell-checker
only as to those relatively few words on the list that need correcting.
I put the cursor on the word in the list that I want to correct; the
macro switches to the alternate screen (i.e., the document), finds the
word and then executes func SO, which invokes the spell-checker as to that word.
In
your example, scanning down the list, I might skip "th" (on the
assumption that it's part of "12th" or whatever), but when I got to
"ebreak", I'd hit my macro and the problem would become clear.

--------------
Carl Distefano
70154.3452@xxxxxxxx