home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume1 / 8711 / uemacs-3.9-doc / 4 < prev    next >
Internet Message Format  |  1990-07-13  |  24KB

  1. Path: uunet!husc6!necntc!ncoast!allbery
  2. From: nwd@j.cc.purdue.edu (Daniel Lawrence)
  3. Newsgroups: comp.sources.misc
  4. Subject: MicroEmacs 3.9 Documentation (4 of 4)
  5. Message-ID: <5706@ncoast.UUCP>
  6. Date: 19 Nov 87 00:18:29 GMT
  7. Sender: allbery@ncoast.UUCP
  8. Lines: 888
  9. Approved: allbery@ncoast.UUCP
  10. X-Archive: comp.sources.misc/uemacs-3.9-doc/4
  11.  
  12. # This is a shar archive.
  13. # Remove everything above this line.
  14. # Run the file through sh, not csh.
  15. # (type `sh med.4')
  16. # If you do not see the message
  17. #    `med.4 completed!'
  18. # then the file was incomplete.
  19. echo extracting - readme
  20. sed 's/^X//' > readme << 'FRIDAY_NIGHT'
  21. X        MicroEMACS 3.9 Release Notes    July 22, 1987
  22. X
  23. X**********************************************************************
  24. X
  25. X    (C)opyright 1987 by Daniel M. Lawrence
  26. X    MicroEMACS 3.9 can be copied and distributed freely for any
  27. X    non-commercial purposes. MicroEMACS 3.9 can only be incorporated
  28. X    into commercial software with the permission of the current author.
  29. X
  30. X**********************************************************************
  31. X
  32. X    MicroEMACS 3.9 is availible in a couple of different ways. 
  33. XFirst, it is availible via my bulletin board system..... 
  34. X
  35. X    The Programmer's Room
  36. X    FIDO 201/2
  37. X    (317) 742-5533
  38. X    24 hours  300/1200 baud
  39. X
  40. X    Also it should be online on the following BBS's:
  41. X
  42. X    The Starship Trooper    Fido 201/1    (317) 423-2281    2400
  43. X
  44. X    [These following two are open from 10pm till 5pm
  45. X                and only while Purdue is in session]
  46. X    The NightStaff        Fido 201/4    (317) 495-4270    1200
  47. X    The Access Violation    Fido 201/5    (317) 495-4270    9600
  48. X
  49. X    There it is arranged as three MSDOS .ARC files, EMACSDOC.ARC
  50. Xwhich contains the documentation and command files, EMACSSRC.ARC which
  51. Xcontains the sources and the UNIX Makefile, and EMACSEXE.EXE which
  52. Xcontains the MSDOS executables.  Also all the various executables are
  53. Xavailable individually.
  54. X
  55. XEMACSDOC.ARC includes the files:
  56. X
  57. X    README        This file
  58. X    
  59. X    (These four files should be in your path for the standard setup)
  60. X    EMACS.RC    Standard startup file
  61. X    NEWPAGE.CMD    Shifted Function key Pager
  62. X    PPAGE.CMD    Programming page
  63. X    WPAGE.CMD    Word processing page
  64. X    BPAGE.CMD    Block and box manipulation page
  65. X
  66. X    ME110.RC    HP110 startup file
  67. X    ME150.RC    HP150 startup file
  68. X    AMIGA.RC    AMIGA ".emacsrc" startup file
  69. X    ST520.RC    ATARI ST startup file
  70. X
  71. X    EMACS.HLP    Online help file
  72. X    EMACS.MSS    MicroSCRIBE format of EMACS.TXT
  73. X    EMACS.TXT       EMACS BEGINNER'S/REFERENCE MANUAL
  74. X
  75. X    AZMAP.CMD    Translate AZTEC .SYM files to .MAP
  76. X    BDATA.CMD    BASIC Data statement builder
  77. X    FINDCOM.CMD    Find mismatched C comments
  78. X    FUNC.CMD    Allow function keys on systems with non (like UNIX)
  79. X    MENU.CMD    Sample Menu system
  80. X    MENU1           datafile for menu system
  81. X    SHELL.CMD    Sample interactive MSDOS shell
  82. X    TRAND.CMD    Generate random numbers and do statistics on them
  83. X
  84. XEMACSSRC.ARC includes the files:
  85. X
  86. X    ALINE.H        Atari ST graphic header file
  87. X    ANSI.C        ANSI screen driver
  88. X    BASIC.C        basic cursor movement
  89. X    BIND.C        key binding commands
  90. X    BUFFER.C    buffer manipulation commands
  91. X    CRYPT.C        encryption functions
  92. X    DOLOCK        file locking stub routines
  93. X    DG10.C        Data General 10 screen driver
  94. X    DISPLAY.C    main display driver
  95. X    EBIND.H        binding list
  96. X    EDEF.H        global variable declarations
  97. X    EFUNC.H        function name list
  98. X    EPATH.H        default path settings
  99. X    ESTRUCT.H    configuration and structure definitions
  100. X    EVAL.C        expression evaluator
  101. X    EVAR.H        EMACS macro variable declarations
  102. X    EXEC.C        macro execution functions
  103. X    FILE.C        user file functions
  104. X    FILEIO.C    low level file I/O driver
  105. X    HP110.C        HP110 screen driver
  106. X    HP150.C        HP150(A or C) screen driver
  107. X    IBMPC.C        IBM-PC CGA and MONOCHROME driver
  108. X    INPUT.C        low level user input driver
  109. X    ISEARCH.C    incremental search functions
  110. X    LINE.C        text line manipulation functions
  111. X    LOCK.C        file locking functions
  112. X    MAIN.C        argument parsing and command loop
  113. X    RANDOM.C    other random user functions
  114. X    REGION.C    region cut & paste functions
  115. X    SEARCH.C    search and replace functions
  116. X    SPAWN.C        OS interface driver
  117. X    ST520.C        ATARI ST1040 screen driver
  118. X    TCAP.C        Termcap screen driver
  119. X    TERMIO.C    low level I/O driver
  120. X    TIPC.C        TI-PC screen driver
  121. X    VMSVT.C        VMS screen driver
  122. X    VT52.C        VT52 screen driver
  123. X    WINDOW.C    window manipulation functions
  124. X    WORD.C        word manipulation functions
  125. X    Z309.C        Zenith 100 PC series terminal driver
  126. X
  127. XEMACSEXE.ARC includes the files:
  128. X
  129. X    MEIBM.EXE    IBM-PC CGA/MONO/EGA version
  130. X    MEANSI.EXE    MSDOS ANSI graphics version
  131. X    ME110.EXE    HP110 portable version
  132. X    ME150.EXE    HP150 version
  133. X    ME309.EXE    Zenith 100 PC series version
  134. X    ME520.PRG    Atari 520/1040ST version
  135. X    MEAMIGA.    Amiga 1000 version
  136. X
  137. X    Recently, MicroSPELL 1.0 has been released.  This program allows
  138. Xyou to spell check text files and uses MicroEMACS to scan the file,
  139. Xdoing various corrections. 
  140. X
  141. X    MicroSCRIBE, a fairly SCRIBE compatible text formatter to go
  142. Xalong with these programs will probably be available for beta testing
  143. Xearly spring 1988.  This program is turning out to be a lot more complex
  144. Xthan I thought it would be, and is taking more time to get out.
  145. X
  146. X    I have in my possesion a port of MicroEMACS 3.8i to the
  147. XMacintosh, and I will be incorporating the needed changes for the current
  148. Xversion to support the Macintosh.
  149. X
  150. X    As before, I will continue to support these programs, and
  151. Xencourage everyone to spread them around as much as they can.  If you
  152. Xmake what you think are changes that are useful to many, send me the
  153. Xupdates, and as time permits, I will incorporate the ones I understand,
  154. Xand agree with into the master sources.
  155. X
  156. X    MicroEMACS is available on disk directly from my by sending me
  157. X$25 per order and a note specifying the disk format and the product that
  158. Xyou need.  I can fill orders for IBM-PC high/low density 5 1/4 and 3
  159. X1/5, ATARI ST single and double density, AMIGA disks and HP150 disks. 
  160. X(You do not need to send disks or mailers, I will provide these.) The
  161. Xdistribution set includes on disk all docs, executables and sources. 
  162. XAlso I will register you and you will receive automatic notices of new
  163. Xversions of all the programs I am releasing.
  164. X
  165. X    Commercial lisences to allow MicroEMACS to be incorporated into
  166. Xother software packages are also available at a reasonable per package
  167. Xprice. Also I am available to do customization of MicroEMACS at an
  168. Xhourly rate. Send all requests to the address below:
  169. X
  170. X    USmail:    Daniel Lawrence
  171. X        617 New York St
  172. X        Lafayette, IN 47901
  173. X
  174. X    UUCP:    pur-ee!j.cc.purdue.edu!nwd
  175. X    ARPA:    nwd@j.cc.purdue.edu
  176. X    FIDO:    The Programmer's Room 201/2
  177. X        (317) 742-5533
  178. X    ATT:    (317) 742-5153
  179. X
  180. X    
  181. X        New Features since version 3.8i
  182. X        ===============================
  183. X
  184. X**    New standard startup file
  185. X
  186. X    The new emacs.rc file is segmented into more parts and loads much
  187. Xfaster than before. Separate "pages" of shifted function keys are
  188. Xavailable. Users can write their own "pages".
  189. X
  190. X***    New Variables (there are a lot...)
  191. X
  192. X    $status        returns status of last command
  193. X    $palette    color palette settings
  194. X    $lastkey    returns last keystroke
  195. X    $curchar    returns and set the ascii number of the
  196. X            character under the point
  197. X    $progname    always returns "MicroEMACS"
  198. X    $version    always returns the current version ("3.9")
  199. X    $discmd        sets display of messages on the command
  200. X            line (except via the write-message command)
  201. X    $disinp        sets echoing of characters during input on the
  202. X            command line
  203. X    $wline        returns and sets # lines in current window
  204. X    $cwline        returns and set current line within window
  205. X    $target        returns/sets target for line moves
  206. X    $search        returns/sets default search string
  207. X    $replace    returns/sets default replace string
  208. X    $match        returns last matched string in magic search
  209. X    $cmode        returns/sets encoded mode of current buffer
  210. X    $gmode        returns/sets encoded global mode (see appendix E
  211. X            in emacs.mss to decode this)
  212. X    $tpause        returns/sets the pause for fence matching
  213. X            (this is in rather arbitrary units which
  214. X            WILL vary from machine to machine)
  215. X    $line        return/sets the contents of the current line
  216. X    $gflags        global operations flag (see emacs.txt Appendix G)
  217. X    $rval        child process return value
  218. X
  219. X***    New computers supported
  220. X
  221. X    Atari 1040ST    all three graphics modes and 50 line mode on a
  222. X            monochrome monitor. The mouse is bound to the 
  223. X            cursor keys for now.
  224. X
  225. X***    New Compilers supported
  226. X
  227. X    Turbo C v1.0 under MSDOS is now a supported compiler.
  228. X    Mark Williams C on the Atari ST is also supported.
  229. X
  230. X**    New directives
  231. X
  232. X    !while <condition>    loops while <cond> is true
  233. X
  234. X        !break        breaks out of the innermost !while
  235. X
  236. X    !endwhile        delimits the end of a !while loop
  237. X
  238. X    All !gotos are legal into and out of a !while loop.
  239. X
  240. X***    Autosave mode
  241. X
  242. X    This mode saves the file out to disk every time 256 have been
  243. Xinserted. $asave controls the # of characters between saves, $acount
  244. Xcontrols the # of chars to the next save.
  245. X
  246. X***    New functions
  247. X
  248. X    &and    <log> <log>    Logical AND
  249. X    &or    <log> <log>    Logical OR
  250. X    &len    <str>        returns length of <str>
  251. X    &lower    <str>        lowercase <str>
  252. X    &upper    <str>        uppercase <str>
  253. X    &rnd    <int>        generate a random integer between 1 and <int>
  254. X    &sindex <str1> <str2>    search for string 2 within string 1
  255. X                returning its position, or zero if it fails
  256. X    &env    <str>        return value of DOS environment
  257. X                variable <str>
  258. X    &bind    <str>        returns the function name bound to the
  259. X                key <str>
  260. X    &exist    <str>        Does file <str> exist?
  261. X    &find    <str>        find file <str> along the PATH
  262. X    &band    <num> <num>    bitwise and
  263. X    &bor    <num> <num>    bitwise or
  264. X    &bxor    <num> <num>    bitwise xor
  265. X    &bnot    <num>        bitwise not
  266. X    &xlate    <str1> <str2> <str3>
  267. X                scan <str1> replacing characters in
  268. X                <str2> with the coresponding characters
  269. X                in <str3>
  270. X
  271. X***    Advanced word processing commands
  272. X
  273. X    ^X^T    trim-line    trim all trailing whitespace
  274. X    ^X^E    entab-line    change all multiple char runs to tabs
  275. X    ^X^D    detab-line    change all tabs to multiple spaces
  276. X
  277. X***    Merged EGA driver
  278. X
  279. X    The EGA driver is now part of the IBM-PC driver. This driver now
  280. Xsupports MONO, CGA and EGA cards/modes. (settable by using the $sres
  281. Xvariable)
  282. X
  283. X***    8 bit characters fully supported
  284. X
  285. X    Eight bit characters (including foreign language and line
  286. Xdrawing characters) are now supported on the various micro environments)
  287. X
  288. X***    List Buffers expanded
  289. X
  290. X    Given a numeric argument, ^X^B (list-buffers) will now also list
  291. Xall the hidden internal buffers.
  292. X
  293. X***    -k switch enhanced
  294. X
  295. X    If you use the -k (encrypted file) switch on the command line
  296. Xwithout a key immediatly following it, it will prompt you for the key to
  297. Xuse to decrypt with.
  298. X
  299. X***    word delete enhanced
  300. X
  301. X    with a zero (0) argument, M-D (delete-next-word) deletes the
  302. Xnext word and not any intervening whitespace or special characters.
  303. X
  304. X***    New File read hook
  305. X
  306. X    Whenever MicroEMACS reads a file from disk, right before it is
  307. Xread, whatever function is bound to M-FNR (which is an illegal
  308. Xkeystroke) will execute. By default this would be (nop), but the
  309. Xstandard emacs.rc binds this to a file that examines the file name and
  310. Xplaces the buffer int CMODE if the extension ends in a .c or .h. You can
  311. Xof course redefine this macro to taste.
  312. X
  313. X***    Search Path modified
  314. X
  315. X    The order in which emacs looks for all .rc (startup) and
  316. X.cmd (command macros) is as follows:
  317. X
  318. X    $HOME            (the HOME environment variable if it exists)
  319. X    the current directory
  320. X    $PATH            (executable PATH)
  321. X    default list contained in epath.h
  322. X
  323. X***    Line length limits removed
  324. X
  325. X    Lines of arbitrary length may be read, edited, and written.
  326. X
  327. X***    Out of memory handling improved
  328. X
  329. X    EMACS will announce "OUT OF MEMORY" when it runs out of dynamic
  330. Xmemory while reading files or inserting new text.  It should then be
  331. Xsafe to save buffers out IF THE CONTENTS OF THE BUFFER ARE COMPLETE at
  332. Xthat time.  When a buffer has been truncated while reading, a pound sign
  333. X"#" will appear in the first position of the mode line.  Also a # will
  334. Xappear in a buffer listing.  If you attempt to save a truncated buffer,
  335. XEMACS will ask if you are certain before allowing the truncated file to
  336. Xbe written.  As before, still beware of killing blocks of text after you
  337. Xhave run out of memory. 
  338. X
  339. X***    DENSE mode on the Atari ST
  340. X
  341. X    On an Atari ST monochrome monitor, setting $sres to "DENSE" will
  342. Xresult in a 50 line display.
  343. X
  344. X***    Execute command
  345. X
  346. X    Execute-program (^X-$) will execute an external program without
  347. Xcalling up an intervening shell is possible.
  348. X
  349. X***    Better close braces in CMODE
  350. X
  351. X    The name says it all, try it.
  352. FRIDAY_NIGHT
  353. echo extracting - shell.cmd
  354. sed 's/^X//' > shell.cmd << 'FRIDAY_NIGHT'
  355. X;    Shell.cmd:    MSDOS shell within MicroEMACS
  356. X;            written 1987 by Daniel Lawrence
  357. X
  358. X    write-message "[Setting up SHELL window]"
  359. X
  360. Xstore-procedure    getdir
  361. X    shell-command "cd > eshell"
  362. X    set %shtmp $cbufname
  363. X    !force delete-buffer eshell
  364. X    find-file eshell
  365. X    beginning-of-file
  366. X    set %shdir $line
  367. X    select-buffer %shtmp
  368. X    delete-buffer eshell
  369. X!endm
  370. X
  371. Xstore-procedure prompt
  372. X    !if ¬ &equ $curcol 0
  373. X        newline
  374. X    !endif
  375. X    !if ¬ &seq $line ""
  376. X        open-line
  377. X    !endif
  378. X    insert-string &cat %shdir ">"
  379. X!endm
  380. X
  381. Xstore-procedure getline
  382. X    beginning-of-line
  383. X    set %shtmp $curline
  384. X    !force search-forward ">"
  385. X    !if ¬ &equ $curline %shtmp
  386. X        set $curline %shtmp
  387. X    !endif
  388. X    !if &equ $curchar 10
  389. X        set %shline ""
  390. X    !else
  391. X        kill-to-end-of-line
  392. X        yank
  393. X        set %shline $kill
  394. X    !endif
  395. X    newline
  396. X!endm
  397. X
  398. Xstore-procedure execline
  399. X    shell-command &cat %shline " > shtmp"
  400. X    !force insert-file shtmp
  401. X!endm
  402. X
  403. X;    prompt and execute a command
  404. X
  405. X4    store-macro
  406. X    run getline
  407. X    !if ¬ &seq %shline ""
  408. X        !if &or &seq &left %shline 2 "cd" &seq &right %shline 1 ":"
  409. X            shell-command %shline
  410. X            run getdir
  411. X        !else
  412. X            run execline
  413. X        !endif
  414. X    !endif
  415. X    run prompt
  416. X!endm
  417. X
  418. Xstore-procedure checkmode
  419. X    !if &and %shmode ¬ &seq $cbufname "[I-SHELL]"
  420. X        set $discmd FALSE
  421. X        bind-to-key newline ^M
  422. X        add-mode blue
  423. X        add-mode WHITE
  424. X        write-message "[Exiting Shell window]"
  425. X        set %shmode FALSE
  426. X        set $discmd TRUE
  427. X    !endif
  428. X    !if &and ¬ %shmode &seq $cbufname "[I-SHELL]"
  429. X        set $discmd FALSE
  430. X        write-message "[Entering Shell window]"
  431. X        bind-to-key execute-macro-4 ^M
  432. X        run getdir
  433. X        add-mode black
  434. X        add-mode GREEN
  435. X        end-of-file
  436. X        run prompt
  437. X        set %shmode TRUE
  438. X        set $discmd TRUE
  439. X    !endif
  440. X!endm
  441. X
  442. X;    window movement (and deactivate us)
  443. X
  444. X5    store-macro
  445. X    next-window
  446. X    run checkmode
  447. X!endm
  448. X
  449. X6    store-macro
  450. X    previous-window
  451. X    run checkmode
  452. X!endm
  453. X
  454. X7    store-macro
  455. X    delete-window
  456. X    run checkmode
  457. X!endm
  458. X
  459. X8    store-macro
  460. X    find-file @"Find file:"
  461. X    run checkmode
  462. X!endm
  463. X
  464. X9    store-macro
  465. X    next-buffer
  466. X    run checkmode
  467. X!endm
  468. X
  469. Xstore-procedure openshell
  470. X    set $discmd FALSE
  471. X    bind-to-key execute-macro-5 ^XO
  472. X    bind-to-key execute-macro-6 ^XP
  473. X    bind-to-key execute-macro-7 ^X0
  474. X    bind-to-key execute-macro-8 ^X^F
  475. X    bind-to-key execute-macro-9 ^XX
  476. X    select-buffer "[I-SHELL]"
  477. X    run checkmode
  478. X    set $discmd TRUE
  479. X!endm
  480. X
  481. X    set %shmode FALSE
  482. X    run openshell
  483. FRIDAY_NIGHT
  484. echo extracting - st520.rc
  485. sed 's/^X//' > st520.rc << 'FRIDAY_NIGHT'
  486. X;    EMACS.RC:    Standard micro Startup program
  487. X;            for MicroEMACS 3.9d and above
  488. X;            (C)opyright 1987 by Daniel M Lawrence
  489. X;            Last Update: 10/20/87
  490. X
  491. Xset $discmd FALSE
  492. Xwrite-message "[Setting up....]"
  493. X
  494. X; If you screen "SNOWS", uncomment this line
  495. X;    set $flicker "TRUE"
  496. X
  497. X; To use an IBM-PC EGA card, uncomment the following line
  498. X;    set $sres "EGA"
  499. X
  500. X;    ***** Rebind the Function key group
  501. X
  502. Xbind-to-key search-forward        FN;
  503. Xbind-to-key search-reverse        FN<
  504. Xbind-to-key hunt-forward        FN=
  505. Xbind-to-key hunt-backward        FN>
  506. Xbind-to-key execute-macro-1        FN?
  507. Xbind-to-key execute-macro-2        FN@
  508. Xbind-to-key next-window            FNA
  509. Xbind-to-key execute-macro-3        FNB
  510. Xbind-to-key save-file            FNC
  511. Xbind-to-key exit-emacs            FND
  512. X
  513. Xbind-to-key execute-macro-10        FNT
  514. Xbind-to-key execute-macro-11        FNU
  515. Xbind-to-key execute-macro-12        FNV
  516. Xbind-to-key execute-macro-13        FNW
  517. Xbind-to-key execute-macro-14        FNX
  518. Xbind-to-key execute-macro-15        FNY
  519. Xbind-to-key execute-macro-16        FNZ
  520. Xbind-to-key execute-macro-17        FN[
  521. Xbind-to-key execute-macro-18        FN\
  522. Xbind-to-key execute-macro-19        FN]
  523. X
  524. X;    Set Default Global modes
  525. X
  526. Xadd-global-mode "blue"
  527. Xbind-to-key next-page FNG
  528. Xbind-to-key previous-page FNR
  529. X
  530. X;    Toggle function key window display
  531. X
  532. X1    store-macro
  533. X    !if %rcfkeys
  534. X        !goto rcfoff
  535. X    !endif
  536. X
  537. X;    toggle function key window on
  538. X    save-window
  539. X    1 next-window
  540. X    !if &sequal $cbufname "emacs.hlp"
  541. X        delete-window
  542. X    !endif
  543. X    !if ¬ &sequal $cbufname "Function Keys"
  544. X        1 split-current-window
  545. X        select-buffer "Function Keys"
  546. X        add-mode "red"
  547. X        !force 5 resize-window
  548. X        1 goto-line
  549. X    !endif
  550. X    set %rcfkeys TRUE
  551. X    !force restore-window
  552. X    !if &sequal $cbufname "Function Keys"
  553. X        next-window
  554. X    !endif
  555. X    write-message "[Function key window ON]"
  556. X    !return
  557. X
  558. X    ;Toggle the function key window off
  559. X*rcfoff
  560. X    save-window
  561. X    1 next-window
  562. X    !if &sequal "Function Keys" $cbufname
  563. X        delete-window
  564. X    !endif
  565. X    !force restore-window
  566. X    write-message "[Function key window OFF]"
  567. X    set %rcfkeys FALSE
  568. X!endm
  569. X
  570. X;    Toggle HELP file onscreen
  571. X
  572. X2 store-macro
  573. X    1 next-window
  574. X
  575. X    ;Make sure the function key window isn't up!
  576. X    !if &sequal $cbufname "Function Keys"
  577. X        delete-window
  578. X    !endif
  579. X    set %rcfkeys FALSE
  580. X
  581. X    ;Bring up page 1
  582. X    !if ¬ &seq $cbufname "emacs.hlp"
  583. X        help
  584. X        8 resize-window
  585. X        add-mode "red"
  586. X        beginning-of-file
  587. X        2 forward-character
  588. X    !endif
  589. X
  590. X*rchelp
  591. X
  592. X    write-message "[INS/HOME] Page    [FN6] EXIT     ^G  Exit leaving page on screen"
  593. X    update-screen
  594. X    set %rctmp >key
  595. X    !if &equ &asc %rctmp 0
  596. X        set %rctmp >key
  597. X        !if &seq %rctmp R
  598. X            beginning-of-line
  599. X            !force search-reverse "=>"
  600. X            1 redraw-display
  601. X            !goto rchelp
  602. X        !endif
  603. X        !if &seq %rctmp G
  604. X            beginning-of-line
  605. X            2 forward-character
  606. X            !force search-forward "=>"
  607. X            1 redraw-display
  608. X            !goto rchelp
  609. X        !endif
  610. X        !if &seq %rctmp "~@"
  611. X            delete-window
  612. X            !if &seq %rcfkeys TRUE
  613. X                set %rcfkeys FALSE
  614. X                execute-macro-1
  615. X            !endif
  616. X            write-message "[Help Exited]"
  617. X            !return
  618. X        !endif
  619. X    !endif
  620. X    !if &equ &asc %rctmp 7
  621. X        next-window
  622. X        set %rcfkeys FALSE
  623. X        write-message "[Help Aborted]"
  624. X        !return
  625. X    !endif
  626. X    !goto rchelp
  627. X!endm
  628. X
  629. X;    Load a new page
  630. X
  631. X3    store-macro
  632. X    !if &seq &find newpage.cmd ""
  633. X        write-message "[Can not find NEWPAGE.CMD]"
  634. X        !return
  635. X    !endif
  636. X    execute-file newpage.cmd
  637. X!endm
  638. X
  639. X;procedure to clean out the current page (which is nothing right now)
  640. X
  641. Xstore-procedure    clean
  642. X    ; nothing by default
  643. X!endm
  644. X
  645. X;    Set up auto CMODE
  646. X
  647. X20    store-macro
  648. X    set %rctmp &sin $cfname "."
  649. X    !if &equ %rctmp 0
  650. X        !return
  651. X    !endif
  652. X    set %rctmp &mid $cfname &add %rctmp 1 5
  653. X    !if &or &seq %rctmp "c" &seq %rctmp "h"
  654. X        add-mode "cmode"
  655. X    !endif
  656. X!endm
  657. Xbind-to-key execute-macro-20    M-FNR
  658. X
  659. X;    bring up the function key window
  660. X
  661. X    1 split-current-window
  662. X    select-buffer "Function Keys"
  663. X    insert-string "f1 search-> f2 <-search |    MicroEMACS:  Text Editor~n"
  664. X    insert-string "f3 hunt->   f4 <-hunt   | ~n"
  665. X    insert-string "f5 fkeys    f6 help     |  Available function key Pages include:~n"
  666. X    insert-string "f7 nxt wind f8 pg[    ] |    WORD  PROG  BOX~n"
  667. X    insert-string "f9 save     f10 exit    |  [use the f8 key to load Pages]~n"
  668. X    unmark-buffer
  669. X    delete-window
  670. X    set %rcfkeys FALSE
  671. X    execute-macro-1
  672. X    set $discmd TRUE
  673. FRIDAY_NIGHT
  674. echo extracting - trand.cmd
  675. sed 's/^X//' > trand.cmd << 'FRIDAY_NIGHT'
  676. X    set %try 0
  677. X    set %sum 0
  678. X    insert-string "Rolls: "
  679. X*nextry
  680. X    set %roll &rnd 100
  681. X    !if &greater $curcol 70
  682. X        newline
  683. X        insert-string "       "
  684. X    !endif
  685. X    set %sum &add %sum %roll
  686. X    insert-string &cat %roll " "
  687. X    update-screen
  688. X    set %try &add %try 1
  689. X    !if &less %try 300
  690. X        !goto nextry
  691. X    !endif
  692. X
  693. X    newline
  694. X    newline
  695. X    insert-string &cat &cat "Sum of rolls: " %sum "~n"
  696. X    insert-string &cat &cat "Average roll: " &div %sum 300 "~n"
  697. X    update-screen
  698. X    unmark-buffer
  699. FRIDAY_NIGHT
  700. echo extracting - wpage.cmd
  701. sed 's/^X//' > wpage.cmd << 'FRIDAY_NIGHT'
  702. X;    WPAGE.CMD:    Wordprocessing Macro Page
  703. X;            for MicroEMACS 3.9d and above
  704. X;            (C)opyright 1987 by Daniel M Lawrence
  705. X
  706. X; set the clean procedure up
  707. Xstore-procedure clean
  708. X    delete-buffer "[Macro 10]"
  709. X           bind-to-key execute-macro-11 FNU
  710. X    bind-to-key execute-macro-12 FNV
  711. X    delete-buffer "[Macro 13]"
  712. X    delete-buffer "[Macro 14]"
  713. X    delete-buffer "[Macro 15]"
  714. X    delete-buffer "[Macro 16]"
  715. X    delete-buffer "[Macro 17]"
  716. X    bind-to-key execute-macro-18 FN\
  717. X    delete-buffer "[Macro 19]"
  718. X    set $cmode %oldmode
  719. X    set $gmode %oldgmode
  720. X!endm
  721. X
  722. X; make sure the function key window is up
  723. X    set %rcfkeys FALSE
  724. X    execute-macro-1
  725. X    write-message "Loading..."
  726. X
  727. X; Write out the page instructions
  728. X    save-window
  729. X    1 next-window
  730. X    beginning-of-file
  731. X    set $curcol 25
  732. X    overwrite-string " F1 center line                                     "
  733. X    next-line
  734. X    set $curcol 25
  735. X    overwrite-string " F3 reformat paragraph     F4 spell check file      "
  736. X    next-line
  737. X    set $curcol 25
  738. X    overwrite-string " F5 ref indented paragraph F6 PREVIEW output        "
  739. X    next-line
  740. X    set $curcol 18
  741. X    overwrite-string "WORD"
  742. X    set $curcol 25
  743. X    overwrite-string " F7 toggle words           F8 output DRAFT          "
  744. X    next-line
  745. X    set $curcol 25
  746. X    overwrite-string " F9 count words           F10 output FINAL          "
  747. X    unmark-buffer
  748. X    beginning-of-file
  749. X    !force restore-window
  750. X    update-screen
  751. X
  752. X; Center the current line
  753. X
  754. X10    store-macro
  755. X    end-of-line
  756. X    set %rctmp $curcol
  757. X    beginning-of-line
  758. X    &div &sub $fillcol %rctmp 2 insert-space
  759. X    beginning-of-line
  760. X!endm
  761. X
  762. Xbind-to-key nop FNU
  763. Xbind-to-key fill-paragraph FNV
  764. X
  765. X;    Spell check the current buffer
  766. X
  767. X13    store-macro
  768. X    set %rctmp @"User dictionary(<ret> if none): "
  769. X    !if &seq %rctmp "ERROR"
  770. X        !return
  771. X    !endif
  772. X    !if ¬ &seq %rctmp ""
  773. X        set %rctmp &cat &cat "-u" %rctmp " "
  774. X    !endif
  775. X    save-file
  776. X    set %rcspell TRUE
  777. X    write-message ~n
  778. X    shell-command &cat &cat "spell " %rctmp $cfname
  779. X    execute-file "scan.cmd"
  780. X    delete-other-windows
  781. X    !if &seq %rcfkeys TRUE
  782. X        set %rcfkeys FALSE
  783. X        execute-macro-1
  784. X    !endif
  785. X    update-screen
  786. X    write-message "[Spell Check complete]"
  787. X!endm
  788. X
  789. X;    reformat indented paragraph
  790. X
  791. X14    store-macro
  792. X    write-message "                    [Fixing paragraph]"
  793. X
  794. X    ;remember where we are..and set up
  795. X    set %endpos $cwline
  796. X    set $discmd "FALSE"
  797. X
  798. X    ;snarf the paragraph and put it in its own buffer
  799. X    kill-region
  800. X    2 split-current-window
  801. X    select-buffer "[temp]"
  802. X    yank
  803. X
  804. X    ;get rid of the blank lines at the end
  805. X    end-of-file
  806. X    !while &and &seq $line "" ¬ &equ $curline 1
  807. X        delete-previous-character
  808. X    !endwhile
  809. X    forward-character
  810. X
  811. X    ;get rid of the indents
  812. X    set %endline $curline
  813. X    beginning-of-file
  814. X    !while &gre %endline $curline
  815. X        !while &or &equ $curchar 32 &equ $curchar 9
  816. X            delete-next-character
  817. X        !endwhile
  818. X        next-line
  819. X    !endwhile
  820. X
  821. X    ;re-format it
  822. X    &sub $fillcol 8 set-fill-column
  823. X    1 goto-line
  824. X    fill-paragraph
  825. X    &add $fillcol 8 set-fill-column
  826. X
  827. X    ;insert new indents
  828. X    end-of-file
  829. X    set %endline $curline
  830. X    beginning-of-file
  831. X    !while &less $curline &sub %endline 1
  832. X        beginning-of-line
  833. X        handle-tab
  834. X        next-line
  835. X    !endwhile
  836. X
  837. X    ;move it back into the original buffer
  838. X    beginning-of-file
  839. X    set-mark
  840. X    end-of-file
  841. X    kill-region
  842. X    unmark-buffer
  843. X    delete-window
  844. X    yank
  845. X
  846. X    ;and clean up
  847. X    delete-buffer "[temp]"
  848. X    set $cwline %endpos
  849. X    set $discmd TRUE
  850. X    write-message "                    [Fixed paragraph]"
  851. X!endm
  852. X
  853. X15    store-macro
  854. X    write-message "[MicroSCRIBE not ready]"
  855. X!endm
  856. X
  857. X;    swap the word the cursor is on and it's predisesor
  858. X
  859. X16    store-macro
  860. X    set %rctmp $search
  861. X    forward-character
  862. X    previous-word
  863. X    0 delete-next-word
  864. X    set %second $kill
  865. X    insert-string "~~"
  866. X    !force previous-word
  867. X    !if &seq $status FALSE
  868. X        set %first %second
  869. X    !else
  870. X        0 delete-next-word
  871. X        set %first $kill
  872. X        insert-string %second
  873. X    !endif
  874. X    search-forward "~~"
  875. X    delete-previous-character
  876. X    insert-string %first
  877. X    previous-word
  878. X    set $search %rctmp
  879. X!endm
  880. X
  881. X17    store-macro
  882. X    write-message "[MicroSCRIBE not ready]"
  883. X!endm
  884. X
  885. Xbind-to-key count-words FN\
  886. X
  887. X19    store-macro
  888. X    write-message "[MicroSCRIBE not ready]"
  889. X!endm
  890. X
  891. X    set %oldmode $cmode
  892. X    set %oldgmode $gmode
  893. X    add-mode wrap
  894. X    add-global-mode wrap
  895. X    write-message "[Wordprocesing mode loaded]"
  896. FRIDAY_NIGHT
  897. echo extracting - 
  898. sed 's/^X//' >  << 'FRIDAY_NIGHT'
  899. XXFRIDAY_NIGHT
  900.