home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / utility / misc / emac1858.lha / emacs-18.58 / lisp / rect.elc < prev    next >
Emacs Compiled Lisp  |  1992-02-21  |  4.9 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: Emacs Compiled Lisp (other/emacsCompiledLisp).
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
1% dexvert Emacs Compiled Lisp (other/emacsCompiledLisp) magic Unsupported
100% file Emacs v18 byte-compiled Lisp data default
99% file data default
100% gt2 Kopftext: '(defun operate-on-rectangle (function start end coerce-tabs) ' default (weak)
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime text/x-emacs-lisp default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 0a 28 64 65 66 75 6e 20 | 6f 70 65 72 61 74 65 2d |.(defun |operate-|
|00000010| 6f 6e 2d 72 65 63 74 61 | 6e 67 6c 65 20 28 66 75 |on-recta|ngle (fu|
|00000020| 6e 63 74 69 6f 6e 20 73 | 74 61 72 74 20 65 6e 64 |nction s|tart end|
|00000030| 20 63 6f 65 72 63 65 2d | 74 61 62 73 29 20 22 5c | coerce-|tabs) "\|
|00000040| 0a 43 61 6c 6c 20 46 55 | 4e 43 54 49 4f 4e 20 66 |.Call FU|NCTION f|
|00000050| 6f 72 20 65 61 63 68 20 | 6c 69 6e 65 20 6f 66 20 |or each |line of |
|00000060| 72 65 63 74 61 6e 67 6c | 65 20 77 69 74 68 20 63 |rectangl|e with c|
|00000070| 6f 72 6e 65 72 73 20 61 | 74 20 53 54 41 52 54 2c |orners a|t START,|
|00000080| 20 45 4e 44 2e 0a 49 66 | 20 43 4f 45 52 43 45 2d | END..If| COERCE-|
|00000090| 54 41 42 53 20 69 73 20 | 6e 6f 6e 2d 6e 69 6c 2c |TABS is |non-nil,|
|000000a0| 20 63 6f 6e 76 65 72 74 | 20 6d 75 6c 74 69 2d 63 | convert| multi-c|
|000000b0| 6f 6c 75 6d 6e 20 63 68 | 61 72 61 63 74 65 72 73 |olumn ch|aracters|
|000000c0| 0a 74 68 61 74 20 73 70 | 61 6e 20 74 68 65 20 73 |.that sp|an the s|
|000000d0| 74 61 72 74 69 6e 67 20 | 6f 72 20 65 6e 64 69 6e |tarting |or endin|
|000000e0| 67 20 63 6f 6c 75 6d 6e | 73 20 6f 6e 20 61 6e 79 |g column|s on any|
|000000f0| 20 6c 69 6e 65 0a 74 6f | 20 6d 75 6c 74 69 70 6c | line.to| multipl|
|00000100| 65 20 73 70 61 63 65 73 | 20 62 65 66 6f 72 65 20 |e spaces| before |
|00000110| 63 61 6c 6c 69 6e 67 20 | 46 55 4e 43 54 49 4f 4e |calling |FUNCTION|
|00000120| 2e 0a 46 55 4e 43 54 49 | 4f 4e 20 69 73 20 63 61 |..FUNCTI|ON is ca|
|00000130| 6c 6c 65 64 20 77 69 74 | 68 20 74 68 72 65 65 20 |lled wit|h three |
|00000140| 61 72 67 75 6d 65 6e 74 | 73 3a 0a 20 70 6f 73 69 |argument|s:. posi|
|00000150| 74 69 6f 6e 20 6f 66 20 | 73 74 61 72 74 20 6f 66 |tion of |start of|
|00000160| 20 73 65 67 6d 65 6e 74 | 20 6f 66 20 74 68 69 73 | segment| of this|
|00000170| 20 6c 69 6e 65 20 77 69 | 74 68 69 6e 20 74 68 65 | line wi|thin the|
|00000180| 20 72 65 63 74 61 6e 67 | 6c 65 2c 0a 20 6e 75 6d | rectang|le,. num|
|00000190| 62 65 72 20 6f 66 20 63 | 6f 6c 75 6d 6e 73 20 74 |ber of c|olumns t|
|000001a0| 68 61 74 20 62 65 6c 6f | 6e 67 20 74 6f 20 72 65 |hat belo|ng to re|
|000001b0| 63 74 61 6e 67 6c 65 20 | 62 75 74 20 61 72 65 20 |ctangle |but are |
|000001c0| 62 65 66 6f 72 65 20 74 | 68 61 74 20 70 6f 73 69 |before t|hat posi|
|000001d0| 74 69 6f 6e 2c 0a 20 6e | 75 6d 62 65 72 20 6f 66 |tion,. n|umber of|
|000001e0| 20 63 6f 6c 75 6d 6e 73 | 20 74 68 61 74 20 62 65 | columns| that be|
|000001f0| 6c 6f 6e 67 20 74 6f 20 | 72 65 63 74 61 6e 67 6c |long to |rectangl|
|00000200| 65 20 62 75 74 20 61 72 | 65 20 61 66 74 65 72 20 |e but ar|e after |
|00000210| 70 6f 69 6e 74 2e 0a 50 | 6f 69 6e 74 20 69 73 20 |point..P|oint is |
|00000220| 61 74 20 74 68 65 20 65 | 6e 64 20 6f 66 20 74 68 |at the e|nd of th|
|00000230| 65 20 73 65 67 6d 65 6e | 74 20 6f 66 20 74 68 69 |e segmen|t of thi|
|00000240| 73 20 6c 69 6e 65 20 77 | 69 74 68 69 6e 20 74 68 |s line w|ithin th|
|00000250| 65 20 72 65 63 74 61 6e | 67 6c 65 2e 22 20 28 62 |e rectan|gle." (b|
|00000260| 79 74 65 2d 63 6f 64 65 | 20 22 cc cc cc cc 1b 1a |yte-code| "......|
|00000270| 19 18 8a 0c 62 88 69 89 | 10 88 cd 20 88 60 89 11 |....b.i.|... .`..|
|00000280| 29 88 8a 0d 62 88 69 89 | 12 88 ce cf 21 88 d0 20 |)...b.i.|....!.. |
|00000290| 89 13 29 88 0a 08 57 83 | 3d 00 08 1e 06 0a 10 0e |..)...W.|=.......|
|000002a0| 06 89 12 29 82 3e 00 cc | 88 d1 0a 08 5c 22 83 ca |...).>..|....\"..|
|000002b0| 00 8a 09 62 88 60 0b 57 | 85 c6 00 cc cc cc 1e 09 |...b.`.W|........|
|000002c0| 1e 08 1e 07 d2 08 21 88 | 0e 0a 85 6b 00 69 08 56 |......!.|...k.i.V|
|000002d0| 85 6b 00 d3 08 21 88 69 | 08 5a 89 16 08 88 60 89 |.k...!.i|.Z....`.|
|000002e0| 16 07 88 d2 0a 21 88 69 | 0a 56 83 93 00 0e 0a 83 |.....!.i|.V......|
|000002f0| 8d 00 d3 0a 21 82 90 00 | d4 d5 21 82 94 00 cc 88 |....!...|..!.....|
|00000300| 0a 69 5a 89 16 09 88 0e | 08 d6 57 83 b1 00 0e 09 |.iZ.....|..W.....|
|00000310| 0e 08 5c 5c 16 09 d6 89 | 16 08 82 b2 00 cc 88 d7 |..\\....|........|
|00000320| 0e 0b 0e 07 0e 08 0e 09 | 24 2b 88 ce cf 21 88 82 |........|$+...!..|
|00000330| 4a 00 29 82 cb 00 cc 88 | 0a 08 5a 2c 87 22 20 5b |J.).....|..Z,." [|
|00000340| 73 74 61 72 74 63 6f 6c | 20 73 74 61 72 74 6c 69 |startcol| startli|
|00000350| 6e 65 70 6f 73 20 65 6e | 64 63 6f 6c 20 65 6e 64 |nepos en|dcol end|
|00000360| 6c 69 6e 65 70 6f 73 20 | 73 74 61 72 74 20 65 6e |linepos |start en|
|00000370| 64 20 74 65 6d 20 73 74 | 61 72 74 70 6f 73 20 62 |d tem st|artpos b|
|00000380| 65 67 65 78 74 72 61 20 | 65 6e 64 65 78 74 72 61 |egextra |endextra|
|00000390| 20 63 6f 65 72 63 65 2d | 74 61 62 73 20 66 75 6e | coerce-|tabs fun|
|000003a0| 63 74 69 6f 6e 20 6e 69 | 6c 20 62 65 67 69 6e 6e |ction ni|l beginn|
|000003b0| 69 6e 67 2d 6f 66 2d 6c | 69 6e 65 20 66 6f 72 77 |ing-of-l|ine forw|
|000003c0| 61 72 64 2d 6c 69 6e 65 | 20 31 20 70 6f 69 6e 74 |ard-line| 1 point|
|000003d0| 2d 6d 61 72 6b 65 72 20 | 2f 3d 20 6d 6f 76 65 2d |-marker |/= move-|
|000003e0| 74 6f 2d 63 6f 6c 75 6d | 6e 20 72 65 63 74 61 6e |to-colum|n rectan|
|000003f0| 67 6c 65 2d 63 6f 65 72 | 63 65 2d 74 61 62 20 66 |gle-coer|ce-tab f|
|00000400| 6f 72 77 61 72 64 2d 63 | 68 61 72 20 2d 31 20 30 |orward-c|har -1 0|
|00000410| 20 66 75 6e 63 61 6c 6c | 5d 20 31 35 29 29 0a 0a | funcall|] 15))..|
|00000420| 28 64 65 66 75 6e 20 64 | 65 6c 65 74 65 2d 72 65 |(defun d|elete-re|
|00000430| 63 74 61 6e 67 6c 65 2d | 6c 69 6e 65 20 28 73 74 |ctangle-|line (st|
|00000440| 61 72 74 64 65 6c 70 6f | 73 20 69 67 6e 6f 72 65 |artdelpo|s ignore|
|00000450| 20 69 67 6e 6f 72 65 29 | 20 28 62 79 74 65 2d 63 | ignore)| (byte-c|
|00000460| 6f 64 65 20 22 c1 08 60 | 5c 22 87 22 20 5b 73 74 |ode "..`|\"." [st|
|00000470| 61 72 74 64 65 6c 70 6f | 73 20 64 65 6c 65 74 65 |artdelpo|s delete|
|00000480| 2d 72 65 67 69 6f 6e 5d | 20 33 29 29 0a 0a 28 64 |-region]| 3))..(d|
|00000490| 65 66 75 6e 20 64 65 6c | 65 74 65 2d 65 78 74 72 |efun del|ete-extr|
|000004a0| 61 63 74 2d 72 65 63 74 | 61 6e 67 6c 65 2d 6c 69 |act-rect|angle-li|
|000004b0| 6e 65 20 28 73 74 61 72 | 74 64 65 6c 70 6f 73 20 |ne (star|tdelpos |
|000004c0| 62 65 67 65 78 74 72 61 | 20 65 6e 64 65 78 74 72 |begextra| endextr|
|000004d0| 61 29 20 28 62 79 74 65 | 2d 63 6f 64 65 20 22 8a |a) (byte|-code ".|
|000004e0| c3 08 09 0a 23 29 88 c4 | 08 60 5c 22 87 22 20 5b |....#)..|.`\"." [|
|000004f0| 73 74 61 72 74 64 65 6c | 70 6f 73 20 62 65 67 65 |startdel|pos bege|
|00000500| 78 74 72 61 20 65 6e 64 | 65 78 74 72 61 20 65 78 |xtra end|extra ex|
|00000510| 74 72 61 63 74 2d 72 65 | 63 74 61 6e 67 6c 65 2d |tract-re|ctangle-|
|00000520| 6c 69 6e 65 20 64 65 6c | 65 74 65 2d 72 65 67 69 |line del|ete-regi|
|00000530| 6f 6e 5d 20 34 29 29 0a | 0a 28 64 65 66 75 6e 20 |on] 4)).|.(defun |
|00000540| 65 78 74 72 61 63 74 2d | 72 65 63 74 61 6e 67 6c |extract-|rectangl|
|00000550| 65 2d 6c 69 6e 65 20 28 | 73 74 61 72 74 64 65 6c |e-line (|startdel|
|00000560| 70 6f 73 20 62 65 67 65 | 78 74 72 61 20 65 6e 64 |pos bege|xtra end|
|00000570| 65 78 74 72 61 29 20 28 | 62 79 74 65 2d 63 6f 64 |extra) (|byte-cod|
|00000580| 65 20 22 c8 09 60 5c 22 | 60 1a 18 09 62 88 c9 ca |e "..`\"|`...b...|
|00000590| 0a c3 23 85 38 00 69 8a | cb cc 21 88 69 29 5a 1c |..#.8.i.|..!.i)Z.|
|000005a0| 08 cd ce 60 0a cf 23 4f | d0 0c 21 08 08 47 60 0a |...`..#O|..!..G`.|
|000005b0| 5a 5c 5c d1 4f 51 89 10 | 29 88 82 0a 00 88 0d cd |Z\\.OQ..|).......|
|000005c0| 56 86 43 00 0e 06 cd 56 | 83 54 00 d0 0d 21 08 d0 |V.C....V|.T...!..|
|000005d0| 0e 06 21 51 89 10 82 55 | 00 d1 88 08 0e 07 42 89 |..!Q...U|......B.|
|000005e0| 16 07 2a 87 22 20 5b 6c | 69 6e 65 20 73 74 61 72 |..*." [l|ine star|
|000005f0| 74 64 65 6c 70 6f 73 20 | 65 6e 64 20 74 20 77 69 |tdelpos |end t wi|
|00000600| 64 74 68 20 62 65 67 65 | 78 74 72 61 20 65 6e 64 |dth bege|xtra end|
|00000610| 65 78 74 72 61 20 6c 69 | 6e 65 73 20 62 75 66 66 |extra li|nes buff|
|00000620| 65 72 2d 73 75 62 73 74 | 72 69 6e 67 20 73 65 61 |er-subst|ring sea|
|00000630| 72 63 68 2d 66 6f 72 77 | 61 72 64 20 22 09 22 20 |rch-forw|ard "." |
|00000640| 66 6f 72 77 61 72 64 2d | 63 68 61 72 20 2d 31 20 |forward-|char -1 |
|00000650| 30 20 2d 20 31 20 73 70 | 61 63 65 73 2d 73 74 72 |0 - 1 sp|aces-str|
|00000660| 69 6e 67 20 6e 69 6c 5d | 20 31 32 29 29 0a 0a 28 |ing nil]| 12))..(|
|00000670| 64 65 66 63 6f 6e 73 74 | 20 73 70 61 63 65 73 2d |defconst| spaces-|
|00000680| 73 74 72 69 6e 67 73 20 | 28 71 75 6f 74 65 20 5b |strings |(quote [|
|00000690| 22 22 20 22 20 22 20 22 | 20 20 22 20 22 20 20 20 |"" " " "| " " |
|000006a0| 22 20 22 20 20 20 20 22 | 20 22 20 20 20 20 20 22 |" " "| " "|
|000006b0| 20 22 20 20 20 20 20 20 | 22 20 22 20 20 20 20 20 | " |" " |
|000006c0| 20 20 22 20 22 20 20 20 | 20 20 20 20 20 22 5d 29 | " " | "])|
|000006d0| 29 0a 0a 28 64 65 66 75 | 6e 20 73 70 61 63 65 73 |)..(defu|n spaces|
|000006e0| 2d 73 74 72 69 6e 67 20 | 28 6e 29 20 28 62 79 74 |-string |(n) (byt|
|000006f0| 65 2d 63 6f 64 65 20 22 | 08 c3 58 83 0c 00 09 08 |e-code "|..X.....|
|00000700| 48 82 28 00 c4 1a 08 c3 | 56 85 21 00 c5 0a 50 12 |H.(.....|V.!...P.|
|00000710| 08 c3 5a 89 10 88 82 0e | 00 88 0a 09 08 48 50 29 |..Z.....|.....HP)|
|00000720| 87 22 20 5b 6e 20 73 70 | 61 63 65 73 2d 73 74 72 |." [n sp|aces-str|
|00000730| 69 6e 67 73 20 76 61 6c | 20 38 20 22 22 20 22 20 |ings val| 8 "" " |
|00000740| 20 20 20 20 20 20 20 22 | 5d 20 33 29 29 0a 0a 28 | "|] 3))..(|
|00000750| 64 65 66 75 6e 20 64 65 | 6c 65 74 65 2d 72 65 63 |defun de|lete-rec|
|00000760| 74 61 6e 67 6c 65 20 28 | 73 74 61 72 74 20 65 6e |tangle (|start en|
|00000770| 64 29 20 22 5c 0a 44 65 | 6c 65 74 65 20 28 64 6f |d) "\.De|lete (do|
|00000780| 6e 27 74 20 73 61 76 65 | 29 20 74 65 78 74 20 69 |n't save|) text i|
|00000790| 6e 20 72 65 63 74 61 6e | 67 6c 65 20 77 69 74 68 |n rectan|gle with|
|000007a0| 20 70 6f 69 6e 74 20 61 | 6e 64 20 6d 61 72 6b 20 | point a|nd mark |
|000007b0| 61 73 20 63 6f 72 6e 65 | 72 73 2e 0a 54 68 65 20 |as corne|rs..The |
|000007c0| 73 61 6d 65 20 72 61 6e | 67 65 20 6f 66 20 63 6f |same ran|ge of co|
|000007d0| 6c 75 6d 6e 73 20 69 73 | 20 64 65 6c 65 74 65 64 |lumns is| deleted|
|000007e0| 20 69 6e 20 65 61 63 68 | 20 6c 69 6e 65 0a 73 74 | in each| line.st|
|000007f0| 61 72 74 69 6e 67 20 77 | 69 74 68 20 74 68 65 20 |arting w|ith the |
|00000800| 6c 69 6e 65 20 77 68 65 | 72 65 20 74 68 65 20 72 |line whe|re the r|
|00000810| 65 67 69 6f 6e 20 62 65 | 67 69 6e 73 0a 61 6e 64 |egion be|gins.and|
|00000820| 20 65 6e 64 69 6e 67 20 | 77 69 74 68 20 74 68 65 | ending |with the|
|00000830| 20 6c 69 6e 65 20 77 68 | 65 72 65 20 74 68 65 20 | line wh|ere the |
|00000840| 72 65 67 69 6f 6e 20 65 | 6e 64 73 2e 22 20 28 69 |region e|nds." (i|
|00000850| 6e 74 65 72 61 63 74 69 | 76 65 20 22 72 22 29 20 |nteracti|ve "r") |
|00000860| 28 62 79 74 65 2d 63 6f | 64 65 20 22 c3 88 c4 c5 |(byte-co|de "....|
|00000870| 08 09 c2 24 87 22 20 5b | 73 74 61 72 74 20 65 6e |...$." [|start en|
|00000880| 64 20 74 20 6e 69 6c 20 | 6f 70 65 72 61 74 65 2d |d t nil |operate-|
|00000890| 6f 6e 2d 72 65 63 74 61 | 6e 67 6c 65 20 64 65 6c |on-recta|ngle del|
|000008a0| 65 74 65 2d 72 65 63 74 | 61 6e 67 6c 65 2d 6c 69 |ete-rect|angle-li|
|000008b0| 6e 65 5d 20 35 29 29 0a | 0a 28 64 65 66 75 6e 20 |ne] 5)).|.(defun |
|000008c0| 64 65 6c 65 74 65 2d 65 | 78 74 72 61 63 74 2d 72 |delete-e|xtract-r|
|000008d0| 65 63 74 61 6e 67 6c 65 | 20 28 73 74 61 72 74 20 |ectangle| (start |
|000008e0| 65 6e 64 29 20 22 5c 0a | 52 65 74 75 72 6e 20 61 |end) "\.|Return a|
|000008f0| 6e 64 20 64 65 6c 65 74 | 65 20 63 6f 6e 74 65 6e |nd delet|e conten|
|00000900| 74 73 20 6f 66 20 72 65 | 63 74 61 6e 67 6c 65 20 |ts of re|ctangle |
|00000910| 77 69 74 68 20 63 6f 72 | 6e 65 72 73 20 61 74 20 |with cor|ners at |
|00000920| 53 54 41 52 54 20 61 6e | 64 20 45 4e 44 2e 0a 56 |START an|d END..V|
|00000930| 61 6c 75 65 20 69 73 20 | 6c 69 73 74 20 6f 66 20 |alue is |list of |
|00000940| 73 74 72 69 6e 67 73 2c | 20 6f 6e 65 20 66 6f 72 |strings,| one for|
|00000950| 20 65 61 63 68 20 6c 69 | 6e 65 20 6f 66 20 74 68 | each li|ne of th|
|00000960| 65 20 72 65 63 74 61 6e | 67 6c 65 2e 22 20 28 62 |e rectan|gle." (b|
|00000970| 79 74 65 2d 63 6f 64 65 | 20 22 c4 18 c5 c6 09 0a |yte-code| "......|
|00000980| c3 24 88 c7 08 21 29 87 | 22 20 5b 6c 69 6e 65 73 |.$...!).|" [lines|
|00000990| 20 73 74 61 72 74 20 65 | 6e 64 20 74 20 6e 69 6c | start e|nd t nil|
|000009a0| 20 6f 70 65 72 61 74 65 | 2d 6f 6e 2d 72 65 63 74 | operate|-on-rect|
|000009b0| 61 6e 67 6c 65 20 64 65 | 6c 65 74 65 2d 65 78 74 |angle de|lete-ext|
|000009c0| 72 61 63 74 2d 72 65 63 | 74 61 6e 67 6c 65 2d 6c |ract-rec|tangle-l|
|000009d0| 69 6e 65 20 6e 72 65 76 | 65 72 73 65 5d 20 35 29 |ine nrev|erse] 5)|
|000009e0| 29 0a 0a 28 64 65 66 75 | 6e 20 65 78 74 72 61 63 |)..(defu|n extrac|
|000009f0| 74 2d 72 65 63 74 61 6e | 67 6c 65 20 28 73 74 61 |t-rectan|gle (sta|
|00000a00| 72 74 20 65 6e 64 29 20 | 22 5c 0a 52 65 74 75 72 |rt end) |"\.Retur|
|00000a10| 6e 20 63 6f 6e 74 65 6e | 74 73 20 6f 66 20 72 65 |n conten|ts of re|
|00000a20| 63 74 61 6e 67 6c 65 20 | 77 69 74 68 20 63 6f 72 |ctangle |with cor|
|00000a30| 6e 65 72 73 20 61 74 20 | 53 54 41 52 54 20 61 6e |ners at |START an|
|00000a40| 64 20 45 4e 44 2e 0a 56 | 61 6c 75 65 20 69 73 20 |d END..V|alue is |
|00000a50| 6c 69 73 74 20 6f 66 20 | 73 74 72 69 6e 67 73 2c |list of |strings,|
|00000a60| 20 6f 6e 65 20 66 6f 72 | 20 65 61 63 68 20 6c 69 | one for| each li|
|00000a70| 6e 65 20 6f 66 20 74 68 | 65 20 72 65 63 74 61 6e |ne of th|e rectan|
|00000a80| 67 6c 65 2e 22 20 28 62 | 79 74 65 2d 63 6f 64 65 |gle." (b|yte-code|
|00000a90| 20 22 c3 18 c4 c5 09 0a | c3 24 88 c6 08 21 29 87 | "......|.$...!).|
|00000aa0| 22 20 5b 6c 69 6e 65 73 | 20 73 74 61 72 74 20 65 |" [lines| start e|
|00000ab0| 6e 64 20 6e 69 6c 20 6f | 70 65 72 61 74 65 2d 6f |nd nil o|perate-o|
|00000ac0| 6e 2d 72 65 63 74 61 6e | 67 6c 65 20 65 78 74 72 |n-rectan|gle extr|
|00000ad0| 61 63 74 2d 72 65 63 74 | 61 6e 67 6c 65 2d 6c 69 |act-rect|angle-li|
|00000ae0| 6e 65 20 6e 72 65 76 65 | 72 73 65 5d 20 35 29 29 |ne nreve|rse] 5))|
|00000af0| 0a 0a 28 64 65 66 76 61 | 72 20 6b 69 6c 6c 65 64 |..(defva|r killed|
|00000b00| 2d 72 65 63 74 61 6e 67 | 6c 65 20 6e 69 6c 20 22 |-rectang|le nil "|
|00000b10| 5c 0a 52 65 63 74 61 6e | 67 6c 65 20 66 6f 72 20 |\.Rectan|gle for |
|00000b20| 79 61 6e 6b 2d 72 65 63 | 74 61 6e 67 6c 65 20 74 |yank-rec|tangle t|
|00000b30| 6f 20 69 6e 73 65 72 74 | 2e 22 29 0a 0a 28 64 65 |o insert|.")..(de|
|00000b40| 66 75 6e 20 6b 69 6c 6c | 2d 72 65 63 74 61 6e 67 |fun kill|-rectang|
|00000b50| 6c 65 20 28 73 74 61 72 | 74 20 65 6e 64 29 20 22 |le (star|t end) "|
|00000b60| 5c 0a 44 65 6c 65 74 65 | 20 72 65 63 74 61 6e 67 |\.Delete| rectang|
|00000b70| 6c 65 20 77 69 74 68 20 | 63 6f 72 6e 65 72 73 20 |le with |corners |
|00000b80| 61 74 20 70 6f 69 6e 74 | 20 61 6e 64 20 6d 61 72 |at point| and mar|
|00000b90| 6b 3b 20 73 61 76 65 20 | 61 73 20 6c 61 73 74 20 |k; save |as last |
|00000ba0| 6b 69 6c 6c 65 64 20 6f | 6e 65 2e 0a 43 61 6c 6c |killed o|ne..Call|
|00000bb0| 69 6e 67 20 66 72 6f 6d | 20 70 72 6f 67 72 61 6d |ing from| program|
|00000bc0| 2c 20 73 75 70 70 6c 79 | 20 74 77 6f 20 61 72 67 |, supply| two arg|
|00000bd0| 73 20 53 54 41 52 54 20 | 61 6e 64 20 45 4e 44 2c |s START |and END,|
|00000be0| 20 62 75 66 66 65 72 20 | 70 6f 73 69 74 69 6f 6e | buffer |position|
|00000bf0| 73 2e 0a 42 75 74 20 69 | 6e 20 70 72 6f 67 72 61 |s..But i|n progra|
|00000c00| 6d 73 20 79 6f 75 20 6d | 69 67 68 74 20 70 72 65 |ms you m|ight pre|
|00000c10| 66 65 72 20 74 6f 20 75 | 73 65 20 64 65 6c 65 74 |fer to u|se delet|
|00000c20| 65 2d 65 78 74 72 61 63 | 74 2d 72 65 63 74 61 6e |e-extrac|t-rectan|
|00000c30| 67 6c 65 2e 22 20 28 69 | 6e 74 65 72 61 63 74 69 |gle." (i|nteracti|
|00000c40| 76 65 20 22 72 22 29 20 | 28 62 79 74 65 2d 63 6f |ve "r") |(byte-co|
|00000c50| 64 65 20 22 c3 88 c4 09 | 0a 5c 22 89 10 87 22 20 |de "....|.\"..." |
|00000c60| 5b 6b 69 6c 6c 65 64 2d | 72 65 63 74 61 6e 67 6c |[killed-|rectangl|
|00000c70| 65 20 73 74 61 72 74 20 | 65 6e 64 20 6e 69 6c 20 |e start |end nil |
|00000c80| 64 65 6c 65 74 65 2d 65 | 78 74 72 61 63 74 2d 72 |delete-e|xtract-r|
|00000c90| 65 63 74 61 6e 67 6c 65 | 5d 20 33 29 29 0a 0a 28 |ectangle|] 3))..(|
|00000ca0| 64 65 66 75 6e 20 79 61 | 6e 6b 2d 72 65 63 74 61 |defun ya|nk-recta|
|00000cb0| 6e 67 6c 65 20 6e 69 6c | 20 22 5c 0a 59 61 6e 6b |ngle nil| "\.Yank|
|00000cc0| 20 74 68 65 20 6c 61 73 | 74 20 6b 69 6c 6c 65 64 | the las|t killed|
|00000cd0| 20 72 65 63 74 61 6e 67 | 6c 65 20 77 69 74 68 20 | rectang|le with |
|00000ce0| 75 70 70 65 72 20 6c 65 | 66 74 20 63 6f 72 6e 65 |upper le|ft corne|
|00000cf0| 72 20 61 74 20 70 6f 69 | 6e 74 2e 22 20 28 69 6e |r at poi|nt." (in|
|00000d00| 74 65 72 61 63 74 69 76 | 65 29 20 28 62 79 74 65 |teractiv|e) (byte|
|00000d10| 2d 63 6f 64 65 20 22 c1 | 88 c2 08 21 87 22 20 5b |-code ".|...!." [|
|00000d20| 6b 69 6c 6c 65 64 2d 72 | 65 63 74 61 6e 67 6c 65 |killed-r|ectangle|
|00000d30| 20 6e 69 6c 20 69 6e 73 | 65 72 74 2d 72 65 63 74 | nil ins|ert-rect|
|00000d40| 61 6e 67 6c 65 5d 20 32 | 29 29 0a 0a 28 64 65 66 |angle] 2|))..(def|
|00000d50| 75 6e 20 69 6e 73 65 72 | 74 2d 72 65 63 74 61 6e |un inser|t-rectan|
|00000d60| 67 6c 65 20 28 72 65 63 | 74 61 6e 67 6c 65 29 20 |gle (rec|tangle) |
|00000d70| 22 5c 0a 49 6e 73 65 72 | 74 20 74 65 78 74 20 6f |"\.Inser|t text o|
|00000d80| 66 20 52 45 43 54 41 4e | 47 4c 45 20 77 69 74 68 |f RECTAN|GLE with|
|00000d90| 20 75 70 70 65 72 20 6c | 65 66 74 20 63 6f 72 6e | upper l|eft corn|
|00000da0| 65 72 20 61 74 20 70 6f | 69 6e 74 2e 0a 52 45 43 |er at po|int..REC|
|00000db0| 54 41 4e 47 4c 45 27 73 | 20 66 69 72 73 74 20 6c |TANGLE's| first l|
|00000dc0| 69 6e 65 20 69 73 20 69 | 6e 73 65 72 74 65 64 20 |ine is i|nserted |
|00000dd0| 61 74 20 70 6f 69 6e 74 | 2c 0a 69 74 73 20 73 65 |at point|,.its se|
|00000de0| 63 6f 6e 64 20 6c 69 6e | 65 20 69 73 20 69 6e 73 |cond lin|e is ins|
|00000df0| 65 72 74 65 64 20 61 74 | 20 61 20 70 6f 69 6e 74 |erted at| a point|
|00000e00| 20 76 65 72 74 69 63 61 | 6c 6c 79 20 75 6e 64 65 | vertica|lly unde|
|00000e10| 72 20 70 6f 69 6e 74 2c | 20 65 74 63 2e 0a 52 45 |r point,| etc..RE|
|00000e20| 43 54 41 4e 47 4c 45 20 | 73 68 6f 75 6c 64 20 62 |CTANGLE |should b|
|00000e30| 65 20 61 20 6c 69 73 74 | 20 6f 66 20 73 74 72 69 |e a list| of stri|
|00000e40| 6e 67 73 2e 22 20 28 62 | 79 74 65 2d 63 6f 64 65 |ngs." (b|yte-code|
|00000e50| 20 22 09 69 c4 1b 1a 18 | 08 85 48 00 0b 86 37 00 | ".i....|..H...7.|
|00000e60| c6 c7 21 88 6e 86 18 00 | c8 63 88 c9 0a 21 88 69 |..!.n...|.c...!.i|
|00000e70| 0a 56 83 29 00 ca 0a 21 | 82 2a 00 c5 88 69 0a 57 |.V.)...!|.*...i.W|
|00000e80| 83 36 00 0a 6a 82 37 00 | c5 88 c5 89 13 88 08 40 |.6..j.7.|.......@|
|00000e90| 63 88 08 41 89 10 88 82 | 06 00 2b 87 22 20 5b 6c |c..A....|..+." [l|
|00000ea0| 69 6e 65 73 20 72 65 63 | 74 61 6e 67 6c 65 20 69 |ines rec|tangle i|
|00000eb0| 6e 73 65 72 74 63 6f 6c | 75 6d 6e 20 66 69 72 73 |nsertcol|umn firs|
|00000ec0| 74 20 74 20 6e 69 6c 20 | 66 6f 72 77 61 72 64 2d |t t nil |forward-|
|00000ed0| 6c 69 6e 65 20 31 20 31 | 30 20 6d 6f 76 65 2d 74 |line 1 1|0 move-t|
|00000ee0| 6f 2d 63 6f 6c 75 6d 6e | 20 72 65 63 74 61 6e 67 |o-column| rectang|
|00000ef0| 6c 65 2d 63 6f 65 72 63 | 65 2d 74 61 62 5d 20 36 |le-coerc|e-tab] 6|
|00000f00| 29 29 0a 0a 28 64 65 66 | 75 6e 20 6f 70 65 6e 2d |))..(def|un open-|
|00000f10| 72 65 63 74 61 6e 67 6c | 65 20 28 73 74 61 72 74 |rectangl|e (start|
|00000f20| 20 65 6e 64 29 20 22 5c | 0a 42 6c 61 6e 6b 20 6f | end) "\|.Blank o|
|00000f30| 75 74 20 72 65 63 74 61 | 6e 67 6c 65 20 77 69 74 |ut recta|ngle wit|
|00000f40| 68 20 63 6f 72 6e 65 72 | 73 20 61 74 20 70 6f 69 |h corner|s at poi|
|00000f50| 6e 74 20 61 6e 64 20 6d | 61 72 6b 2c 20 73 68 69 |nt and m|ark, shi|
|00000f60| 66 74 69 6e 67 20 74 65 | 78 74 20 72 69 67 68 74 |fting te|xt right|
|00000f70| 2e 0a 54 68 65 20 74 65 | 78 74 20 70 72 65 76 69 |..The te|xt previ|
|00000f80| 6f 75 73 6c 79 20 69 6e | 20 74 68 65 20 72 65 67 |ously in| the reg|
|00000f90| 69 6f 6e 20 69 73 20 6e | 6f 74 20 6f 76 65 72 77 |ion is n|ot overw|
|00000fa0| 72 69 74 74 65 6e 20 62 | 79 20 74 68 65 20 62 6c |ritten b|y the bl|
|00000fb0| 61 6e 6b 73 2c 0a 62 75 | 74 20 69 6e 73 74 65 64 |anks,.bu|t insted|
|00000fc0| 20 77 69 6e 64 73 20 75 | 70 20 74 6f 20 74 68 65 | winds u|p to the|
|00000fd0| 20 72 69 67 68 74 20 6f | 66 20 74 68 65 20 72 65 | right o|f the re|
|00000fe0| 63 74 61 6e 67 6c 65 2e | 22 20 28 69 6e 74 65 72 |ctangle.|" (inter|
|00000ff0| 61 63 74 69 76 65 20 22 | 72 22 29 20 28 62 79 74 |active "|r") (byt|
|00001000| 65 2d 63 6f 64 65 20 22 | c2 88 c3 c4 08 09 c2 24 |e-code "|.......$|
|00001010| 87 22 20 5b 73 74 61 72 | 74 20 65 6e 64 20 6e 69 |." [star|t end ni|
|00001020| 6c 20 6f 70 65 72 61 74 | 65 2d 6f 6e 2d 72 65 63 |l operat|e-on-rec|
|00001030| 74 61 6e 67 6c 65 20 6f | 70 65 6e 2d 72 65 63 74 |tangle o|pen-rect|
|00001040| 61 6e 67 6c 65 2d 6c 69 | 6e 65 5d 20 35 29 29 0a |angle-li|ne] 5)).|
|00001050| 0a 28 64 65 66 75 6e 20 | 6f 70 65 6e 2d 72 65 63 |.(defun |open-rec|
|00001060| 74 61 6e 67 6c 65 2d 6c | 69 6e 65 20 28 73 74 61 |tangle-l|ine (sta|
|00001070| 72 74 70 6f 73 20 62 65 | 67 65 78 74 72 61 20 65 |rtpos be|gextra e|
|00001080| 6e 64 65 78 74 72 61 29 | 20 28 62 79 74 65 2d 63 |ndextra)| (byte-c|
|00001090| 6f 64 65 20 22 c5 69 09 | 0a 23 18 0b 62 88 69 1c |ode ".i.|.#..b.i.|
|000010a0| c6 c7 21 88 08 69 0c 5a | 5c 5c 89 10 29 88 c8 60 |..!..i.Z|\\..)..`|
|000010b0| c9 c7 21 88 60 5c 22 88 | 08 6a 29 87 22 20 5b 63 |..!.`\".|.j)." [c|
|000010c0| 6f 6c 75 6d 6e 20 62 65 | 67 65 78 74 72 61 20 65 |olumn be|gextra e|
|000010d0| 6e 64 65 78 74 72 61 20 | 73 74 61 72 74 70 6f 73 |ndextra |startpos|
|000010e0| 20 6f 63 6f 6c 20 2b 20 | 73 6b 69 70 2d 63 68 61 | ocol + |skip-cha|
|000010f0| 72 73 2d 66 6f 72 77 61 | 72 64 20 22 20 09 22 20 |rs-forwa|rd " ." |
|00001100| 64 65 6c 65 74 65 2d 72 | 65 67 69 6f 6e 20 73 6b |delete-r|egion sk|
|00001110| 69 70 2d 63 68 61 72 73 | 2d 62 61 63 6b 77 61 72 |ip-chars|-backwar|
|00001120| 64 5d 20 36 29 29 0a 0a | 28 64 65 66 75 6e 20 63 |d] 6))..|(defun c|
|00001130| 6c 65 61 72 2d 72 65 63 | 74 61 6e 67 6c 65 20 28 |lear-rec|tangle (|
|00001140| 73 74 61 72 74 20 65 6e | 64 29 20 22 5c 0a 42 6c |start en|d) "\.Bl|
|00001150| 61 6e 6b 20 6f 75 74 20 | 72 65 63 74 61 6e 67 6c |ank out |rectangl|
|00001160| 65 20 77 69 74 68 20 63 | 6f 72 6e 65 72 73 20 61 |e with c|orners a|
|00001170| 74 20 70 6f 69 6e 74 20 | 61 6e 64 20 6d 61 72 6b |t point |and mark|
|00001180| 2e 0a 54 68 65 20 74 65 | 78 74 20 70 72 65 76 69 |..The te|xt previ|
|00001190| 6f 75 73 6c 79 20 69 6e | 20 74 68 65 20 72 65 67 |ously in| the reg|
|000011a0| 69 6f 6e 20 69 73 20 6f | 76 65 72 77 72 69 74 74 |ion is o|verwritt|
|000011b0| 65 6e 20 62 79 20 74 68 | 65 20 62 6c 61 6e 6b 73 |en by th|e blanks|
|000011c0| 2e 22 20 28 69 6e 74 65 | 72 61 63 74 69 76 65 20 |." (inte|ractive |
|000011d0| 22 72 22 29 20 28 62 79 | 74 65 2d 63 6f 64 65 20 |"r") (by|te-code |
|000011e0| 22 c3 88 c4 c5 08 09 c2 | 24 87 22 20 5b 73 74 61 |".......|$." [sta|
|000011f0| 72 74 20 65 6e 64 20 74 | 20 6e 69 6c 20 6f 70 65 |rt end t| nil ope|
|00001200| 72 61 74 65 2d 6f 6e 2d | 72 65 63 74 61 6e 67 6c |rate-on-|rectangl|
|00001210| 65 20 63 6c 65 61 72 2d | 72 65 63 74 61 6e 67 6c |e clear-|rectangl|
|00001220| 65 2d 6c 69 6e 65 5d 20 | 35 29 29 0a 0a 28 64 65 |e-line] |5))..(de|
|00001230| 66 75 6e 20 63 6c 65 61 | 72 2d 72 65 63 74 61 6e |fun clea|r-rectan|
|00001240| 67 6c 65 2d 6c 69 6e 65 | 20 28 73 74 61 72 74 70 |gle-line| (startp|
|00001250| 6f 73 20 62 65 67 65 78 | 74 72 61 20 65 6e 64 65 |os begex|tra ende|
|00001260| 78 74 72 61 29 20 28 62 | 79 74 65 2d 63 6f 64 65 |xtra) (b|yte-code|
|00001270| 20 22 c3 c4 21 88 69 09 | 5c 5c 18 c5 60 0a 62 88 | "..!.i.|\\..`.b.|
|00001280| c6 c4 21 88 60 5c 22 88 | 08 6a 29 87 22 20 5b 63 |..!.`\".|.j)." [c|
|00001290| 6f 6c 75 6d 6e 20 65 6e | 64 65 78 74 72 61 20 73 |olumn en|dextra s|
|000012a0| 74 61 72 74 70 6f 73 20 | 73 6b 69 70 2d 63 68 61 |tartpos |skip-cha|
|000012b0| 72 73 2d 66 6f 72 77 61 | 72 64 20 22 20 09 22 20 |rs-forwa|rd " ." |
|000012c0| 64 65 6c 65 74 65 2d 72 | 65 67 69 6f 6e 20 73 6b |delete-r|egion sk|
|000012d0| 69 70 2d 63 68 61 72 73 | 2d 62 61 63 6b 77 61 72 |ip-chars|-backwar|
|000012e0| 64 5d 20 35 29 29 0a 0a | 28 64 65 66 75 6e 20 72 |d] 5))..|(defun r|
|000012f0| 65 63 74 61 6e 67 6c 65 | 2d 63 6f 65 72 63 65 2d |ectangle|-coerce-|
|00001300| 74 61 62 20 28 63 6f 6c | 75 6d 6e 29 20 28 62 79 |tab (col|umn) (by|
|00001310| 74 65 2d 63 6f 64 65 20 | 22 69 c2 19 18 c4 c5 21 |te-code |"i.....!|
|00001320| 88 08 6a 88 c6 08 0b 5a | 21 2a 87 22 20 5b 61 66 |..j....Z|!*." [af|
|00001330| 74 65 72 63 6f 6c 20 69 | 6e 64 65 6e 74 2d 74 61 |tercol i|ndent-ta|
|00001340| 62 73 2d 6d 6f 64 65 20 | 6e 69 6c 20 63 6f 6c 75 |bs-mode |nil colu|
|00001350| 6d 6e 20 64 65 6c 65 74 | 65 2d 63 68 61 72 20 2d |mn delet|e-char -|
|00001360| 31 20 62 61 63 6b 77 61 | 72 64 2d 63 68 61 72 5d |1 backwa|rd-char]|
|00001370| 20 34 29 29 0a | | 4)). | |
+--------+-------------------------+-------------------------+--------+--------+