[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: Cursor Moves
- Subject: Re: Cursor Moves
- From: Carl Distefano CLDistefano@xxxxxxxx
- Date: Tue, 1 Sep 1998 22:24:28 +0000
Reply to note from "Harrison, Shawn" Tue,
1 Sep 1998 13:33:59 -0400
-> >It is true that one can move by paragraph using PP and NP,
-> >but PP is unsatisfactory. If you are in the middle of a
-> >paragraph, it takes you not to the beginning of the
-> >paragraph, but to the beginning of the previous one. PP has
-> >no corresponding problem.
-> >
-> >Here is what I use:
-> >100=ni,cl,bc,s,e,b, ,|,wc,|,xc,cr
-> [...]
-> One limitation of this approach is that, if your paragraphs are
-> divided by two carriage returns, You'll have to up-arrow
-> twice. The PP function automatically deals with multiple or
-> single carriage returns. I suspect mimicking this in XPL would
-> take a fair amount of programming . . . (any takers?).
Not much programming, in fact. Using XPL v4 for the moment, it would
come down to this ("" stands for a real carriage return):
>BX (seb )NP ==>PP
This method overcomes both Nathan's objection to the behavior of func
PP and Shawn Harrison's point about PP recognizing paragraphs
delimited by more than one carriage return. What it does, in essence,
is to search backwards for a carriage return and *then* execute func
*NP*. If the cursor position hasn't changed after this operation, it
means that the cursor was at the beginning of the paragraph, so that
the routine then appropriately executes func PP to get to the previous
paragraph. If the cursor position *has* changed, then it means that
the cursor was originally in the middle of the paragraph. The func NP
gets it to the beginning of the paragraph, right where Nathan and, I
suspect, most users, want it to be. (Since this is rough 'n' ready
routine, I've made no attempt to provide for the situation where the
SEB command fails.)
If you have Reorganize and XMACRO installed, you could assign this
code directly to a key, thus (for "{13}", substitute a 3-byte
Ascii-13, obtained by holding down Ctrl-Alt (or whatever the
appropriate shift combination is for your keyboard), hitting 1 and 3,
then releasing the shift keys):
nn=NOXHJM(,2,.,P,r,s,K,b,d,A,r,g,),x,m,a,c,r,o,
,[,S,X,0,1,CO[,C,P,],],COB,X,(,s,e,b, ,
,{13},),N,P,[,I,F,[,C,P,],=,=,[,P,V,0,1,],],COP,P,[,E,I,],NO
In III+, the basic code is quite similar, except that any existing
command line will be wiped out:
>BC seb WC XC NP ==>PP
Assigning this code directly to a key is left as an exercise for
III+ mavens. ;-)
--------------
Carl Distefano
CLDistefano@xxxxxxxx
http://users.datarealm.com/xywwweb/