home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 2: PC
/
frozenfish_august_1995.bin
/
bbs
/
d07xx
/
d0770.lha
/
Uedit
/
Jenkins.LZH
/
config!E
< prev
next >
Wrap
Text File
|
1992-01-06
|
92KB
|
2,528 lines
config!E
------------------------------------------------------------------------------
Commands for editing, chars, page and par formatting, searching
==== SWAP, MULTIPLY, COUNT KEYS ====
..<alt-m: Swap the mouse's button-Up command with the next key-command pressed
..<normal-f5: Swap next 2 commands. (Mouse buttons, menu selections, gadgets, keys.)
..<shftAlt-x: Set command multiplier to use for next command. See ctl-s and ctl-r.
..<shftAlt-i: Count number of times the next command is successfully executed
..<alt-t: Show key-help message on next key pressed. Copy key-help to RAM: on first
..<shftAlt-t: Show Key-help messages until Amiga-ESC to quit.
==== CURSOR LEFT & RIGHT ====
..<normal-leftArrow: Move cursor to left one char
..<normal-rightArrow: Move cursor to right one char
..<shft-leftArrow: Move cursor to start of word
..<shft-rightArrow: Move cursor to end of word
..<alt-leftArrow: Move cursor to start of sentence
..<alt-rightArrow: Move cursor to end of sentence
..<ctl-leftArrow: Move cursor to start of line
..<ctl-rightArrow: Move cursor to end of line
==== CURSOR UP & DOWN ====
..<normal-upArrow: Move cursor up one line
..<normal-downArrow: Move cursor down one line
..<shft-upArrow: Move cursor up quarter pane (11 lines)
..<shft-downArrow: Move cursor down quarter pane (11 lines)
..<alt-upArrow: Flip up (backward) one pane
..<alt-downArrow: Flip down (forward) one pane
..<normal-gadget4: Flip and scroll up and down
..<ctl-upArrow: Move cursor to start of file
..<ctl-downArrow: Move cursor to end of file
==== LINES ====
..<alt-b: Open line for typing below cursor line, indent to match this line
..<alt-a: Open line for typing above the current line, indent to match this line
..<alt-j: Join next line to cursor line
..<alt-1: Delete all trailing spaces in current document
..<alt-2: Clear leading white space in cursor line
..<alt-3: Flush right ..comment (must be a space before ..)
..<shftAlt-3: Flush right the cursor line from cursor rightward
..<alt-4: Flush right ..comments from cursor line forward (ask)
..<alt-5: Match indent of cursor line to previous line, move down
..<alt-e: Change end-of-line (eLine) character (normal is ASCII 10)
..<shftAlt-e: Change all current file's end-of-line characters
..<shftAlt-s: Sort lines in curFile.
==== PREKEY ====
..<preKey: Record present and last text entry locations
..<43: Note change in editing location
==== BOOKMARKS ====
..<<normal-gadget4:3: Set bookmark or move to a bookmark.
==== HILITE & INVERT ====
..<ctl-1: Start hilite (need if mouseless or doing learned sequence)
..<ctl-2: End hilite (need if mouseless or doing learned sequence)
..<ctl-3: Cancel hilite (need if mouseless or doing learned sequence)
..<ctl-4: Start invert
..<ctl-5: End invert
..<ctl-6: Cancel invert
==== BUTTONDOWNS ====
..<normal-buttonDown: Place cursor, dbl-click=pick up word, sngl=start hilite, scroll
..<shft-buttonDown: Adjust hilite if any
..<alt-buttonDown: Move hilite, swap new sweep with old, pick up search, pick up hilite as search
..<shftAlt-buttonDown: Copy hilite to new location, hilite insertion
==== CUT, COPY & PASTE using Buffer A (buf47) ====
..<ctl-c: Copy hilite or sentence into Buffer A, stack old
..<shftCtl-c: Copy hilite or sentence, adding it into Buffer A at eFile
..<ctl-d: Cut cursor line into Buffer A at eFile, adding if no cursor move (ignores hilite)
..<shftCtl-d: Cut cursor line, adding it into Buffer A at eFile (ignores hilite)
..<ctl-x: Cut hilite or sentence into Buffer A, stack old
..<shftCtl-x: Cut sentence or hilite always adding it into Buffer A at eFile
..<ctl-v: Insert Buffer A at cursor (last copy or cut)
..<ctl-p: Insert Buffer A stack at cursor (unlimited history), scan stack
==== DELETE & UNDO using Buffer B (buf45) ====
..<normal-bs: Delete char to left of cursor or hilite into Buffer B
..<shft-bs: Delete word or part to left into Buffer B
..<alt-bs: Delete sentence or part to left into Buffer B
..<ctl-bs: Delete paragraph or part to left into Buffer B
..<normal-del: Delete char under cursor or hilite into Buffer B
..<shft-del: Insert last block of deletions at cursor (undo from Buffer B)
==== TABS ====
..<shftAlt-tab: Show tab ruler above cursor line
..<shftCtl-tab: Set tab ruler using mouse or keys
..<altCtl-tab: Switch to/from using spaces for tabs or using real tabs
..<lAmiga-tab: Convert tabs in document to spaces
..<rAmiga-tab: Convert spaces in document to TABs
..<shftAltCtl-tab: Set TAB table number (0-4) to use for TAB spacing
..<shft-tab: Indent-Outdent a block of lines
==== CHAR ====
..<ctl-u: Convert char under cursor or hilight to upper case
..<altCtl-u: Capatalize first letter of each word in hilite
..<ctl-l: Convert char under cursor r hilight to lower case
..<shftAlt-c: Insert CTRL-character, such as formfeed, etc
==== OVERSTRIKE, RIGHT JUSTIFY, AUTOINDENT, WORDWRAP ====
..<shft-f5: Toggle overstrike typing mode
..<ctl-j: Toggle the right-justify typing mode
..<alt-f5: Toggle autoindent typing mode
..<ctl-f5: Toggle wordwrap typing mode
..<lAmiga-f5: Toggle changed status of curFile
..<lAmiga-f4: Switch displaying of cursor row-column off/on
==== PAGE FORMAT ====
..<ctl-return: Set new line-length for this file only
..<lAmiga-p: Input a new lines/page value for this file only
..<lAmiga-u: Set top margin for this file only
..<lAmiga-l: Set bottom margin for this file only
..<alt-c: Center text in the line. (Uses current line length.)
==== PARAGRAPH FORMAT ====
..<ctl-f: Reformat cursor paragraph, starting at cursor line, skip blankLines
..<ctl-g: Reformat paragraph, go to end of paragraph
..<ctl-b: Reformat block indented paragraph, go to end
..<ctl-a: Reformat whole document (ask), return to last atCursor
..<ctl-h: Reformat hanging indent, indented 3 chars, put cursor on outdent of first line
==== SEARCH & REPLACE ====
..<altCtl-f7: Toggle case-sensitivity of search
..<virtual-s: CsSearch for buf49 match, embedded matches ignored
..<normal-gadget1: Search forward or next buffer with a file
..<shft-gadget1: Search backward or previous buffer with a file
..<shftCtl-f7: Type in new search wild-card characters
..<ctl-f7: Type in new search either-or character
..<normal-f7: Type in search string (push old) and search fwd. EitherOr = $, wilds= ? & *.
..<shft-f7: Revise search string (push old) and search fwd
..<alt-f7: Pick up hilite, or pop previous string, (push old, do not search)
..<normal-f8: Type in replace text to use in search-replace
..<shft-f8: Revise existing replace text
..<normal-f9: CsSearch forward, mark matched region, put cursor at end of rgn
..<shft-f9: CsSearch backward, mark matched region, put cursor at start of rgn
..<lAmiga-f9: Search forward, mark matched region, put cursor at end of rgn
..<rAmiga-f9: Search backward, mark matched region, put cursor at end of rgn
..<normal-f10: Replace matched region with replace text, then search forward
..<shft-f10: Replace matched region with replace text, then search backward
..<alt-f10: Replace and continue forward cssearch-replace until search fails
..<shftCtl-i: Check identifier usage, recording loc of next in list at bookmark d
==== MAKE LIST, REPLACE LIST ====
..<ctl-i: Pick up hilight in curFile, make list in buf41
..<ctl-e: Replace names in curFile as per list in buf41
==== SESSION PROFILE ====
..<shftAltCtl-f1: Compile a profile of the session
------------------------------------------------------------------------------
locA-locB = Used within commands in various ways
locC = Set in text altering commands:
locC=atCursor after these copy/cut/deletes
{normal,shft,alt,ctl}-bs
normal-del
ctl-{c,d,x}
locC!=atCursor after these pastes
ctl-v
shft-del
locC used in these commands such that locC!=atCursor afterward
alt-buttonDown
ctl-f
Tested in copy,cut,delete commands to see if this copy/cut/delete
should be added to the preceeding one because the cursor has not
moved since the last copy/cut/delete. If locC=atCursor the copy/
cut/delete is added to the buffer, otherwise the buffer is cleared
first.
{normal,shft,alt,ctl}-bs ->buf45 = A
normal-del ->buf45
ctl-{c,d,x} ->buf47 = B
locD = Location of last text entry before a large move and entry
(set in ..<43: which is invoked by prekey:)
(bookmark -1 goes to locD)
locE = Location of last text entry
(set in ..<43: which is invoked by prekey:)
(bookmark 0 goes to locE)
locF-locJ = Bookmarks a-e, set by user
n58 (GLOBAL) initial index for learned sequences
n60 (GLOBAL) large move flag, 0 = no move since last text entry
------------------------------------------------------------------------------
buf41
buf45
buf46
buf47
buf48
buf49
buf50
buf53
buf55
buf56
buf57
buf[n10]
n0
n1
n10
n11
n12
n13
n14
n15
n16
n2
n21
n22
n23
n24
n25
n26
n27
n28
n29
n3
n4
n60
-------------------------------------------------------------------------------
==== SWAP, MULTIPLY, COUNT KEYS ====
Swap the mouse's button-Up command with the next key-command pressed
<alt-m:
putMsg("Will swap mouse buttonUp with your next key:")
getKey(n0)
if (swapKey(n0,normal-buttonUp)) {
putMsg("Swapped.... To undo, do it again")
return }
putMsg(" ")
>Friday 12-Jul-91 08:36:45
Swap next 2 commands. (Mouse buttons, menu selections, gadgets, keys.)
<normal-f5:
putMsg("Next 2 function keys will be swapped!")
if (getKey(n53) & getKey(n54) & swapKey(n53,n54))
{ putMsg("Keys were swapped.") return }
putMsg(" ") >
Set command multiplier to use for next command. See ctl-s and ctl-r.
<shftAlt-x:
putMsg("Type in command multiplier:")
inputNum(cmdMultiplier)
>Sunday 14-Jul-91 10:24:40
Count number of times the next command is successfully executed
<shftAlt-i:
equateNum(n0,0)
putMsg("Type in command multiplier:")
inputNum(n1)
putMsg("Hit command to execute x times and count successes:")
if (getKey(n3)) {
do(n2,1,n1) if (runKey(n3)) incNum(n0)
freeBuf(buf50)
insertRgn(buf50,sFile,"Times executed successfully = ",all)
toWord(buf50,n0)
putMsg(buf50) }
>Sunday 14-Jul-91 10:53:40
Show key-help message on next key pressed. Copy key-help to RAM: on first
<alt-t:
putMsg("Help message on next key, gadget, click.")
getKey(n0)
teachOne(n0)
>Tuesday 16-Jul-91 19:22:46
Show Key-help messages until Amiga-ESC to quit.
<shftAlt-t:
putMsg("Help message on keys, gadgets, clicks. Amiga-ESC to quit")
LABEL(0)
getKey(n0)
teachOne(n0)
goto label(0)
>Tuesday 16-Jul-91 19:26:26
==== CURSOR LEFT & RIGHT ====
Move cursor to left one char
<normal-leftArrow:
moveCursor(curFile,sChar)
if (gtLoc(curFile,eHilite,sHilite)) runKey(ctl-3) ..sHi&eHi<=atCursor
refreshDisplay
>Tuesday 23-Jul-91 19:06:31
Move cursor to right one char
<normal-rightArrow:
moveCursor(curFile,eChar)
if (gtLoc(curFile,eHilite,sHilite)) runKey(ctl-3)
refreshDisplay
>Saturday 08-Jun-91 20:33:49
Move cursor to start of word
<shft-leftArrow:
moveCursor(curFile,sWord)
if (gtLoc(curFile,eHilite,sHilite)) runKey(ctl-3)
refreshDisplay
>Saturday 08-Jun-91 20:33:50
Move cursor to end of word
<shft-rightArrow:
moveCursor(curFile,eWord)
if (gtLoc(curFile,eHilite,sHilite)) runKey(ctl-3)
refreshDisplay
>Saturday 08-Jun-91 20:33:50
Move cursor to start of sentence
<alt-leftArrow:
..if at the start of a sentence, we must move left to second .?!
..skip !shitespace, whitespace, and then look for .?!
if (!is(curFile,whiteSpace)) moveCursor(curFile,sChar)
while (is(curFile,whiteSpace) & !is(curFile,sFile)) moveCursor(curFile,sChar)
LABEL(0)
while (nothing) { ..equivalent to setSearch(".$?$!") search <-
moveCursor(curFile,sChar)
if (is(curFile,".")) goto label(1)
if (is(curFile,"?")) goto label(1)
if (is(curFile,"!")) goto label(1)
if (is(curFile,blankLine)) goto label(1)
if (is(curFile,sFile)) goto label(2) }
LABEL(1)
..skip embedded .?! as in uedit.raj
moveCursor(curFile,eChar)
if (!is(curFile,whiteSpace)) {
moveCursor(curFile,sChar)
goto label(0) }
moveCursor(curFile,eChar) ..move off .?!
LABEL(2)
..alertUser("now skip white")
while(is(curFile,whiteSpace)) moveCursor(curfile,eChar)
if (gtLoc(curFile,eHilite,sHilite)) runKey(ctl-3)
refreshDisplay
>Friday 12-Jul-91 09:27:04
Move cursor to end of sentence
<alt-rightArrow:
setSearch(".")
LABEL(0)
while (nothing) { ..equivalent to setSearch(".$?$!") search <-
moveCursor(curFile,eChar)
if (is(curFile,".")) goto label(1)
if (is(curFile,"?")) goto label(1)
if (is(curFile,"!")) goto label(1)
if (is(curFile,blankLine)) goto label(1)
if (is(curFile,eFile)) goto label(2) }
LABEL(1)
..skip embedded .?! as in uedit.raj
moveCursor(curFile,eChar)
if (!is(curFile,whiteSpace)) {
moveCursor(curFile,sChar)
goto label(0) }
moveCursor(curFile,eChar) ..move off .?!
while(is(curFile,whiteSpace)) moveCursor(curfile,eChar)
LABEL(2)
if (gtLoc(curFile,eHilite,sHilite)) runKey(ctl-3)
refreshDisplay
>Friday 12-Jul-91 09:27:27
Move cursor to start of line
<ctl-leftArrow:
moveCursor(curFile,sLine)
if (gtLoc(curFile,eHilite,sHilite)) runKey(ctl-3)
refreshDisplay
>Saturday 08-Jun-91 20:33:50
Move cursor to end of line
<ctl-rightArrow:
moveCursor(curFile,eLine)
equateLoc(curFile,sHilite,eHilite)
if (gtLoc(curFile,eHilite,sHilite)) runKey(ctl-3)
refreshDisplay
>Saturday 08-Jun-91 20:33:51
==== CURSOR UP & DOWN ====
Move cursor up one line
<normal-upArrow:
moveCursor(curFile,upLine)
if (gtLoc(curFile,eHilite,sHilite)) runKey(ctl-3)
refreshDisplay
>Saturday 08-Jun-91 20:33:51
Move cursor down one line
<normal-downArrow:
moveCursor(curFile,downLine)
if (gtLoc(curFile,eHilite,sHilite)) runKey(ctl-3)
refreshDisplay
>Saturday 08-Jun-91 20:33:51
Move cursor up quarter pane (11 lines)
<shft-upArrow:
if (eqNum(n60,0)) equateNum(n60,1) ..first large move after text entry
getSplitLines(n1,n2) ..normally 0,47
sub(n2,n2,n1) ..normally 47
div(n2,n2,4) ..normally 11
..alertUser(n2)..debug
moveCursor(curFile,sLine)
do(n10,0,n2) moveCursor(curFile,upLine)
if (eqLoc(curFile,atCursor,sPage)) vScroll(atCursor)
if (gtLoc(curFile,eHilite,sHilite)) runKey(ctl-3)
refreshDisplay
>Saturday 08-Jun-91 20:33:51
Move cursor down quarter pane (11 lines)
<shft-downArrow:
if (eqNum(n60,0)) equateNum(n60,1) ..first large move after text entry
getSplitLines(n1,n2) ..normally 0,47
sub(n2,n2,n1) ..normally 47
div(n2,n2,4) ..normally 11
add(n2,n2,2) ..somehow makes it work
..alertUser(n2)..debug
moveCursor(curFile,sLine)
do(n10,0,n2) moveCursor(curFile,downLine)
if (gtLoc(curFile,eHilite,sHilite)) runKey(ctl-3)
refreshDisplay
>Saturday 08-Jun-91 20:33:51
-----------------------------------------------------------------------------
What I want is for normal-pgUp and normal-pgDown to flip the text exactly
one screen up or down.
To emulate the usual wordprocessor commands the cursor would move to the
top or bottom of the page on the first entry, then flip the page and place
the cursor at the top of the page. I always found that first cursor move
quite confusing so I'm not unhappy that I did not do it that way. The page
flips regardless of where the cursor is at present.
I find the Uedit automatic scrolling which scrolls to place the cursor in
the middle of the screen quite confusing. I suppose I might eventually get
used to it, but the WordPerfect style seems much easier to follow. Getting
the cursor back to the top of the screen requires an extra refreshDisplay to
update sPage so that scrolling is possible. That produces a distracting
double display. I decided to settle for the cursor in the middle of the
screen.
----------------------------------------------------------------------------
Flip up (backward) one pane
<alt-upArrow:
if (eqNum(n60,0)) equateNum(n60,1) ..first large move after text entry
moveCursor(curFile,sPage) ..first line on screen
getSplitLines(n1,n2) ..normally 0,47
sub(n2,n2,n1)
div(n2,n2,2)
..alertUser(n2)..debug
do(n10,1,n2) moveCursor(curFile,upLine)
equateLoc(curFile,sHilite,eHilite)
if (gtLoc(curFile,eHilite,sHilite)) runKey(ctl-3)
refreshDisplay
>Saturday 08-Jun-91 20:33:52
Flip down (forward) one pane
<alt-downArrow:
if (eqNum(n60,0)) equateNum(n60,1) ..first large move after text entry
moveCursor(curFile,ePage) ..first line below screen, top of next
getSplitLines(n1,n2) ..normally 0,47
sub(n2,n2,n1)
if (mod(n3,n2,2)) add(n2,n2,1) ..if screen size is odd, add 1
div(n2,n2,2)
..alertUser(n2)..debug
do(n10,1,n2) moveCursor(curFile,downLine)
equateLoc(curFile,sHilite,eHilite)
if (gtLoc(curFile,eHilite,sHilite)) runKey(ctl-3)
refreshDisplay
>Saturday 08-Jun-91 20:33:52
|
| Four regions in gadget 4, 5-5-5-7 char wide
| Flip up, scroll up, scroll down, flip down
|
Flip and scroll up and down
<normal-gadget4:
mouseXY(n10,n11) ..n10, n11 = mouse x,y = switch parameter
sub(n10,n10,480) ..first pixel in gadget 4 (60col)x(8pix)
div(n10,n10,40) ..(character width)x4
add(n10,n10,1) ..map to region #
..putMsg(n10)
switch(n10) {
case(1) {runKey(alt-upArrow) }
case(2) {
vScroll(atCursor)
delay(1) ..pause so a quick tap just centers the cursor
if (!mouseDown) return
runKey(ctl-3)
while (mouseDown) {
vScroll(atCursor)
moveCursor(curFile,upLine)
refreshDisplay } }
case(3) {
vScroll(atCursor)
delay(1)
if (!mouseDown) return
runKey(ctl-3)
while (mouseDown) {
vScroll(atCursor)
if (!mouseDown) return
moveCursor(curFile,downLine)
refreshDisplay } }
default {runKey(alt-downArrow) } }
>Wednesday 31-Jul-91 15:40:58
Move cursor to start of file
<ctl-upArrow:
..if first large move after text entry, have prekey back up loc
if (eqNum(n60,0)) equateNum(n60,1)
moveCursor(curFile,sFile)
equateLoc(curFile,sHilite,eHilite)
if (gtLoc(curFile,eHilite,sHilite)) runKey(ctl-3)
refreshDisplay
>Saturday 08-Jun-91 20:33:52
Move cursor to end of file
<ctl-downArrow:
if (eqNum(n60,0)) equateNum(n60,1)
moveCursor(curFile,eFile)
equateLoc(curFile,sHilite,eHilite)
if (gtLoc(curFile,eHilite,sHilite)) runKey(ctl-3)
refreshDisplay
>Saturday 08-Jun-91 20:33:52
==== LINES ====
Open line for typing below cursor line, indent to match this line
<alt-b:
equateNum(n14,0)
if (!getFlag(curFile,autoIndent)) {
flipFlag(curFile,autoIndent)
equateNum(n14,1)
}
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
typeChar(eLine)
if (eqNum(n14,1)) flipFlag(curFile,autoIndent)
equateLoc(curFile,sHilite,eHilite)
refreshDisplay
>Saturday 08-Jun-91 20:33:53
Open line for typing above the current line, indent to match this line
<alt-a:
equateNum(n14,0)
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
while (is(curFile,space)) {moveCursor(curFile,eChar) incNum(n14)}
moveCursor(curFile,upLine)
if (!is(CurFile,eLine)) moveCursor(curFile,eLine)
insertChar(curFile,eLine)
while (gtNum(n14,0)) {typeChar(" ") decNum(n14) }
equateLoc(curFile,sHilite,eHilite)
refreshDisplay
>Saturday 08-Jun-91 20:33:53
Join next line to cursor line
<alt-j:
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
equateLoc(curFile,locA,atCursor)
while (moveCursor(curFile,eChar)
& (is(curFile,space) | is(curFile,9))) nothing
equateLoc(curFile,locB,atCursor)
clearRgn(curFile,loc)
if (!is(curFile,eFile)) insertChar(curFile," ")
equateLoc(curFile,sHilite,eHilite)
refreshDisplay
>Monday 15-Jul-91 22:30:08
Delete all trailing spaces in current document
<alt-1:
equateLoc(curFile,locA,atCursor)
moveCursor(curFile,sFile)
putMsg("Scanning, please wait....")
while (nothing) {
if (is(curFile,eFile)) {
equateLoc(curFile,atCursor,locA)
putMsg("Deleted all trailing spaces")
return }
moveCursor(curFile,eLine)
moveCursor(curFile,sChar)
while (is(curFile,space) | is(curFile,9)) {
clearChar(curFile)
moveCursor(curFile,sChar) }
moveCursor(curFile,eLine) }
>Saturday 22-Jun-91 13:13:05
Clear leading white space in cursor line
<alt-2:
equateLoc(curFile,locA,atCursor)
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
while (is(curFile,whiteSpace) & !is(curFile,eLine) & !is(curFile,12))
clearChar(curFile)
equateLoc(curFile,atCursor,locA)
moveCursor(curFile,downLine)
>Saturday 20-Jul-91 21:15:45
Flush right ..comment (must be a space before ..)
<alt-3:
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
while (!is(curFile,eLine)) {
if (is(curFile,".")) {
moveCursor(curFile,eChar)
if (is(curFile,".")) {
..alertUser("found ..")..debug
runKey(shftAlt-3)
returnTrue } }
moveCursor(curFile,eChar) }
putMsg("Use ShftAlt-3 to flush part of a noncomment line")
beepDisplay
>Saturday 20-Jul-91 21:20:30
Flush right the cursor line from cursor rightward
<shftAlt-3:
..back up to first space
if (!is(curFile,sLine)) {
while(!(is(curFile,whiteSpace) | is(curFile,sLine))) moveCursor(curFile,sChar) }
..flush left, it might have been too far right
if (!is(curFile,sLine)) {
while (is(curFile,whiteSpace) & !is(curFile,sLine)) {
clearChar(curFile)
moveCursor(curFile,sChar) }
moveCursor(curFile,eChar)
insertChar(curFile," ") }
equateLoc(curFile,locA,atCursor)
..compute space at right end
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
..delete spaces at right end
moveCursor(curFile,sChar)
while (is(curFile,space)) {
clearChar (curFile)
moveCursor(curFile,sChar) }
locToCol(curFile,n4,atCursor)
decNum(n4)
getLocal(curFile,n3,lineLength)
sub(n4,n3,n4)
moveCursor(curFile,locA)
..flush right
if (gtNum(n4,0)) while (decNum(n4)) insertChar(curFile," ")
equateLoc(curFile,sHilite,eHilite)
refreshDisplay
>Saturday 20-Jul-91 21:28:09
Flush right ..comments from cursor line forward (ask)
<alt-4:
setSearch("..")
if (!search(curFile,sHilite,eHilite,1)) {
putMsg("NO ..comment lines below here")
return }
else {
vScroll(atCursor)
updateDisplay
putMsg("search upArrow, downArrow, f=flush right, q=quit") }
LABEL(0) ..search/comment/uncomment loop
getKeyVal(macroNum,inputChar)
equateNum(n0,77)
LABEL(1)
switch(macroNum) {
case(77) { ..downArrow
setSearch("..")
equateNum(n0,macroNum)
if (!search(curFile,sHilite,eHilite,1)) {
putMsg("NO ..comment lines below here")
return }
else {
vScroll(atCursor)
updateDisplay
putMsg("search upArrow, downArrow, f=flush right, q=quit") } }
case(76) { ..upArrow
setSearch("..")
equateNum(n0,macroNum)
if (!search(curFile,sHilite,eHilite,-1)) {
putMsg("NO ..debug lines above here")
return }
else {
vScroll(atCursor)
updateDisplay
putMsg("search upArrow, downArrow, f=flush right, q=quit") } }
case(35) { ..flush
runKey(alt-3)
updateDisplay
equateNum(macroNum,n0)
switch(macroNum) {
case(77) {moveCursor(curFile,eLine) }
case(76) {moveCursor(curFile,sLine) } }
goto label(1) }
case("q") {putMsg("Quit flush ..comment right") return}
default {putMsg("Quit flush ..comment right") beepDisplay return} }
goto label(0)
>Tuesday 23-Jul-91 22:19:48
Match indent of cursor line to previous line, move down
<alt-5:
equateNum(n14,0)
moveCursor(curFile,upLine)
if (!getFlag(curFile,autoIndent)) {
flipFlag(curFile,autoIndent)
equateNum(n14,1)
}
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
clearChar(curFile)
typeChar(eLine)
if (eqNum(n14,1)) flipFlag(curFile,autoIndent)
moveCursor(curFile,downLine)
equateLoc(curFile,sHilite,eHilite)
refreshDisplay
>Saturday 22-Jun-91 13:13:14
Change end-of-line (eLine) character (normal is ASCII 10)
<alt-e:
if (askYesNo("Change existing EOLs for whole file?")) {
runKey(ctl-e)
returnTrue }
putMsg("Input new EOL value (usually 10 or 13):")
inputNum(n14)
setEol(n14)
updateDisplay
>Saturday 22-Jun-91 12:42:52
Change all current file's end-of-line characters
<shftAlt-e:
freeBuf(buf50)
insertRgn(buf50,sFile,
"Input file's current end-of-line value (usually 10 or 13): old=",all)
moveCursor(curFile,sFile)
moveCursor(curFile,eLine)
copyChar(curFile,n0)
toWord(buf50,n0)
putMsg(buf50)
inputNum(n14)
if (!gtNum(n14,0)) returnFalse
putMsg("Input new end-of-line value (usually 10 or 13):")
inputNum(n13)
if (!gtNum(n13,0)) returnFalse
setEol(n14)
moveCursor(curFile,sFile)
putMsg("Changing eol characters... Amiga-ESC=abort.")
if (is(curFile,n14)) swapChar(curFile,n13)
while (moveCursor(curFile,eLine))
if (is(curFile,n14)) swapChar(curFile,n13)
setEol(n13)
vScroll(sFile)
freeBuf(buf50)
insertRgn(buf50,sFile,
"Existing EOLs changed for whole file and new EOL set: ",all)
toWord(buf50,n0)
putMsg(buf50)
updateDisplay
>Thursday 11-Jul-91 16:12:02
Sort lines in curFile.
<shftAlt-s:
sortLines(curFile,0)
>Saturday 08-Jun-91 20:33:55
==== PREKEY ====
Record present and last text entry locations
<preKey:
..have to have a way to kill it
if (eqNum(macroNum,shftAltCtl-esc)) killKey(preKey)
if (!eqNum(inputChar,0) | eqNum(inputChar,10)) { ..printable
..kill any hilite
if (gtLoc(curFile,eHilite,sHilite)) {
runKey(ctl-3)
if (eqNum(inputChar,10)) updateDisplay }
runKey(43) ..update locD,locE
}
>Friday 12-Jul-91 09:42:50
|
| used when text is being changed:
| prekey, (text entry)
| {normal,shft,alt,ctl}-bs (delete char,word,sen,par)
| normal-del (delete char)
| ctl-{d,x,v} (cut,paste)
| shftCtl-{d,x} (cut)
| shft-del (undo=paste)
| alt-buttonDown (move hilite)
| shftAlt-buttonDown (copy hilite to new loc)
|
Note change in editing location
<43:
if (gtNum(n60,0)) { ..changing text after move
equateLoc(curFile,locD,locE) ..push old loc to locD
equateNum(n60,0) } ..move is over
equateLoc(curFile,locE,atCursor) ..record current loc
>Saturday 08-Jun-91 20:33:53
==== BOOKMARKS ====
|
| locD = text entry before last large move (bookmark -1)
| locE = last text entry (bookmark 0)
| locF-locJ = bookmarks a-e (locH is compile mark)
| remember: you get a beep if you compile this with bookmark c
|
Set bookmark or move to a bookmark.
<normal-gadget3:
mouseXY(n10,n11) ..n10, n11 = mouse x,y = switch parameter
sub(n10,n10,320) ..first pixel in gadget 3 (40col)x(8pix)
div(n10,n10,8) ..character width
add(n10,n10,1) ..map to mark #
..putMsg(n10)..debug
switch(n10) {
case(1) { ..set a
incNum(27)
equateLoc(curFile,locF,atCursor)
beepDisplay }
case(2) { ..b
incNum(28)
equateLoc(curFile,locG,atCursor)
beepDisplay }
case(3) { ..c
equateLoc(curFile,locH,atCursor)
beepDisplay }
case(4) { ..d
equateLoc(curFile,locI,atCursor)
equateNum(n66,curFile)
beepDisplay }
case(5) { ..e
equateLoc(curFile,locJ,atCursor)
equateNum(n67,curFile)
beepDisplay }
case(10) { ..SETc go to c and compile
incNum(n21) ..profile
equateLoc(curFile,locA,atCursor)
moveCursor(curFile,locH)
if (is(curFile,"<")) {
equateLoc(curFile,sHilite,atCursor)
moveCursor(curFile,eLine)
equateLoc(curFile,eHilite,atCursor)
freeBuf(buf50)
insertRgn(buf50,sFile,curFile,hilite)
moveCursor(curFile,locH)
if (runKey(normal-f6)) {
insertRgn(buf50,eFile," compiled",all)
putMsg(buf50)
moveCursor(curFile,locA)
refreshDisplay } } }
case(11) { ..char 11&12=-1=go to text entry loc before last
incNum(n22) ..profile
equateLoc(curFile,atCursor,locD)
..if first large move after text entry, have prekey back up loc
if (eqNum(n60,0)) equateNum(n60,1)
vScroll(atCursor) }
case(12) {
incNum(n22) ..profile
equateLoc(curFile,atCursor,locD)
if (eqNum(n60,0)) equateNum(n60,1)
vScroll(atCursor) }
case(14) { ..14 go to last text entry
incNum(n23) ..profile
equateLoc(curFile,atCursor,locE)
if (eqNum(n60,0)) equateNum(n60,1)
vScroll(atCursor) }
case(15) { ..go to a
incNum(n24) ..profile
equateLoc(curFile,atCursor,locF)
if (eqNum(n60,0)) equateNum(n60,1)
vScroll(atCursor) }
case(16) { ..b
incNum(n25) ..profile
equateLoc(curFile,atCursor,locG)
if (eqNum(n60,0)) equateNum(n60,1)
vScroll(atCursor) }
case(17) { ..c
equateLoc(curFile,atCursor,locH)
if (eqNum(n60,0)) equateNum(n60,1)
vScroll(atCursor) }
case(18) { ..d
if (getFileName(buf50,buf[n66])) {
editBuf(buf[n66])
equateLoc(curFile,atCursor,locI)
if (eqNum(n60,0)) equateNum(n60,1)
vScroll(atCursor) }
else {
putMsg("Buffer containing bookmark d has been closed")
beepDisplay } }
case(19) { ..e
if (getFileName(buf50,buf[n67])) {
editBuf(buf[n67])
equateLoc(curFile,atCursor,locJ)
if (eqNum(n60,0)) equateNum(n60,1)
vScroll(atCursor) }
else {
putMsg("Buffer containing bookmark e has been closed")
beepDisplay } }
} ..gadget3 character # switch(n10)
runKey(ctl-3)
refreshDisplay
>Monday 29-Jul-91 14:31:23
==== HILITE & INVERT ====
Start hilite (need if mouseless or doing learned sequence)
<ctl-1:
..normal-mouseDown places cursor
equateLoc(curFile,sHilite,atCursor)
refreshDisplay
>Saturday 08-Jun-91 20:33:57
End hilite (need if mouseless or doing learned sequence)
<ctl-2:
equateLoc(curFile,eHilite,atCursor)
refreshDisplay
>Saturday 08-Jun-91 20:33:57
|
| Reset both sHilite and eHilite so we can move cursor with arrows without
| loosing the location. To create a hilite use ctl-3 first and then ctl-1 or
| ctl-2 to set the other end
|
Cancel hilite (need if mouseless or doing learned sequence)
<ctl-3:
equateLoc(curFile,sHilite, atCursor)
equateLoc(curFile,eHilite, atCursor)
refreshDisplay
>Saturday 08-Jun-91 20:33:57
Start invert
<ctl-4:
equateLoc(curFile,sInvert,atCursor)
refreshDisplay
>Saturday 08-Jun-91 20:33:57
End invert
<ctl-5:
equateLoc(curFile,eInvert,atCursor)
refreshDisplay
>Saturday 08-Jun-91 20:33:57
|
| Done the same way as hilite for consistency
|
Cancel invert
<ctl-6:
equateLoc(curFile,sInvert,atCursor)
equateLoc(curFile,eInvert,atCursor)
refreshDisplay
>Saturday 08-Jun-91 20:33:58
==== BUTTONDOWNS ====
Place cursor, dbl-click=pick up word, sngl=start hilite, scroll
<normal-buttonDown:
trackMouse ..until mouseUp
equateLoc(curFile,locA,mouseLoc) ..record start of sweep
equateLoc(curFile,atCursor,mouseLoc)
runKey(ctl-3) ..cancel old hilite
refreshDisplay ..show cursor
..delay(1) ..wait extra 1/10 sec for dbl click
..process first key after mouseDn, if it came already
if (inputWaiting) inputKey(n0) ..swallow mouseUp
..process second key after mouseDn, if it came already
if (inputWaiting & ..quick keystroke of some sort
inputKey(n0) & ..get it
eqLoc(curFile,atCursor,mouseLoc)) { ..same mouseLoc as previous key
..if there is a regular keystroke inside the delay, print it or do it
if (!eqNum(n0,96)) { ..quick key but not mouseDown
if (!eqNum(inputChar,0))
typeChar(inputChar)
else
switch(macroNum) {
..things we might do quickly after mouseDown
case(70) {runKey(normal-del) }
case(65) {runKey(normal-bs) }
case(66) {runKey(normal-tab) }
default {nothing} } }
else {..dblClick, pick up word
if (is(curFile,whiteSpace)) return
if (!is(curFile,sWord)) moveCursor(curFile,sWord)
equateLoc(curFile,sHilite,atCursor)
moveCursor(curFile,eWord)
equateLoc(curFile,eHilite,atCursor)
equateLoc(curFile,locA,atCursor)
refreshDisplay ..show hilited word
if (!isEmpty(buf49)) push(buf49,buf49) ..Alt-F7 will pop this search
insertRgn(buf49,sFile,curFile,hilite)
freeBuf(buf50)
insertRgn(buf50,sFile,"Search string is: ",all)
insertRgn(buf50,eFile,buf49,all)
putMsg(buf50)
return } }
..process first key after delay, if mouse is still down
..single click, or dbl too late, may sweep now
if (!mouseDown) return ..short click?
getSplitLines(n1,n2) ..determine row range of window
add(n1,n1,2) ..top row number
add(n2,n2,2) ..bottom row number
mul(n1,n1,8) ..n1 = top pixel number,8 pix per row
mul(n2,n2,8) ..n2 = bottom pixel number
if (!mouseDown) return ..too short a sweep
while (!inputWaiting) { ..mouseUp or anything will terminate tracking
trackMouse
..continuously update hilite
if (gtLoc(curFile,locA,mouseLoc)) { ..moving left
equateLoc(curFile,sHilite,mouseLoc)
equateLoc(curFile,atCursor,mouseLoc)
equateLoc(curFile,eHilite,locA) }
else { ..moving right
equateLoc(curFile,eHilite,mouseLoc)
equateLoc(curFile,atCursor,mouseLoc)
equateLoc(curFile,sHilite,locA) }
..scroll only if mouse is in scroll regions
mouseXY(n3,n4)
if (geNum(n4,n2)) { ..mouse at bottom of screen
vscroll(2) ..speed up this direction
refreshDisplay }
else if (geNum(n1,n4)) { ..mouse at top of screen
vscroll(-1)
refreshDisplay }
else ..do not scroll
refreshDisplay } ..show new hilite
equateLoc(curFile,atCursor,eHilite) ..leave cursor at end
refreshDisplay ..show cursor at eHilite if swept backward
>Tuesday 30-Jul-91 19:24:37
|
| to right of sHilite adjusts eHilite
| to left of sHilite adjusts sHilite
|
Adjust hilite if any
<shft-buttonDown:
if (gtLoc(curFile,eHilite,sHilite)) {
equateLoc(curFile,atCursor,mouseLoc)
if (gtLoc(curFile,atCursor,sHilite)) {
equateLoc(curFile,eHilite,atCursor)
refreshDisplay }
else {
equateLoc(curFile,sHilite,atCursor)
refreshDisplay } }
>Saturday 08-Jun-91 20:33:58
|
| if no hilite, if sweep pick up search
| if hilite, in hilite pick up search
| if hilite, outside hilite, no sweep move hilite
| if hilite, outside hilite, sweep inverts, swap hilite and invert
| swap doesn't work if swapping right to left and no space inbetween because
| we cut invert and insert it at start of hilite, then move hilite, but
| the hilite moves to where it was at the right of the invert.
|
Move hilite, swap new sweep with old, pick up search, pick up hilite as search
<alt-buttonDown:
if (!gtLoc(curFile,eHilite,sHilite)) { ..no hilite, may sweep
equateLoc(curFile,sHilite,mouseLoc)
equateLoc(curFile,eHilite, mouseLoc)
equateLoc(curFile,locA,mouseLoc)
while (!inputWaiting) { ..any input will terminate tracking
trackMouse
..update Hilite definition
if (gtLoc(curFile,locA,mouseLoc)) { ..moving left
equateLoc(curFile,sHilite,mouseLoc)
equateLoc(curFile,atCursor,mouseLoc)
equateLoc(curFile,eHilite,locA)
refreshDisplay }
else { ..moving right
equateLoc(curFile,eHilite,mouseLoc)
equateLoc(curFile,atCursor,mouseLoc)
equateLoc(curFile,sHilite,locA)
refreshDisplay } }
if (gtLoc(curFile,eHilite,sHilite)) { ..swept to hilite block
if (!isEmpty(buf49)) push(buf49,buf49)
insertRgn(buf49,sFile,curFile,hilite)
freeBuf(buf55)
insertRgn(buf55,sFile,"Search string is: ",all)
insertRgn(buf55,eFile,buf49,all)
putMsg(buf55)
runKey(normal-F9) ..CsSearch forward
returnTrue } }
if (geLoc(curFile,mouseLoc,sHilite) &
geLoc(curFile,eHilite,mouseLoc)) { ..in hilite, pick up search
if (!isEmpty(buf49)) push(buf49,buf49)
insertRgn(buf49,sFile,curFile,hilite)
freeBuf(buf50)
insertRgn(buf50,sFile,"Search string is: ",all)
insertRgn(buf50,eFile,curFile,hilite)
putMsg(buf50)
runKey(normal-f9) ..CsSearch forward
returnTrue }
..mouse outside hilite, move or swap
equateLoc(curFile,locA,sHilite) ..locA = original sHilite
equateLoc(curFile,locB,mouseLoc) ..locB = start of new area
equateLoc(curFile,sInvert,locB)
equateLoc(curFile,eInvert,locB)
while (trackMouse) {
if (gtLoc(curFile,mouseLoc,locB))
equateLoc(curFile,eInvert,mouseLoc)
else
equateLoc(curFile,sInvert,mouseLoc)
refreshDisplay }
equateLoc(curfile,locC,mouseLoc) ..locC = end of new area
if(gtLoc(curFile,locC,locB)) { ..swap
...copy invert, delete, insert at sHilite
equateLoc(curFile,sInvert,locB)
equateLoc(curFile,eInvert,locC) }
if(gtLoc(curFile,locB,locC)) { ..swap
...copy invert, delete, insert at sHilite
equateLoc(curFile,sInvert,locC)
equateLoc(curFile,eInvert,locB) }
refreshDisplay
freeBuf(buf46)
insertRgn(buf46,sFile,curFile,invert)
clearRgn(curFile,invert)
insertRgn(curFile,locA,buf46,all)
..copy hilite, delete, insert at locB (mouseDown loc)
if (!isEmpty(buf47)) {
push(buf47,buf47)
putMsg("Stacked old copy/cut") }
else
putMsg(" ")
insertRgn(buf47,sFile,curFile,hilite)
clearRgn(curFile,hilite)
equateLoc(curFile,sHilite,locB)
decLoc(curFile,sHilite)
insertRgn(curFile,locB,buf47,all)
if (eqLoc(curFile,sHilite,locB)) ..cursor must have been at sFile
equateLoc(curFile,sHilite,sFile)
else
incLoc(curFile,sHilite)
moveCursor(curFile,locB)
equateLoc(curFile,eHilite,atCursor)
runKey(43) ..update locD,locE
if (gtLoc(curFile,sPage,sHilite)) vScroll(sHilite)
..putMsg(" ")
refreshDisplay
>Tuesday 30-Jul-91 19:37:06
|
| adding shft to alt-buttonDown copies the hilight to the cursor
| the inserted copy is hilighted to make undo easy
|
Copy hilite to new location, hilite insertion
<shftAlt-buttonDown:
if (eqLoc(curFile,sHilite,eHilite)) {
putMsg("No hilite to duplicate")
return }
equateLoc(curFile,atCursor,mouseLoc)
if (!isEmpty(buf47)) {
push(buf47,buf47)
putMsg("Stacked old copy/cut") }
else
putMsg(" ")
insertRgn(buf47,sFile,curFile,hilite)
equateLoc(curFile,sHilite,atCursor)
equateLoc(curFile,locB,atCursor)
decLoc(curFile,sHilite)
insertRgn(curFile,atCursor,buf47,all)
if (eqLoc(curFile,sHilite,locB)) ..cursor must have been at sFile
equateLoc(curFile,sHilite,sFile)
else
incLoc(curFile,sHilite)
equateLoc(curFile,eHilite,atCursor)
runKey(43) ..update locD,locE
if (gtLoc(curFile,sPage,sHilite)) vScroll(sHilite)
putMsg(" ")
refreshDisplay
>Wednesday 24-Jul-91 10:46:14
==== CUT, COPY & PASTE using Buffer A (buf47) ====
Copy hilite or sentence into Buffer A, stack old
<ctl-c:
if (!isEmpty(buf47)) {
push(buf47,buf47)
putMsg("Stacked old copy/cut") }
else
putMsg(" ")
runKey(shftCtl-c)
equateLoc(curFile,locC,atCursor)
>Wednesday 24-Jul-91 10:42:18
Copy hilite or sentence, adding it into Buffer A at eFile
<shftCtl-c:
if(eqLoc(curFile,sHilite,eHilite)) { ..find sentence
..alertUser("no hilite, finding sentence")..debug
runKey(alt-rightArrow) ..kills hilite
equateLoc(curFile,locA,atCursor)
equateLoc(curFile,eHilite,atCursor)
runKey(alt-leftArrow)
equateLoc(curFile,sHilite,atCursor)
equateLoc(curFile,eHilite,locA) }
..alertUser("copying hilite")..debug
insertRgn(buf47,eFile,curFile,hilite) ..copy hilite or sentence
moveCursor(curFile,eHilite)
runKey(43) ..update locD,locE
delay(5) ..show it
equateLoc(curFile,sHilite,eHilite)
refreshDisplay
>Wednesday 24-Jul-91 10:42:19
Cut cursor line into Buffer A at eFile, adding if no cursor move (ignores hilite)
<ctl-d:
..if cursor has moved since last copy/cut stack buf47 first
if (!eqLoc(curFile,locC,atCursor)) {
if (!isEmpty(buf47)) {
push(buf47,buf47)
putMsg("Stacked old copy/cut") }
else
putMsg(" ") }
runKey(shftCtl-d)
equateLoc(curFile,locC,atCursor)
>Wednesday 24-Jul-91 10:42:20
Cut cursor line, adding it into Buffer A at eFile (ignores hilite)
<shftCtl-d:
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
equateLoc(curFile,sHilite,atCursor)
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
moveCursor(curFile,eChar)
equateLoc(curFile,eHilite,atCursor)
insertRgn(buf47,eFile,curFile,hilite)
clearRgn(curFile,hilite)
runKey(43) ..update locD,locE
>Wednesday 24-Jul-91 10:42:21
Cut hilite or sentence into Buffer A, stack old
<ctl-x:
if (!isEmpty(buf47)) {
push(buf47,buf47)
putMsg("Stacked old copy/cut") }
else
putMsg(" ")
runKey(shftCtl-x)
equateLoc(curFile,locC,atCursor)
>Wednesday 24-Jul-91 10:42:21
Cut sentence or hilite always adding it into Buffer A at eFile
<shftCtl-x:
if(eqLoc(curFile,sHilite,eHilite)) { ..find sentence
runKey(alt-rightArrow) ..kills hilite
equateLoc(curFile,locA,atCursor)
equateLoc(curFile,eHilite,atCursor)
runKey(alt-leftArrow)
equateLoc(curFile,sHilite,atCursor)
equateLoc(curFile,eHilite,locA) }
insertRgn(buf47,eFile,curFile,hilite) ..copy hilite or sentence
moveCursor(curFile,eHilite)
clearRgn(curFile,hilite)
runKey(43) ..update locD,locE
delay(5) ..show it
equateLoc(curFile,sHilite,eHilite)
refreshDisplay
>Wednesday 24-Jul-91 10:42:22
Insert Buffer A at cursor (last copy or cut)
<ctl-v:
..prepare to hilite insertion
equateLoc(curFile,eHilite,atCursor)
equateLoc(curFile,sHilite,atCursor)
decLoc(curFile,sHilite)
insertRgn(curFile,atCursor,buf47,all)
if (eqLoc(curFile,sHilite,eHilite)) ..cursor must have been at sFile
equateLoc(curFile,sHilite,sFile)
else
incLoc(curFile,sHilite)
equateLoc(curFile,locC,atCursor) ..free buf 47 before next copy/cut
runKey(43) ..update locD,locE
if (!onScreen(atCursor)) vScroll(eHilite)
putMsg(" ")
refreshDisplay
>Wednesday 31-Jul-91 18:42:33
Insert Buffer A stack at cursor (unlimited history), scan stack
<ctl-p:
if (!isEmpty(buf47)) {
push(buf47,buf47)
putMsg("Stacked current copy/cut") }
else
putMsg(" ")
equateNum(n0,47)
getStackSize(n0,n1,n2)
if (!gtNum(n0,0)) {
putMsg("Copy/cut stack is empty")
beepDisplay
returnFalse }
..putMsg(n0) alertUser("copy/clear stack size")..debug
pop(buf47,buf47)
runKey(ctl-v)
freeBuf(buf51)
insertRgn(buf51,sFile,
"search=arrowUp/Down, i=insert, d=delete item, c=clear stack, q=quit",all)
freeBuf(buf50)
toWord(buf50,n0)
insertRgn(buf50,eFile,": ",all)
insertRgn(buf50,eFile,buf51,all)
putMsg(buf50)
LABEL(0) ..search/comment/uncomment loop
getKeyVal(macroNum,inputChar)
LABEL(1)
switch(macroNum) {
case(77) { ..downArrow
clearRgn(curFile,hilite)
if (!isEmpty(buf47)) push(buf47,buf47)
rollStack(buf47,-1)
pop(buf47,buf47)
runKey(ctl-v)
putMsg(buf50) }
case(76) { ..upArrow
clearRgn(curFile,hilite)
if (!isEmpty(buf47)) push(buf47,buf47)
rollStack(buf47,1)
pop(buf47,buf47)
runKey(ctl-v)
putMsg(buf50) }
case(23) { ..i
if (!isEmpty(buf47)) push(buf47,buf47)
putMsg("Quit copy/cut scan. left insert")
beepDisplay
returnTrue }
case(34) { ..d
if (askYesNo("DELETE this block from file AND copy/cutstack?")) {
clearRgn(curFile,hilite)
freeBuf(buf47)
refreshDisplay
equateNum(n15,"b")
freeBuf(buf50)
equateNum(n0,47)
getStackSize(n0,n1,n2)
toWord(buf50,n0)
insertRgn(buf50,eFile,": ",all)
insertRgn(buf50,eFile,buf50,all)
equateNum(macroNum,77) ..move to next
goto label(1) } }
case(51) { ..c
if (gtNum(n0,0)) {
if (askYesNo("CLEAR copy/cut stack?")) {
while (gtNum(n0,0)) {
pop(buf47,buf55)
decNum(n0) }
if (askYesNo("CLEAR copy/cut paste buffer A also?"))
freeBuf(buf47) } }
putMsg(" ")
returnTrue }
case(16) { ..q
clearRgn(curFile,hilite)
if (!isEmpty(buf47)) push(buf47,buf47)
putMsg("QUIT copy/cut scan")
returnTrue}
default {
clearRgn(curFile,hilite)
if (!isEmpty(buf47)) push(buf47,buf47)
putMsg("QUIT copy/cut scan")
beepDisplay
returnTrue} }
goto label(0)
>Wednesday 24-Jul-91 13:02:49
==== DELETE & UNDO using Buffer B (buf45) ====
Delete char to left of cursor or hilite into Buffer B
<normal-bs:
..locC records the last location after a DEL, BS, or shft-BS
if (eqLoc(curFile,sHilite,eHilite)) {
if (!eqLoc(curFile,locC,atCursor)) freeBuf(buf45) ..clear old delete
equateLoc(curFile,locC,atCursor) ..record present loc
equateLoc(curFile,locB,atCursor)
moveCursor(curFile,sChar) ..copy char
equateLoc(curFile,locA,atCursor)
insertRgn(buf45,sFile,curFile,loc)
clearRgn(curFile,loc) }
else {
freeBuf(buf45)
insertRgn(buf45,eFile,curFile,hilite)
clearRgn(curFile,hilite) }
runKey(43) ..update locD,locE
>Saturday 08-Jun-91 20:33:55
Delete word or part to left into Buffer B
<shft-bs:
if (!eqLoc(curFile,locC,atCursor)) freeBuf(buf45)
equateLoc(curFile,locC,atCursor)
equateLoc(curFile,eHilite,atCursor)
moveCursor(curFile,sWord)
equateLoc(curFile,sHilite,atCursor)
insertRgn(buf45,sFile,curFile,hilite)
clearRgn(curFile,hilite)
runKey(43) ..update locD,locE
putMsg("Use Shft-DEL to undo")
>Saturday 08-Jun-91 20:33:55
Delete sentence or part to left into Buffer B
<alt-bs:
if (!eqLoc(curFile,locC,atCursor)) freeBuf(buf45)
equateLoc(curFile,locC,atCursor)
equateLoc(curFile,eHilite,atCursor)
runKey(alt-leftArrow)
equateLoc(curFile,sHilite,atCursor)
..alertUser("sentence to delete")
refreshDisplay
delay(5) ..show it
insertRgn(buf45,sFile,curFile,hilite)
clearRgn(curFile,hilite)
runKey(43) ..update locD,locE
putMsg("Use Shft-DEL to undo")
>Saturday 08-Jun-91 20:33:56
Delete paragraph or part to left into Buffer B
<ctl-bs:
if (!eqLoc(curFile,locC,atCursor)) freeBuf(buf45)
equateLoc(curFile,locC,atCursor)
equateLoc(curFile,eHilite,atCursor)
..move back at least one sentence so that we can join paragraphs
runKey(alt-leftArrow)
..find blankLine or change in indent
..first find first !whiteSpace on this line
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
while (is(curFile,whiteSpace)) moveCursor(curFile,eChar)
getPageRowCol(n0,n1,n2)
..putMsg(n2) alertUser("n2 cursor line starts here")
While (nothing) {
moveCursor(curfile,upLine)
if (is(curFile,blankLine)) {
moveCursor(curFile,downLine)
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
goto label(0) }
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
while (is(curFile,whiteSpace)) moveCursor(curFile,eChar)
..alertUser("found !whiteSpace")
getPageRowCol(n0,n1,n3)
..putMsg(n3) alertUser("n3")
if (!eqNum(n2,n3)) {
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
goto label(0) } }
LABEL(0)
equateLoc(curFile,sHilite,atCursor)
alertUser("par to delete")
refreshDisplay
delay(5) ..show it
insertRgn(buf45,sFile,curFile,hilite)
clearRgn(curFile,hilite)
runKey(43) ..update locD,locE
putMsg("Use Shft-DEL to undo")
>Saturday 08-Jun-91 20:33:56
Delete char under cursor or hilite into Buffer B
<normal-del:
if (eqLoc(curFile,sHilite,eHilite)) { ..delete char
if (!eqLoc(curFile,locC,atCursor))
freeBuf(buf45) ..discard old delete
equateLoc(curFile,sHilite,atCursor)
moveCursor(curFile,eChar)
equateLoc(curFile,eHilite,atCursor)}
else { ..delete existing hilite
freeBuf(buf45) }
insertRgn(buf45,eFile,curFile,hilite)
clearRgn(curFile,hilite)
runKey(43) ..update locD,locE
equateLoc(curFile,locC,atCursor)
>Saturday 08-Jun-91 20:33:56
Insert last block of deletions at cursor (undo from Buffer B)
<shft-del:
..prepare to hilite insertion
equateLoc(curFile,eHilite,atCursor)
equateLoc(curFile,sHilite,atCursor)
decLoc(curFile,sHilite)
insertRgn(curFile,atCursor,buf45,all)
if (eqLoc(curFile,sHilite,eHilite)) ..locA must have been at sFile
equateLoc(curFile,sHilite,sFile)
else
incLoc(curFile,sHilite)
equateLoc(curFile,locC,sHilite) ..free buf45 before next delete
runKey(43) ..update locD,locE
if (gtLoc(curFile,sPage,sHilite)) vScroll(sHilite)
putMsg(" ")
updateDisplay
>Saturday 08-Jun-91 20:33:56
==== TABS ====
Show tab ruler above cursor line
<shftAlt-tab:
seeRuler
>Saturday 08-Jun-91 20:34:01
Set tab ruler using mouse or keys
<shftCtl-tab:
putMsg(
"Use mouse click/drag, Tab, Space, BS, Del (anykey=quit,Amiga-ESC=abort)")
setRuler putMsg(" ")
>Saturday 08-Jun-91 20:34:01
Switch to/from using spaces for tabs or using real tabs
<altCtl-tab:
flipFlag(curFile,trueTabs)
>Saturday 08-Jun-91 20:34:01
Convert tabs in document to spaces
<lAmiga-tab:
tabsToSpaces
>Saturday 08-Jun-91 20:34:01
Convert spaces in document to TABs
<rAmiga-tab:
spacesToTabs
>Saturday 08-Jun-91 20:34:01
Set TAB table number (0-4) to use for TAB spacing
<shftAltCtl-tab:
getLocal(curFile,n0,tabTable)
freeBuf(buf50)
insertRgn(buf50,sFIle,"Enter new tab table # (0-4): old=",all)
toWord(buf50,n0)
putMsg(buf50)
if (inputNum(n0) & geNum(n0,0) & geNum(4,n0)) {
setLocal(curFile,tabTable,n0)
equateNum(tabTable,n0) }
>Thursday 11-Jul-91 21:34:30
bug..indent sometimes hangs up
bug..must cope with trueTabs in margin
Indent-Outdent a block of lines
<shft-tab:
putMsg("Input incremental indent, +-n:")
inputNum(n10)
moveCursor(curFile,sHilite)
if (gtNum(n10,0)) { ..+ indent
..putMsg("starting indent")..debug
while (gtLoc(curFile,eHilite,atCursor)) {
..alertUser("starting a line")..debug
equateNum(n11,n10)
while (gtNum(n11,0)) {
insertChar(curFile," ")
decNum(n11) }
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
if (!moveCursor(curFile,downline)) return
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
..alertUser("finished a line")
} }
else { ..- delete indent
while (gtLoc(curFile,eHilite,atCursor)) {
..alertUser("starting a line")..debug
if (is(curFile,blankLine)) goto label(0) ..skip empty or spaces only
equateNum(n11,n10)
while (gtNum(0,n11)) {
if (is(curFile,9)) alertUser("trueTab in margin") ..debug
if (!is(curFile,whiteSpace)) {
vScroll(atCursor)
alertUser
("Aborted: On this line the requested deletion > total indent")
return }
clearChar(curFile)
incNum(n11) }
LABEL(0)
if (!moveCursor(curFile,downline)) return
if (eqLoc(curFile,eHilite,atCursor)) return
if (!is(curFile,sLine)) moveCursor(curFile,sLine) } }
..alertUser("finished a line")
>Sunday 07-Jul-91 23:03:13
==== CHAR ====
Convert char under cursor or hilight to upper case
<ctl-u:
if (gtLoc(curFile,eHilite,sHilite)) {
moveCursor(curFile,sHilite)
while (gtLoc(curFile,eHilite,atCursor)) {
toUpper(curFile)
moveCursor(curFile,eChar) } }
else {
toUpper(curFile)
moveCursor(curFile,eChar) }
>Friday 21-Jun-91 17:53:08
Capatalize first letter of each word in hilite
<altCtl-u:
if (gtLoc(curFile,eHilite,sHilite)) {
moveCursor(curFile,sHilite)
equateNum(n0,0)
while (gtLoc(curFile,eHilite,atCursor)) {
if (eqNum(n0,0))
toUpper(curFile)
else
toLower(curFile)
if (!is(curFile,alpha))
equateNum(n0,0)
else
equateNum(n0,1)
moveCursor(curFile,eChar) }
refreshDisplay }
else
putMsg("NO HILITE")
>Friday 21-Jun-91 18:18:33
Convert char under cursor r hilight to lower case
<ctl-l:
if (gtLoc(curFile,eHilite,sHilite)) {
moveCursor(curFile,sHilite)
while (gtLoc(curFile,eHilite,atCursor)) {
toLower(curFile)
moveCursor(curFile,eChar) } }
else {
toLower(curFile)
moveCursor(curFile,eChar) }
>Friday 21-Jun-91 17:54:18
Insert CTRL-character, such as formfeed, etc
<shftAlt-c:
..31=00011111, so we mask out three hightest bits
..maps [@A..Z[\]^_] and [`a..z{|}~DEL] to [0..31]
putMsg("Input a control character:")
getChar(n14)
if (geNum(31,n14) | (geNum(n14,64) & geNum(127,n14))) {
and(n14,n14,31)
insertChar(curFile,n14)
}
putMsg(" ")
>Friday 28-Jun-91 20:39:42
==== OVERSTRIKE, RIGHT JUSTIFY, AUTOINDENT, WORDWRAP ====
Toggle overstrike typing mode
<shft-f5:
flipFlag(curFile,overstrike)
>Saturday 08-Jun-91 20:34:03
Toggle the right-justify typing mode
<ctl-j:
flipFlag(curFile,rightJustify)
if (getFlag(curFile,rightJustify))
putMsg("RightJustify is ON")
else
putMsg("RightJustify is OFF")
>Saturday 08-Jun-91 20:34:03
Toggle autoindent typing mode
<alt-f5:
flipFlag(curFile,autoIndent)
>Sunday 09-Jun-91 17:50:27
Toggle wordwrap typing mode
<ctl-f5:
flipFlag(curFile,wordWrap)
>Sunday 09-Jun-91 17:50:28
Toggle changed status of curFile
<lAmiga-f5:
flipFlag(curFile,changed)
>Tuesday 30-Jul-91 23:06:06
Toggle displaying of cursor page:row,column
<lAmiga-f4:
flipFlag(curFile,rowCol)
>Tuesday 30-Jul-91 23:06:07
==== PAGE FORMAT ====
Set new line-length for this file only
<ctl-return:
getLocal(curFile,n15,lineLength) ..save old, n14=0 if no input
freeBuf(buf53)
insertRgn(buf53,sFile,"Enter new line-length: old=",all)
toWord(buf53,n15)
putMsg(buf53)
if (inputNum(n14))
setLocal(curFile,lineLength,n14)
else
setLocal(curFile,lineLength,n15)
equateNum(n15,lineLength)
freeBuf(buf53)
insertRgn(buf53,sFile,"Set global lineLength to local value? old global=",all)
toWord(buf53,n15)
if (askYesNo(buf53))
equateNum(lineLength,n13)
>Saturday 08-Jun-91 20:34:03
Input a new lines/page value for this file only
<lAmiga-p:
..determines location of sPage and ePage
freeBuf(buf50)
insertRgn(buf50,eFile,"Enter new lines/page (1-200): old=",all)
getLocal(curFile,n14,pageLines)
toWord(buf50,n14)
putMsg(buf50)
inputNum(n14)
if (gtNum(n14,0)) {
setLocal(curFile,pageLines,n14)
equateNum(pageLines,n14) }
>Tuesday 09-Jul-91 19:01:35
Set top margin for this file only
<lAmiga-u:
freeBuf(buf50)
insertRgn(buf50,eFile,"Enter new top margin lines (0-200): old=",all)
getLocal(curFile,n14,topMargin)
toWord(buf50,n14)
putMsg(buf50)
if (inputNum(n14)) equateNum(topMargin,n14)
setLocal(curFile,topMargin,topMargin)
>Tuesday 09-Jul-91 18:59:59
Set bottom margin for this file only
<lAmiga-l:
freeBuf(buf50)
insertRgn(buf50,eFile,"Enter bottom margin lines (0-200):",all)
getLocal(curFile,n14,bottomMargin)
toWord(buf50,n14)
putMsg(buf50)
if (inputNum(n14)) equateNum(bottomMargin,n14)
setLocal(curFile,bottomMargin,bottomMargin)
>Tuesday 09-Jul-91 19:00:01
Center text in the line. (Uses current line length.)
<alt-c:
..clear leading spaces
equateLoc(curFile,locA,atCursor)
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
while (is(curFile,whiteSpace) & !is(curFile,eLine) & !is(curFile,12))
clearChar(curFile)
equateLoc(curFile,atCursor,locA)
if (is(curFile,blankLine)) returnFalse
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
locToCol(curFile,n13,atCursor)
getLocal(curFile,n14,lineLength)
if (gtNum(n14,n13)) {
moveCursor(curFile,sLine)
incNum(n14)
sub(n13,n14,n13)
div(n13,n13,2)
do (n14,1,n13) insertChar(curFile," ") }
>Saturday 08-Jun-91 20:34:04
==== PARAGRAPH FORMAT ====
Reformat cursor paragraph, starting at cursor line, skip blankLines
<ctl-f:
..returnFalse if no text ahead
equateLoc(curfile,locC,atCursor)
..skip blank lines, looking for eFile.
while (is(curFile,blankLine)) {
..alertUser("skippling blankLines looking for eFile")
moveCursor(curFile,downLine)
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
if (is(curFile,eFile)) returnFalse }
equateNum(n3,0) ..n3 flag 0=first line
LABEL(2)
..find start of text
..runKey(ctl-q) alertUser("LAB2 n3=0 first !blankLine, n3=1 second")
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
while (is(curFile,whiteSpace)) moveCursor(curFile,eChar)
locToCol(curFile,n0,atCursor) ..n0 = indent of this line
.. get indent of line (space,tab=whiteSpace)
if (eqNum(n3,0)) { .. if doing FIRST line
equateLoc(curFile,locB,atCursor) ..store 1st text location
..alertUser("locB")
equateNum(n3,1) ..n3 flag 1 = !first line
equateNum(n1,n0) ..n1 = first indent
moveCursor(curFile,downLine) .. move to 2nd line
if (is(curFile,blankLine)) { .. no second line
equateNum(n3,-1) ..n0 flag -1 = second is blank
goto label(3)
}
goto label(2) .. go back and get indent of 2nd par line
}
LABEL(3)
moveCursor(curFile,locB) .. move back to 1st line
equateNum(n2,n0) ..n2 = second indent, if any
..runKey(ctl-q) alertUser("LAB3 examined first two lines")
if (eqNum(n3,-1) | (eqNum(n1,1) & eqNum(n2,1)))
..if next line is blank just close gaps
..if next line is also not indented, treat as same paragraph
{ reformat
equateLoc(curFile,locB,atCursor) } ..store end of par
else {
if (gtNum(n1,n2)) {
.. 2nd line has less indent, x from n2 to n1
colToLoc(curFile,atCursor,n2)
equateLoc(curFile,locA,atCursor)
..alertUser("locA to clear")
}
else {
..2nd is indented same or more
..assume 1st is one line paragraph, x from sLine to n1
..mishandles block indented paragraph, see ctrl-b
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
equateLoc(curFile,locA,atCursor)
..alertUser("locA to clear")
equateNum(n2,1) }
clearRgn(curFile,loc) .. wiping out extra 1st line indent
while(gtNum(n1,n2)) {insertChar(curFile,"x") decNum(n1) }
..runKey(ctl-q) alertUser("put in x's")..debug
moveCursor(curFile,sWord) .. made a FAKE WORD
equateLoc(curFile,locA,atCursor) .. store its loc
reformat .. now paragrah has SAME indent
equateLoc(curFile,locB,atCursor) .. store end of par
moveCursor(curFile,locA) .. go back to fake word
while (is(curFile,"x")) { .. swap x's for spaces
swapChar(curFile," ")
moveCursor(curFile,eChar) }
equateLoc(curFile,atCursor,locB) } .. goto end of par
moveCursor(curFile,locC)
>Saturday 08-Jun-91 20:34:04
Reformat paragraph, go to end of paragraph
<ctl-g:
..returnFalse if ctl-f returnFalse, no text ahead
if (!runKey(ctl-f)) returnFalse
moveCursor(curFile,locB)
moveCursor(curFile,downLine)
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
>Saturday 08-Jun-91 20:34:05
Reformat block indented paragraph
<ctl-b:
equateLoc(curFile,locA,atCursor)
reformat
moveCursor(curFile,locA)
>Tuesday 30-Jul-91 22:55:23
Reformat whole document (ask), return to last atCursor
<ctl-a:
if (!askYesNo("Do you want to reformat the whole file")) return
putMsg("Formatting whole document, please wait....")
equateLoc(curFile,locD,atCursor)
moveCursor(curFile,sFile)
while (!eqLoc(curFile,atCursor,eFile)) runKey(ctl-g) ..reformat, go to end
equateLoc(curFile,atCursor,locD)
updateDisplay
putMsg(" ")
updateDisplay
>Wednesday 17-Jul-91 10:17:43
Reformat hanging indent, indented 3 chars, put cursor on outdent of first line
<ctl-h:
..locate start of text and join all lines
..upFlag(curFile,hideDisplay)
equateNum(n15,0)
if (gtLoc(curFile,eHilite,sHilite)) {
equateNum(n15,1) ..set flag
insertChar(curFile,eLine) ..insert blankLine at end just in case
moveCursor(curFile,sHilite) }
equateLoc(curFile,locC,atCursor)
getPageRowCol(n0,n1,n2)
insertChar(curFile,eLine)
if (is(curFile,blankLine)) returnFalse
LABEL(0) ..join text up to blankLine
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
if (is(curFile,eFile)) goto label(1)
moveCursor(curFile,downLine)
if (is(curFile,blankLine)) goto label(1)
moveCursor(curFile,upLine)
runKey(alt-j)
goto label(0)
LABEL(1)
..locate end of text to format
moveCursor(curFile,locC)
moveCursor(curFile,eLine)
equateLoc(curFile,locD,atCursor)
moveCursor(curFile,sLine)
reformat
moveCursor(curFile,locC)
clearChar(curFile)
getlocal(curFile,n10,lineLength)
sub(n10,n10,n2)
do(n11,1,n10) if (!is(curFile,eLine)) moveCursor(curFile,eChar)
while (!is(curFile,whiteSpace)) moveCursor(curFile,sChar)
insertChar(curFile,eLine)
if (gtLoc(curFile,atCursor,locD)) {
moveCursor(curFile,sChar)
clearChar(curFile)
moveCursor(curFile,locC)
returnTrue }
while (is(curFile,space)) clearChar(curFile)
LABEL(2)
if (!is(curFile,eLine)) moveCursor(curFile,eLine)
if (is(curFile,eFile)) goto label(4)
moveCursor(curFile,downLine)
if (is(curFile,blankLine)) goto label(3)
moveCursor(curFile,upLine)
runKey(alt-j)
goto label(2)
LABEL(3)
moveCursor(curFile,upLine)
LABEL(4)
if (!is(curFile,sLine)) moveCursor(curFile,sLine)
add(n2,n2,2)
do(n10,1,n2) insertChar(curFile," ")
if (!is(curFile,blankLine)) runKey(ctl-b)
if (eqNum(n15,1)) {
moveCursor(curFile,locD)
..moveCursor(curFile,sChar)
clearChar(curFile) }
moveCursor(curFile,locC)
..downFlag(curFile,hideDisplay)
>Sunday 28-Jul-91 09:40:01
==== SEARCH & REPLACE ====
Toggle case-sensitivity of search
<altCtl-f7:
flipFlag(curFile,searchCaps)
>Sunday 09-Jun-91 17:50:30
|
| n0 (TEMP GLOBAL) 1=search fwd, -1=search bkwd
|
CsSearch for buf49 match, embedded matches ignored
<virtual-s:
equateLoc(curFile,locA,atCursor)
freeBuf(buf50)
setSearch(buf49)
..putMsg(buf49) alertUser("search")..debug
LABEL(0) ..search loop
..after fwd find atCursor=eInvert, skip this one if now going bkwd
..note fwd search does not find it if cursor on first char
if (eqNum(n0,-1) & eqLoc(curFile,atCursor,eInvert))
moveCursor(curFile,sInvert)
if (search (curFile,sInvert,eInvert,n0)) {
..putMsg(buf49) alertUser("found candidate")..debug
..check for whole word
decLoc(curFile,atCursor)
..alertUser("checking left")
if (is(curFile,alpha) | is(curFile,digit)) {
..alertUser("alpha|numeric on left")
if (eqNum(n0,1)) moveCursor(curFile,eInvert)
goto label(0) } ..look for another candidate
moveCursor(curFile,eInvert)
..alertUser("checking right")
if (is(curFile,alpha) | is(curFile,digit)) {
..alertUser("alpha on right")
if (eqNum(n0,-1)) moveCursor(curFile,sInvert)
goto label(0) } ..look for another candidate
if (eqNum(n0,1))
insertRgn(buf50,sFile,"Next match forward",all)
else {
moveCursor(curFile,sInvert)
insertRgn(buf50,sFile,"Next match backward",all) }
runKey(ctl-3) ..cancel hilite
putMsg(buf50)
refreshDisplay
return }
else {
equateLoc(curFile,sInvert,eInvert)
if (eqNum(n0,1))
insertRgn(buf50,eFile," CS SEARCH FAILED, no match below here",all)
else
insertRgn(buf50,eFile," CS SEARCH FAILED, no match above here",all)
if (getFlag(curFile,searchCaps)) insertRgn(buf50,sFile," CASESENS",all)
insertRgn(buf50,sFile,buf49,all)
putMsg(buf50)
moveCursor(curFile,locA)
if (!onScreen(atCursor)) vScroll(atCursor)
return }
>Tuesday 30-Jul-91 19:17:48
|
| gadget1 name is | Search | File |
| nineteen characters wide
| Search = [1..9.5]
| File = [9.6..15]
|
Search forward or next buffer with a file
<normal-gadget1:
mouseXY(n0,n1)
div(n0,n0,40) ..1/2 character width x 10
add(n0,n0,1) ..map to region number [1..4]
switch(n0) {
case(1)
case(2) { equateNum(n0,1) runKey(virtual-s) }
case(3)
case(4) { runKey(Normal-f1) } }
>Sunday 21-Jul-91 12:44:30
Search backward or previous buffer with a file
<shft-gadget1:
mouseXY(n0,n1)
div(n0,n0,40) ..1/2 character width x 10
add(n0,n0,1) ..map to region number [1..4]
switch(n0) {
case(1)
case(2) { equateNum(n0,-1) runKey(virtual-s) }
case(3)
case(4) { runKey(shft-f1) } }
>Sunday 21-Jul-91 12:44:30
Type in new search wild-card characters
<shftCtl-f7:
putMsg("Input single wild-card char:")
getChar(wildCard)
putMsg("Input multi wild-card char:")
getChar(multiWild)
putMsg("White on single wildcards: 0=no, 1=space/tab, 2=all white:")
getChar(n14)
if (geNum(n14,"0") & geNum("2",n14)) sub(singleWhite,n14,"0")
putMsg("White on multi wildcards: 0=no, 1=space/tab, 2=all white:")
getChar(n14)
if (geNum(n14,"0") & geNum("2",n14)) sub(multiWhite,n14,"0")
putMsg("Input all-but delimiter char:")
getChar(allBut)
putMsg(" ")
>Sunday 09-Jun-91 17:50:28
Type in new search either-or character
<ctl-f7:
putMsg("Input new search either-or char:")
getChar(eitherOr)
putMsg(" ")
>Sunday 09-Jun-91 17:50:28
|
| Before clearing or modifying the search string, push the buffer
| Alt-f7 will pop the buffer if there is no hilite
| double click also pushes the buffer
|
Type in search string (push old) and CsSearch fwd. EitherOr = $, wilds= ? & *.
<normal-f7:
putMsg("Type in search string:")
if (!isEmpty(buf49)) push(buf49,buf49)
inputString(buf49)
setSearch(buf49)
runKey(normal-f9)
>Tuesday 16-Jul-91 23:07:57
Revise search string (push old) and search fwd
<shft-f7:
putMsg("Modify search string:")
freeBuf(buf50)
insertRgn(buf50,sFile,buf49,all)
if (!isEmpty(buf49)) push(buf49,buf50)
inputString(buf49)
setSearch(buf49)
runKey(normal-f9)
>Tuesday 16-Jul-91 23:07:59
Pick up hilite, or pop previous string, (push old, do not search)
<alt-f7:
if (gtLoc(curFile,eHilite,sHilite)) {
if (!isEmpty(buf49)) push(buf49,buf49)
insertRgn(buf49,sFile,curFile,hilite)
equateLoc(curFile,eHilite,sHilite) }
else {
equateNum(n0,49)
getStackSize(n0,n1,n2)
putMsg(n0) alertUser("search stack")
if (gtNum(n0,0))
pop(buf49,buf49)
else {
putMsg("Search stack is empty. Search string not changed.")
delay(10) } }
setSearch(buf49)
freeBuf(buf50)
if (eqNum(searchCaps,1)) insertRgn(buf50,sFile,"(CASE SENSITIVE)",all)
insertRgn(buf50,eFile,"Search string is: ",all)
insertRgn(buf50,eFile,buf49,all)
putMsg(buf50)
refreshDisplay
>Tuesday 16-Jul-91 23:08:02
Type in replace text to use in search-replace
<normal-f8:
freeBuf(buf48)
runKey(shft-f8)
>Sunday 09-Jun-91 17:50:29
Revise existing replace text
<shft-f8:
putMsg("Type in or modify replace string:")
inputString(buf48)
>Sunday 07-Jul-91 15:54:21
CsSearch forward, mark matched region, put cursor at end of rgn
<normal-f9:
equateNum(n0,1)
runKey(virtual-s)
>Wednesday 24-Jul-91 23:08:17
CsSearch backward, mark matched region, put cursor at start of rgn
<shft-f9:
equateNum(n0,-1)
runKey(virtual-s)
>Wednesday 24-Jul-91 23:08:17
Search forward, mark matched region, put cursor at end of rgn
<lAmiga-f9:
setSearch(buf49)
if (search(curFile,sInvert,eInvert,1)) {
equateLoc(curfile,atCursor,eInvert)
putMsg("Next match forward")
refreshDisplay
returnTrue }
else {
freeBuf(buf50)
insertRgn(buf50,sFile," SEARCH FAILED, no match below here",all)
if (eqNum(1,searchCaps)) insertRgn(buf50,sFile," (CASE SENSITIVE)",all)
insertRgn(buf50,sFile,buf49,all)
putMsg(buf50)
equateLoc(curFile,sInvert,eInvert)
refreshDisplay
returnFalse }
runKey(virtual-f9)
>Wednesday 24-Jul-91 23:08:18
Search backward, mark matched region, put cursor at end of rgn
<rAmiga-f9:
..make sure we skip the one the cursor is on
equateLoc(curFile,locA,atCursor)
if (eqLoc(curFile,atCursor,eInvert)) moveCursor(curFile,sChar)
setSearch(buf49)
if (search(curFile,sInvert,eInvert,-1)) {
equateLoc(curFile,atCursor,eInvert)
putMsg("Next match backward")
refreshDisplay
returnTrue }
else {
equateLoc(curFile,atCursor,locA)
freeBuf(buf50)
insertRgn(buf50,sFile," SEARCH FAILED, no match above here",all)
if (eqNum(1,searchCaps)) insertRgn(buf50,sFile," (CASE SENSITIVE)",all)
insertRgn(buf50,sFile,buf49,all)
putMsg(buf50)
equateLoc(curFile,sInvert,eInvert)
refreshDisplay
returnFalse }
>Wednesday 24-Jul-91 23:08:19
Replace matched region with replace text, then search forward
<normal-f10:
if (eqLoc(curFile,sInvert,eInvert)) returnFalse
clearRgn(curFile,invert)
insertRgn(curFile,sInvert,buf48,all)
runKey(lAmiga-f9)
>Tuesday 30-Jul-91 22:37:52
Replace matched region with replace text, then search backward
<shft-f10:
if (eqLoc(curFile,sInvert,eInvert)) returnFalse
clearRgn(curFile,invert)
insertRgn(curFile,sInvert,buf48,all)
runKey(rAmiga-f9)
>Tuesday 30-Jul-91 22:37:53
Replace and continue forward cssearch-replace until search fails
<alt-f10:
while(runKey(normal-f10)) nothing
>Sunday 09-Jun-91 17:50:30
|
| makes it easy to check import lists for unused identifiers
| picks up hilite or identifier under cursor
| records the location of the next identifier in list
| make search case sensitive, restores at return
|
Check identifier usage, recording loc of next in list at bookmark d
<shftCtl-i:
..make sure search is case sensitive
if (!getFlag(curFile,searchCaps)) {
equateNum(n10,1)
flipFlag(curFile,searchCaps) }
..if no hilight, hilight word under cursor
if (!(gtLoc(curFile,eHilite,sHilite) &
eqLoc(curFile,eHilite,atCursor))) {
..find identifier under cursor
..in Modula an identifier is strictly alphanumeric
..note that sWord-eWord includes alpha, digits, and "'"
if (!(is(curFile,alpha) | is(curFile,digit))) {
putMsg("CURSOR IS NOT ON AN IDENTIFIER")
return }
while ((is(curFile,alpha) | is(curFile,digit)) & !is(curFile,eFile))
moveCursor(curFile,eChar)
..alertUser ("right end of id")..debug
equateLoc(curFile,eHilite,atCursor)
decLoc(curFile,atCursor)
while ((is(curFile,alpha) | is(curFile,digit)) & !is(curFile,sFile))
moveCursor(curFile,sChar)
if (!is(curFile,sFile)) moveCursor(curFile,eChar)
..alertUser ("left end of id")..debug
equateLoc(curFile,sHilite,atCursor) }
..pick up hilight as search
if (!isEmpty(buf49)) push(buf49,buf49)
insertRgn(buf49,sFile,curFile,hilite)
setSearch(buf49)
freeBuf(buf50)
insertRgn(buf50,sFile,buf49,all)
..before searching find next id in file (import list?), for next search
..set bookmark d in case we want to return
moveCursor(curFile,eHilite)
while (!(is(curFile,alpha) | is(curFile,digit)))
moveCursor(curFile,eChar)
equateLoc(curFile,locI,atCursor)
..alertUser("set bookmark d here")..debug
..search forward
equateNum(n0,1)
runKey(virtual-s)
LABEL(0) ..search loop
putMsg("arrowUp/Down=search, s=sFile, e=eFile, n=next in list, q=quit")
getKeyVAL(macroNum,inputChar)
switch(macroNum) {
case(77) { ..downArrow
equateNum(n0,1) }
case(76) { ..upArrow
equateNum(n0,-1) }
case(33) { ..s
moveCursor(curFile,sFile)
equateNum(n0,1) }
case(18) { ..e
moveCursor(curFile,eFile)
equateNum(n0,-1) }
case(54) { ..n
freeBuf(buf50)
insertRgn(buf50,sFile,
"Quit identifier search, returned to next identifier in list",all)
moveCursor(curFile,locI)
putMsg(buf50)
if (!onScreen(atCursor)) vScroll(atCursor)
returnTrue }
case(16) ..q
default {
putMsg("Quit identifier search")
vScroll(atCursor)
beepDisplay
returnTrue } } ..end switch(macroNum)
if (!runKey(virtual-s)) {
if(askYesNo("Return to next in list?")) {
moveCursor(curFile,locI)
if (!onScreen(atCursor)) vScroll(atCursor)
goto label(0) } }
refreshDisplay
goto label(0)
>Friday 26-Jul-91 10:09:23
==== MAKE LIST, REPLACE LIST ====
Pick up hilight in curFile, make list in buf41
<ctl-i:
..if no hilite, pick up alphanumeric word
if (!gtLoc(curFile,eHilite,sHilite)) {
if (is(curFile,whiteSpace)) {
putMsg("Cursor is NOT on a word")
beepDisplay}
while (is(curFile,alpha) | is(curFile,digit)) moveCursor(curFile,sChar)
if (!is(curFile,sFile)) moveCursor(curFile,eChar)
equateLoc(curFile,sHilite,atCursor)
while (is(curFile,alpha) | is(curFile,digit)) moveCursor(curFile,eChar)
equateLoc(curFile,eHilite,atCursor) }
..if not already in buf41, add it
freeBuf(buf50)
insertRgn(buf50,sFile,curFile,hilite)
setSearch(buf50)
moveCursor(buf41,eFile)
if (!search(buf41,sHilite,eHilite,-1)) {
insertRgn(buf41,eFile,curFile,hilite)
insertChar(buf41,eLine) }
>Tuesday 30-Jul-91 16:01:37
|
| Use ctl-i to create your search list
| Buf41 can mix three forms:
|
| search replace
| \search phrase\\replace phrase\
|.. <search phrase><replace phrase>
|
|.. In the third form the <> are part of the phrase but in the second form
|.. the \\ are not part of the phrase. The third form is handy for editing
|.. hypertext files, so you do not have to type \<search>\\<replace>\ in
|.. order to exchange hyper words and phrases.
Replace names in curFile as per list in buf41
<ctl-e:
equateNum(n0,0)
if (askYesNo("Confirm each replacement?")) equateNum(n0,1)
equateNum(n10,curFile)
..now use buf[n10] instead of curFile so debugging works
moveCursor(buf41,sFile)
while (gtLoc(buf41,eFile,atCursor)) { ..to end
..get search word
equateLoc(buf41,sHilite,atCursor) ..always at sLine
equateLoc(buf41,sInvert,atCursor) ..will display invert
equateLoc(buf41,eInvert,atCursor)
if (is(buf41,"\\")) { ..phrases are in \\
..alertUser("phrases are in \\")..debug
moveCursor(buf41,eChar)
equateLoc(buf41,sHilite,atCursor)
while (!is(buf41,"\\") & !is(buf41,eLine)) moveCursor(buf41,eChar)
if (is(buf41,eLine)) {
editBuf(buf41)
putMsg("NO \ MARKING END OF SEARCH PHRASE FOUND ON THIS LINE")
beepDisplay
returnFalse }
equateLoc(buf41,eHilite,atCursor)
moveCursor(buf41,eChar)
while (!is(buf41,"\\") & !is(buf41,eLine)) moveCursor(buf41,eChar)
if (is(buf41,eLine)) {
editBuf(buf41)
putMsg("NO \ MARKING START OF REPLACEMENT PHRASE FOUND ON THIS LINE")
beepDisplay
returnFalse } }
else {if (is(buf41,"<")) { ..phrases are in <>
..alertUser("phrases are in <>")..debug
moveCursor(buf41,eChar)
while (!is(buf41,">") & !is(buf41,eLine)) moveCursor(buf41,eChar)
if (is(buf41,eLine)) {
editBuf(buf41)
putMsg("NO > MARKING END OF SEARCH PHRASE FOUND ON THIS LINE")
beepDisplay
returnFalse }
moveCursor(buf41,eChar)
equateLoc(buf41,eHilite,atCursor)
while (!is(buf41,"<") & !is(buf41,eLine)) moveCursor(buf41,eChar)
if (is(buf41,eLine)) {
editBuf(buf41)
putMsg("NO < MARKING START OF REPLACEMENT PHRASE FOUND ON THIS LINE")
beepDisplay
returnFalse } }
else { ..words separated by space
while(!is(buf41,space) & !is(buf41,eLine)) moveCursor(buf41,eChar)
equateLoc(buf41,eHilite,atCursor)
while (is(buf41," ") & !is(buf41,eLine)) moveCursor(buf41,eChar) } }
freeBuf(buf49)
insertRgn(buf49,sFile,buf41,hilite)
setSearch(buf49)
..editBuf(buf41) alertUser("search word hilited")..debug
..get replace word
equateLoc(buf41,sHilite,atCursor)
if (is(buf41,"\\")) { ..phrases are in <>
moveCursor(buf41,eChar)
equateLoc(buf41,sHilite,atCursor)
while (!is(buf41,"\\") & !is(buf41,eLine)) moveCursor(buf41,eChar)
if (is(buf41,eLine)) {
editBuf(buf41)
putMsg("NO \ MARKING END OF REPLACEMENT PHRASE FOUND ON THIS LINE")
beepDisplay
returnFalse }
equateLoc(buf41,eHilite,atCursor)
moveCursor(buf41,eChar) }
else {if (is(buf41,"<")) { ..phrases are in <>
moveCursor(buf41,eChar)
while (!is(buf41,">") & !is(buf41,eLine)) moveCursor(buf41,eChar)
if (is(buf41,eLine)) {
editBuf(buf41)
putMsg("NO > MARKING END OF REPLACEMENT PHRASE FOUND ON THIS LINE")
beepDisplay
returnFalse }
moveCursor(buf41,eChar)
equateLoc(buf41,eHilite,atCursor) }
else { ..words separated by space
while(!is(buf41,space) & !is(buf41,eLine)) moveCursor(buf41,eChar)
equateLoc(buf41,eHilite,atCursor)
if (eqLoc(buf41,sHilite,eHilite)) {
editBuf(buf41)
putMsg("NO REPLACEMENT WORD FOUND ON THIS LINE")
returnFalse } } }
equateLoc(buf41,eInvert,atCursor)
freeBuf(buf48)
insertRgn(buf48,sFile,buf41,hilite)
..monitor progress
freeBuf(buf50)
insertRgn(buf50,sFile,buf41,invert)
putMsg(buf50)
..editBuf(buf41) alertUser("replace word hilited")..debug
..editBuf(buf[n10])..debug
moveCursor(buf[n10],sFile)
..alertUser("starting search from top of curFile")
while (gtLoc(buf[n10],eFile,atCursor)) {
if (!search(buf[n10],sHilite,eHilite,1)) goto label(1)
..alertUser("candidate")
..check for whole word, don't replace part of identifier
equateLoc(buf[n10],locA,sHilite)
equateLoc(buf[n10],locB,eHilite)
moveCursor(buf[n10],eWord)
..alertUser("check right")..debug
if (gtLoc(buf[n10],atCursor,locB)) {
..alertUser("alphanum on right")..debug
goto label(0) }
moveCursor(buf[n10],sWord)
..alertUser("check left")..debug
if (gtLoc(buf[n10],locA,atCursor)) {
..alertUser("alphanum on left")..debug
moveCursor(buf[n10],eWord)
goto label(0) }
..search=whole word
if (eqNum(n0,1)) {
vScroll(atCursor)
if (askYesNo("Replace as on msg line?")) {
clearRgn(buf[n10],hilite)
insertRgn(buf[n10],atCursor,buf48,all) } }
else {
clearRgn(buf[n10],hilite)
insertRgn(buf[n10],atCursor,buf48,all) }
..alertUser("replaced")..debug
LABEL(0) }
LABEL(1) ..exchange is done
..editBuf(buf41)..debug
..go to start of next search, if any
if (!is(curFile,eLine)) moveCursor(buf41,eLine)
if (!moveCursor(buf41,downLine)) {
putMsg("Done")
returnTrue }
moveCursor(buf41,sLine) }
putMsg("Done")
>Friday 12-Jul-91 16:24:57
==== SESSION PROFILE ====
Compile a profile of the session
<shftAltCtl-f1:
newFile
insertRgn(curFile,eFile,"SESSION PROFILE",all)
insertChar(curFile,eLine)
insertChar(curFile,eLine)
insertRgn(curFile,eFile,"set bookmark a",all)
getPageRowCol(n2,n1,n2)
while (gtNum(30,n2)) {
insertChar(curFile," ")
getPageRowCol(n0,n1,n2) }
insertRgn(curFile,eFile,"n27 = ",all)
toWord(curFile,n27)
insertChar(curFile,eLine)
insertRgn(curFile,eFile,"set bookmark b",all)
getPageRowCol(n2,n1,n2)
while (gtNum(30,n2)) {
insertChar(curFile," ")
getPageRowCol(n0,n1,n2) }
insertRgn(curFile,eFile,"n28 = ",all)
toWord(curFile,n28)
insertChar(curFile,eLine)
insertRgn(curFile,eFile,"used bookmark e",all)
getPageRowCol(n2,n1,n2)
while (gtNum(30,n2)) {
insertChar(curFile," ")
getPageRowCol(n0,n1,n2) }
insertRgn(curFile,eFile,"n21 = ",all)
toWord(curFile,n21)
insertChar(curFile,eLine)
insertRgn(curFile,eFile,"used bookmark -1",all)
getPageRowCol(n2,n1,n2)
while (gtNum(30,n2)) {
insertChar(curFile," ")
getPageRowCol(n0,n1,n2) }
insertRgn(curFile,eFile,"n22 = ",all)
toWord(curFile,n22)
insertChar(curFile,eLine)
insertRgn(curFile,eFile,"used bookmark 0",all)
getPageRowCol(n2,n1,n2)
while (gtNum(30,n2)) {
insertChar(curFile," ")
getPageRowCol(n0,n1,n2) }
insertRgn(curFile,eFile,"n23 = ",all)
toWord(curFile,n23)
insertChar(curFile,eLine)
insertRgn(curFile,eFile,"used bookmark a",all)
getPageRowCol(n2,n1,n2)
while (gtNum(30,n2)) {
insertChar(curFile," ")
getPageRowCol(n0,n1,n2) }
insertRgn(curFile,eFile,"n24 = ",all)
toWord(curFile,n24)
insertChar(curFile,eLine)
insertRgn(curFile,eFile,"used bookmark b",all)
getPageRowCol(n2,n1,n2)
while (gtNum(30,n2)) {
insertChar(curFile," ")
getPageRowCol(n0,n1,n2) }
insertRgn(curFile,eFile,"n25 = ",all)
toWord(curFile,n25)
insertChar(curFile,eLine)
insertRgn(curFile,eFile,"saved on idle",all)
getPageRowCol(n2,n1,n2)
while (gtNum(30,n2)) {
insertChar(curFile," ")
getPageRowCol(n0,n1,n2) }
insertRgn(curFile,eFile,"n26 = ",all)
toWord(curFile,n26)
insertChar(curFile,eLine)
moveCursor(curFile,sFile)
putMsg("Hit any key to continue")
refreshDisplay
getKey(n0)
freeBuf(curFile)
putMsg(" ")
>Monday 24-Jun-91 23:10:34