home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / source / a2.0bemacs-src.lha / Emacs-19.25 / lisp / rect.elc < prev    next >
Emacs Compiled Lisp  |  1994-05-04  |  5.5 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/XEmacs v19 byte-compiled Lisp data default
99% file data default
100% TrID Emacs/XEmacs byte-compiled Lisp (generic) default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 3b 45 4c 43 13 00 00 00 | 0a 3b 3b 3b 20 63 6f 6d |;ELC....|.;;; com|
|00000010| 70 69 6c 65 64 20 62 79 | 20 6b 77 7a 68 40 68 61 |piled by| kwzh@ha|
|00000020| 6c 2e 67 6e 75 2e 61 69 | 2e 6d 69 74 2e 65 64 75 |l.gnu.ai|.mit.edu|
|00000030| 20 6f 6e 20 54 75 65 20 | 4d 61 79 20 20 33 20 32 | on Tue |May 3 2|
|00000040| 31 3a 35 32 3a 34 39 20 | 31 39 39 34 0a 3b 3b 3b |1:52:49 |1994.;;;|
|00000050| 20 66 72 6f 6d 20 66 69 | 6c 65 20 2f 67 64 2f 67 | from fi|le /gd/g|
|00000060| 6e 75 2f 65 6d 61 63 73 | 2f 31 39 2e 30 2f 6c 69 |nu/emacs|/19.0/li|
|00000070| 73 70 2f 72 65 63 74 2e | 65 6c 0a 3b 3b 3b 20 65 |sp/rect.|el.;;; e|
|00000080| 6d 61 63 73 20 76 65 72 | 73 69 6f 6e 20 31 39 2e |macs ver|sion 19.|
|00000090| 32 32 2e 39 32 2e 32 2e | 0a 3b 3b 3b 20 62 79 74 |22.92.2.|.;;; byt|
|000000a0| 65 63 6f 6d 70 20 76 65 | 72 73 69 6f 6e 20 46 53 |ecomp ve|rsion FS|
|000000b0| 46 20 32 2e 31 30 0a 3b | 3b 3b 20 6f 70 74 69 6d |F 2.10.;|;; optim|
|000000c0| 69 7a 61 74 69 6f 6e 20 | 69 73 20 6f 6e 2e 0a 3b |ization |is on..;|
|000000d0| 3b 3b 20 74 68 69 73 20 | 66 69 6c 65 20 75 73 65 |;; this |file use|
|000000e0| 73 20 6f 70 63 6f 64 65 | 73 20 77 68 69 63 68 20 |s opcode|s which |
|000000f0| 64 6f 20 6e 6f 74 20 65 | 78 69 73 74 20 69 6e 20 |do not e|xist in |
|00000100| 45 6d 61 63 73 20 31 38 | 2e 0a 0a 28 69 66 20 28 |Emacs 18|...(if (|
|00000110| 61 6e 64 20 28 62 6f 75 | 6e 64 70 20 27 65 6d 61 |and (bou|ndp 'ema|
|00000120| 63 73 2d 76 65 72 73 69 | 6f 6e 29 0a 09 20 28 6f |cs-versi|on).. (o|
|00000130| 72 20 28 61 6e 64 20 28 | 62 6f 75 6e 64 70 20 27 |r (and (|boundp '|
|00000140| 65 70 6f 63 68 3a 3a 76 | 65 72 73 69 6f 6e 29 20 |epoch::v|ersion) |
|00000150| 65 70 6f 63 68 3a 3a 76 | 65 72 73 69 6f 6e 29 0a |epoch::v|ersion).|
|00000160| 09 20 20 20 20 20 28 73 | 74 72 69 6e 67 2d 6c 65 |. (s|tring-le|
|00000170| 73 73 70 20 65 6d 61 63 | 73 2d 76 65 72 73 69 6f |ssp emac|s-versio|
|00000180| 6e 20 22 31 39 22 29 29 | 29 0a 20 20 20 20 28 65 |n "19"))|). (e|
|00000190| 72 72 6f 72 20 22 60 2f | 67 64 2f 67 6e 75 2f 65 |rror "`/|gd/gnu/e|
|000001a0| 6d 61 63 73 2f 31 39 2e | 30 2f 6c 69 73 70 2f 72 |macs/19.|0/lisp/r|
|000001b0| 65 63 74 2e 65 6c 27 20 | 77 61 73 20 63 6f 6d 70 |ect.el' |was comp|
|000001c0| 69 6c 65 64 20 66 6f 72 | 20 45 6d 61 63 73 20 31 |iled for| Emacs 1|
|000001d0| 39 22 29 29 0a 0a 28 64 | 65 66 61 6c 69 61 73 20 |9"))..(d|efalias |
|000001e0| 27 6f 70 65 72 61 74 65 | 2d 6f 6e 2d 72 65 63 74 |'operate|-on-rect|
|000001f0| 61 6e 67 6c 65 20 23 5b | 28 66 75 6e 63 74 69 6f |angle #[|(functio|
|00000200| 6e 20 73 74 61 72 74 20 | 65 6e 64 20 63 6f 65 72 |n start |end coer|
|00000210| 63 65 2d 74 61 62 73 29 | 20 22 c0 89 89 89 19 1a |ce-tabs)| "......|
|00000220| 1b 1c 8a 0d 62 88 69 14 | c6 79 88 60 13 29 8a 0e |....b.i.|.y.`.)..|
|00000230| 07 62 88 69 12 c8 79 88 | c9 20 11 29 5c 6e 5c 66 |.b.i..y.|. .)\n\f|
|00000240| 57 83 2c 00 5c 6e 5c 66 | 12 14 8a 0b 62 88 60 09 |W.,.\n\f|....b.`.|
|00000250| 57 83 7a 00 c0 89 89 1e | 5c 6e 1e 0b 1e 5c 66 cd |W.z.....|\n...\f.|
|00000260| 5c 66 0e 0e 5c 22 88 69 | 5c 66 5a 16 0b 60 16 5c |\f..\".i|\fZ..`.\|
|00000270| 66 cd 5c 6e 0e 0e 5c 22 | 88 5c 6e 69 5a 16 5c 6e |f.\n..\"|.\niZ.\n|
|00000280| 0e 0b c6 57 83 69 00 0e | 5c 6e 0e 0b 5c 5c 16 5c |...W.i..|\n..\\.\|
|00000290| 6e c6 16 0b 0e 0f 0e 5c | 66 0e 0b 0e 5c 6e 23 88 |n......\|f...\n#.|
|000002a0| 2b c8 79 88 82 30 00 29 | 5c 6e 5c 66 5a 2c 87 22 |+.y..0.)|\n\fZ,."|
|000002b0| 20 5b 6e 69 6c 20 65 6e | 64 6c 69 6e 65 70 6f 73 | [nil en|dlinepos|
|000002c0| 20 65 6e 64 63 6f 6c 20 | 73 74 61 72 74 6c 69 6e | endcol |startlin|
|000002d0| 65 70 6f 73 20 73 74 61 | 72 74 63 6f 6c 20 73 74 |epos sta|rtcol st|
|000002e0| 61 72 74 20 30 20 65 6e | 64 20 31 20 70 6f 69 6e |art 0 en|d 1 poin|
|000002f0| 74 2d 6d 61 72 6b 65 72 | 20 65 6e 64 65 78 74 72 |t-marker| endextr|
|00000300| 61 20 62 65 67 65 78 74 | 72 61 20 73 74 61 72 74 |a begext|ra start|
|00000310| 70 6f 73 20 6d 6f 76 65 | 2d 74 6f 2d 63 6f 6c 75 |pos move|-to-colu|
|00000320| 6d 6e 20 63 6f 65 72 63 | 65 2d 74 61 62 73 20 66 |mn coerc|e-tabs f|
|00000330| 75 6e 63 74 69 6f 6e 5d | 20 34 20 22 5c 0a 43 61 |unction]| 4 "\.Ca|
|00000340| 6c 6c 20 46 55 4e 43 54 | 49 4f 4e 20 66 6f 72 20 |ll FUNCT|ION for |
|00000350| 65 61 63 68 20 6c 69 6e | 65 20 6f 66 20 72 65 63 |each lin|e of rec|
|00000360| 74 61 6e 67 6c 65 20 77 | 69 74 68 20 63 6f 72 6e |tangle w|ith corn|
|00000370| 65 72 73 20 61 74 20 53 | 54 41 52 54 2c 20 45 4e |ers at S|TART, EN|
|00000380| 44 2e 0a 49 66 20 43 4f | 45 52 43 45 2d 54 41 42 |D..If CO|ERCE-TAB|
|00000390| 53 20 69 73 20 6e 6f 6e | 2d 6e 69 6c 2c 20 63 6f |S is non|-nil, co|
|000003a0| 6e 76 65 72 74 20 6d 75 | 6c 74 69 2d 63 6f 6c 75 |nvert mu|lti-colu|
|000003b0| 6d 6e 20 63 68 61 72 61 | 63 74 65 72 73 0a 74 68 |mn chara|cters.th|
|000003c0| 61 74 20 73 70 61 6e 20 | 74 68 65 20 73 74 61 72 |at span |the star|
|000003d0| 74 69 6e 67 20 6f 72 20 | 65 6e 64 69 6e 67 20 63 |ting or |ending c|
|000003e0| 6f 6c 75 6d 6e 73 20 6f | 6e 20 61 6e 79 20 6c 69 |olumns o|n any li|
|000003f0| 6e 65 0a 74 6f 20 6d 75 | 6c 74 69 70 6c 65 20 73 |ne.to mu|ltiple s|
|00000400| 70 61 63 65 73 20 62 65 | 66 6f 72 65 20 63 61 6c |paces be|fore cal|
|00000410| 6c 69 6e 67 20 46 55 4e | 43 54 49 4f 4e 2e 0a 46 |ling FUN|CTION..F|
|00000420| 55 4e 43 54 49 4f 4e 20 | 69 73 20 63 61 6c 6c 65 |UNCTION |is calle|
|00000430| 64 20 77 69 74 68 20 74 | 68 72 65 65 20 61 72 67 |d with t|hree arg|
|00000440| 75 6d 65 6e 74 73 3a 0a | 20 70 6f 73 69 74 69 6f |uments:.| positio|
|00000450| 6e 20 6f 66 20 73 74 61 | 72 74 20 6f 66 20 73 65 |n of sta|rt of se|
|00000460| 67 6d 65 6e 74 20 6f 66 | 20 74 68 69 73 20 6c 69 |gment of| this li|
|00000470| 6e 65 20 77 69 74 68 69 | 6e 20 74 68 65 20 72 65 |ne withi|n the re|
|00000480| 63 74 61 6e 67 6c 65 2c | 0a 20 6e 75 6d 62 65 72 |ctangle,|. number|
|00000490| 20 6f 66 20 63 6f 6c 75 | 6d 6e 73 20 74 68 61 74 | of colu|mns that|
|000004a0| 20 62 65 6c 6f 6e 67 20 | 74 6f 20 72 65 63 74 61 | belong |to recta|
|000004b0| 6e 67 6c 65 20 62 75 74 | 20 61 72 65 20 62 65 66 |ngle but| are bef|
|000004c0| 6f 72 65 20 74 68 61 74 | 20 70 6f 73 69 74 69 6f |ore that| positio|
|000004d0| 6e 2c 0a 20 6e 75 6d 62 | 65 72 20 6f 66 20 63 6f |n,. numb|er of co|
|000004e0| 6c 75 6d 6e 73 20 74 68 | 61 74 20 62 65 6c 6f 6e |lumns th|at belon|
|000004f0| 67 20 74 6f 20 72 65 63 | 74 61 6e 67 6c 65 20 62 |g to rec|tangle b|
|00000500| 75 74 20 61 72 65 20 61 | 66 74 65 72 20 70 6f 69 |ut are a|fter poi|
|00000510| 6e 74 2e 0a 50 6f 69 6e | 74 20 69 73 20 61 74 20 |nt..Poin|t is at |
|00000520| 74 68 65 20 65 6e 64 20 | 6f 66 20 74 68 65 20 73 |the end |of the s|
|00000530| 65 67 6d 65 6e 74 20 6f | 66 20 74 68 69 73 20 6c |egment o|f this l|
|00000540| 69 6e 65 20 77 69 74 68 | 69 6e 20 74 68 65 20 72 |ine with|in the r|
|00000550| 65 63 74 61 6e 67 6c 65 | 2e 22 5d 29 0a 28 62 79 |ectangle|."]).(by|
|00000560| 74 65 2d 63 6f 64 65 20 | 22 c0 c1 c2 5c 22 88 c0 |te-code |"...\"..|
|00000570| c3 c4 5c 22 88 c0 c5 c6 | 5c 22 88 c7 16 08 c0 c9 |..\"....|\"......|
|00000580| ca 5c 22 87 22 20 5b 64 | 65 66 61 6c 69 61 73 20 |.\"." [d|efalias |
|00000590| 64 65 6c 65 74 65 2d 72 | 65 63 74 61 6e 67 6c 65 |delete-r|ectangle|
|000005a0| 2d 6c 69 6e 65 20 23 5b | 28 73 74 61 72 74 64 65 |-line #[|(startde|
|000005b0| 6c 70 6f 73 20 69 67 6e | 6f 72 65 20 69 67 6e 6f |lpos ign|ore igno|
|000005c0| 72 65 29 20 22 08 60 7c | 87 22 20 5b 73 74 61 72 |re) ".`||." [star|
|000005d0| 74 64 65 6c 70 6f 73 5d | 20 32 5d 20 64 65 6c 65 |tdelpos]| 2] dele|
|000005e0| 74 65 2d 65 78 74 72 61 | 63 74 2d 72 65 63 74 61 |te-extra|ct-recta|
|000005f0| 6e 67 6c 65 2d 6c 69 6e | 65 20 23 5b 28 73 74 61 |ngle-lin|e #[(sta|
|00000600| 72 74 64 65 6c 70 6f 73 | 20 62 65 67 65 78 74 72 |rtdelpos| begextr|
|00000610| 61 20 65 6e 64 65 78 74 | 72 61 29 20 22 8a c0 09 |a endext|ra) "...|
|00000620| 5c 6e 0b 23 88 29 09 60 | 7c 87 22 20 5b 65 78 74 |\n.#.).`||." [ext|
|00000630| 72 61 63 74 2d 72 65 63 | 74 61 6e 67 6c 65 2d 6c |ract-rec|tangle-l|
|00000640| 69 6e 65 20 73 74 61 72 | 74 64 65 6c 70 6f 73 20 |ine star|tdelpos |
|00000650| 62 65 67 65 78 74 72 61 | 20 65 6e 64 65 78 74 72 |begextra| endextr|
|00000660| 61 5d 20 34 5d 20 65 78 | 74 72 61 63 74 2d 72 65 |a] 4] ex|tract-re|
|00000670| 63 74 61 6e 67 6c 65 2d | 6c 69 6e 65 20 23 5b 28 |ctangle-|line #[(|
|00000680| 73 74 61 72 74 64 65 6c | 70 6f 73 20 62 65 67 65 |startdel|pos bege|
|00000690| 78 74 72 61 20 65 6e 64 | 65 78 74 72 61 29 20 22 |xtra end|extra) "|
|000006a0| 08 60 7b 60 19 1a 08 62 | 88 c3 c4 09 c5 23 83 36 |.`{`...b|.....#.6|
|000006b0| 00 69 8a c6 75 88 69 29 | 5a 1e 07 5c 6e c8 60 09 |.i..u.i)|Z..\n.`.|
|000006c0| 5a c9 5a 4f ca 0e 07 21 | 5c 6e 89 47 60 09 5a 5c |Z.ZO...!|\n.G`.Z\|
|000006d0| 5c cb 4f 51 12 29 82 09 | 00 0e 5c 66 c8 56 84 44 |\.OQ.)..|..\f.V.D|
|000006e0| 00 0e 0d c8 56 83 4f 00 | ca 0e 5c 66 21 5c 6e ca |....V.O.|..\f!\n.|
|000006f0| 0e 0d 21 51 12 5c 6e 0e | 0e 42 89 16 0e 2a 87 22 |..!Q.\n.|.B...*."|
|00000700| 20 5b 73 74 61 72 74 64 | 65 6c 70 6f 73 20 65 6e | [startd|elpos en|
|00000710| 64 20 6c 69 6e 65 20 73 | 65 61 72 63 68 2d 66 6f |d line s|earch-fo|
|00000720| 72 77 61 72 64 20 22 09 | 22 20 74 20 2d 31 20 77 |rward ".|" t -1 w|
|00000730| 69 64 74 68 20 30 20 31 | 20 73 70 61 63 65 73 2d |idth 0 1| spaces-|
|00000740| 73 74 72 69 6e 67 20 6e | 69 6c 20 62 65 67 65 78 |string n|il begex|
|00000750| 74 72 61 20 65 6e 64 65 | 78 74 72 61 20 6c 69 6e |tra ende|xtra lin|
|00000760| 65 73 5d 20 36 5d 20 5b | 22 22 20 22 20 22 20 22 |es] 6] [|"" " " "|
|00000770| 20 20 22 20 22 20 20 20 | 22 20 22 20 20 20 20 22 | " " |" " "|
|00000780| 20 22 20 20 20 20 20 22 | 20 22 20 20 20 20 20 20 | " "| " |
|00000790| 22 20 22 20 20 20 20 20 | 20 20 22 20 22 20 20 20 |" " | " " |
|000007a0| 20 20 20 20 20 22 5d 20 | 73 70 61 63 65 73 2d 73 | "] |spaces-s|
|000007b0| 74 72 69 6e 67 73 20 73 | 70 61 63 65 73 2d 73 74 |trings s|paces-st|
|000007c0| 72 69 6e 67 20 23 5b 28 | 6e 29 20 22 08 c1 58 83 |ring #[(|n) "..X.|
|000007d0| 5c 6e 00 5c 6e 08 48 87 | c3 1c 08 c1 56 83 1e 00 |\n.\n.H.|....V...|
|000007e0| c5 5c 66 50 14 08 c1 5a | 89 10 82 0d 00 5c 66 5c |.\fP...Z|.....\f\|
|000007f0| 6e 08 48 50 29 87 22 20 | 5b 6e 20 38 20 73 70 61 |n.HP)." |[n 8 spa|
|00000800| 63 65 73 2d 73 74 72 69 | 6e 67 73 20 22 22 20 76 |ces-stri|ngs "" v|
|00000810| 61 6c 20 22 20 20 20 20 | 20 20 20 20 22 5d 20 34 |al " | "] 4|
|00000820| 5d 5d 20 33 29 0a 28 64 | 65 66 61 6c 69 61 73 20 |]] 3).(d|efalias |
|00000830| 27 64 65 6c 65 74 65 2d | 72 65 63 74 61 6e 67 6c |'delete-|rectangl|
|00000840| 65 20 23 5b 28 73 74 61 | 72 74 20 65 6e 64 29 20 |e #[(sta|rt end) |
|00000850| 22 c0 c1 5c 6e 0b c4 24 | 87 22 20 5b 6f 70 65 72 |"..\n..$|." [oper|
|00000860| 61 74 65 2d 6f 6e 2d 72 | 65 63 74 61 6e 67 6c 65 |ate-on-r|ectangle|
|00000870| 20 64 65 6c 65 74 65 2d | 72 65 63 74 61 6e 67 6c | delete-|rectangl|
|00000880| 65 2d 6c 69 6e 65 20 73 | 74 61 72 74 20 65 6e 64 |e-line s|tart end|
|00000890| 20 74 5d 20 35 20 22 5c | 0a 44 65 6c 65 74 65 20 | t] 5 "\|.Delete |
|000008a0| 28 64 6f 6e 27 74 20 73 | 61 76 65 29 20 74 65 78 |(don't s|ave) tex|
|000008b0| 74 20 69 6e 20 72 65 63 | 74 61 6e 67 6c 65 20 77 |t in rec|tangle w|
|000008c0| 69 74 68 20 70 6f 69 6e | 74 20 61 6e 64 20 6d 61 |ith poin|t and ma|
|000008d0| 72 6b 20 61 73 20 63 6f | 72 6e 65 72 73 2e 0a 54 |rk as co|rners..T|
|000008e0| 68 65 20 73 61 6d 65 20 | 72 61 6e 67 65 20 6f 66 |he same |range of|
|000008f0| 20 63 6f 6c 75 6d 6e 73 | 20 69 73 20 64 65 6c 65 | columns| is dele|
|00000900| 74 65 64 20 69 6e 20 65 | 61 63 68 20 6c 69 6e 65 |ted in e|ach line|
|00000910| 20 73 74 61 72 74 69 6e | 67 20 77 69 74 68 20 74 | startin|g with t|
|00000920| 68 65 20 6c 69 6e 65 0a | 77 68 65 72 65 20 74 68 |he line.|where th|
|00000930| 65 20 72 65 67 69 6f 6e | 20 62 65 67 69 6e 73 20 |e region| begins |
|00000940| 61 6e 64 20 65 6e 64 69 | 6e 67 20 77 69 74 68 20 |and endi|ng with |
|00000950| 74 68 65 20 6c 69 6e 65 | 20 77 68 65 72 65 20 74 |the line| where t|
|00000960| 68 65 20 72 65 67 69 6f | 6e 20 65 6e 64 73 2e 22 |he regio|n ends."|
|00000970| 20 22 72 22 5d 29 0a 28 | 64 65 66 61 6c 69 61 73 | "r"]).(|defalias|
|00000980| 20 27 64 65 6c 65 74 65 | 2d 65 78 74 72 61 63 74 | 'delete|-extract|
|00000990| 2d 72 65 63 74 61 6e 67 | 6c 65 20 23 5b 28 73 74 |-rectang|le #[(st|
|000009a0| 61 72 74 20 65 6e 64 29 | 20 22 c0 19 c2 c3 5c 66 |art end)| "....\f|
|000009b0| 0d c6 24 88 09 9f 29 87 | 22 20 5b 6e 69 6c 20 6c |..$...).|" [nil l|
|000009c0| 69 6e 65 73 20 6f 70 65 | 72 61 74 65 2d 6f 6e 2d |ines ope|rate-on-|
|000009d0| 72 65 63 74 61 6e 67 6c | 65 20 64 65 6c 65 74 65 |rectangl|e delete|
|000009e0| 2d 65 78 74 72 61 63 74 | 2d 72 65 63 74 61 6e 67 |-extract|-rectang|
|000009f0| 6c 65 2d 6c 69 6e 65 20 | 73 74 61 72 74 20 65 6e |le-line |start en|
|00000a00| 64 20 74 5d 20 35 20 22 | 5c 0a 44 65 6c 65 74 65 |d t] 5 "|\.Delete|
|00000a10| 20 63 6f 6e 74 65 6e 74 | 73 20 6f 66 20 72 65 63 | content|s of rec|
|00000a20| 74 61 6e 67 6c 65 20 61 | 6e 64 20 72 65 74 75 72 |tangle a|nd retur|
|00000a30| 6e 20 69 74 20 61 73 20 | 61 20 6c 69 73 74 20 6f |n it as |a list o|
|00000a40| 66 20 73 74 72 69 6e 67 | 73 2e 0a 41 72 67 75 6d |f string|s..Argum|
|00000a50| 65 6e 74 73 20 53 54 41 | 52 54 20 61 6e 64 20 45 |ents STA|RT and E|
|00000a60| 4e 44 20 61 72 65 20 74 | 68 65 20 63 6f 72 6e 65 |ND are t|he corne|
|00000a70| 72 73 20 6f 66 20 74 68 | 65 20 72 65 63 74 61 6e |rs of th|e rectan|
|00000a80| 67 6c 65 2e 0a 54 68 65 | 20 76 61 6c 75 65 20 69 |gle..The| value i|
|00000a90| 73 20 6c 69 73 74 20 6f | 66 20 73 74 72 69 6e 67 |s list o|f string|
|00000aa0| 73 2c 20 6f 6e 65 20 66 | 6f 72 20 65 61 63 68 20 |s, one f|or each |
|00000ab0| 6c 69 6e 65 20 6f 66 20 | 74 68 65 20 72 65 63 74 |line of |the rect|
|00000ac0| 61 6e 67 6c 65 2e 22 5d | 29 0a 28 64 65 66 61 6c |angle."]|).(defal|
|00000ad0| 69 61 73 20 27 65 78 74 | 72 61 63 74 2d 72 65 63 |ias 'ext|ract-rec|
|00000ae0| 74 61 6e 67 6c 65 20 23 | 5b 28 73 74 61 72 74 20 |tangle #|[(start |
|00000af0| 65 6e 64 29 20 22 c0 19 | c2 c3 5c 66 0d c0 24 88 |end) "..|..\f..$.|
|00000b00| 09 9f 29 87 22 20 5b 6e | 69 6c 20 6c 69 6e 65 73 |..)." [n|il lines|
|00000b10| 20 6f 70 65 72 61 74 65 | 2d 6f 6e 2d 72 65 63 74 | operate|-on-rect|
|00000b20| 61 6e 67 6c 65 20 65 78 | 74 72 61 63 74 2d 72 65 |angle ex|tract-re|
|00000b30| 63 74 61 6e 67 6c 65 2d | 6c 69 6e 65 20 73 74 61 |ctangle-|line sta|
|00000b40| 72 74 20 65 6e 64 5d 20 | 35 20 22 5c 0a 52 65 74 |rt end] |5 "\.Ret|
|00000b50| 75 72 6e 20 63 6f 6e 74 | 65 6e 74 73 20 6f 66 20 |urn cont|ents of |
|00000b60| 72 65 63 74 61 6e 67 6c | 65 20 77 69 74 68 20 63 |rectangl|e with c|
|00000b70| 6f 72 6e 65 72 73 20 61 | 74 20 53 54 41 52 54 20 |orners a|t START |
|00000b80| 61 6e 64 20 45 4e 44 2e | 0a 56 61 6c 75 65 20 69 |and END.|.Value i|
|00000b90| 73 20 6c 69 73 74 20 6f | 66 20 73 74 72 69 6e 67 |s list o|f string|
|00000ba0| 73 2c 20 6f 6e 65 20 66 | 6f 72 20 65 61 63 68 20 |s, one f|or each |
|00000bb0| 6c 69 6e 65 20 6f 66 20 | 74 68 65 20 72 65 63 74 |line of |the rect|
|00000bc0| 61 6e 67 6c 65 2e 22 5d | 29 0a 28 64 65 66 76 61 |angle."]|).(defva|
|00000bd0| 72 20 6b 69 6c 6c 65 64 | 2d 72 65 63 74 61 6e 67 |r killed|-rectang|
|00000be0| 6c 65 20 6e 69 6c 20 22 | 5c 0a 52 65 63 74 61 6e |le nil "|\.Rectan|
|00000bf0| 67 6c 65 20 66 6f 72 20 | 79 61 6e 6b 2d 72 65 63 |gle for |yank-rec|
|00000c00| 74 61 6e 67 6c 65 20 74 | 6f 20 69 6e 73 65 72 74 |tangle t|o insert|
|00000c10| 2e 22 29 0a 28 64 65 66 | 61 6c 69 61 73 20 27 6b |.").(def|alias 'k|
|00000c20| 69 6c 6c 2d 72 65 63 74 | 61 6e 67 6c 65 20 23 5b |ill-rect|angle #[|
|00000c30| 28 73 74 61 72 74 20 65 | 6e 64 29 20 22 c0 09 5c |(start e|nd) "..\|
|00000c40| 6e 5c 22 89 13 87 22 20 | 5b 64 65 6c 65 74 65 2d |n\"..." |[delete-|
|00000c50| 65 78 74 72 61 63 74 2d | 72 65 63 74 61 6e 67 6c |extract-|rectangl|
|00000c60| 65 20 73 74 61 72 74 20 | 65 6e 64 20 6b 69 6c 6c |e start |end kill|
|00000c70| 65 64 2d 72 65 63 74 61 | 6e 67 6c 65 5d 20 33 20 |ed-recta|ngle] 3 |
|00000c80| 22 5c 0a 44 65 6c 65 74 | 65 20 72 65 63 74 61 6e |"\.Delet|e rectan|
|00000c90| 67 6c 65 20 77 69 74 68 | 20 63 6f 72 6e 65 72 73 |gle with| corners|
|00000ca0| 20 61 74 20 70 6f 69 6e | 74 20 61 6e 64 20 6d 61 | at poin|t and ma|
|00000cb0| 72 6b 3b 20 73 61 76 65 | 20 61 73 20 6c 61 73 74 |rk; save| as last|
|00000cc0| 20 6b 69 6c 6c 65 64 20 | 6f 6e 65 2e 0a 43 61 6c | killed |one..Cal|
|00000cd0| 6c 69 6e 67 20 66 72 6f | 6d 20 70 72 6f 67 72 61 |ling fro|m progra|
|00000ce0| 6d 2c 20 73 75 70 70 6c | 79 20 74 77 6f 20 61 72 |m, suppl|y two ar|
|00000cf0| 67 73 20 53 54 41 52 54 | 20 61 6e 64 20 45 4e 44 |gs START| and END|
|00000d00| 2c 20 62 75 66 66 65 72 | 20 70 6f 73 69 74 69 6f |, buffer| positio|
|00000d10| 6e 73 2e 0a 42 75 74 20 | 69 6e 20 70 72 6f 67 72 |ns..But |in progr|
|00000d20| 61 6d 73 20 79 6f 75 20 | 6d 69 67 68 74 20 70 72 |ams you |might pr|
|00000d30| 65 66 65 72 20 74 6f 20 | 75 73 65 20 60 64 65 6c |efer to |use `del|
|00000d40| 65 74 65 2d 65 78 74 72 | 61 63 74 2d 72 65 63 74 |ete-extr|act-rect|
|00000d50| 61 6e 67 6c 65 27 2e 22 | 20 22 72 22 5d 29 0a 28 |angle'."| "r"]).(|
|00000d60| 64 65 66 61 6c 69 61 73 | 20 27 79 61 6e 6b 2d 72 |defalias| 'yank-r|
|00000d70| 65 63 74 61 6e 67 6c 65 | 20 23 5b 6e 69 6c 20 22 |ectangle| #[nil "|
|00000d80| c0 09 21 87 22 20 5b 69 | 6e 73 65 72 74 2d 72 65 |..!." [i|nsert-re|
|00000d90| 63 74 61 6e 67 6c 65 20 | 6b 69 6c 6c 65 64 2d 72 |ctangle |killed-r|
|00000da0| 65 63 74 61 6e 67 6c 65 | 5d 20 32 20 22 5c 0a 59 |ectangle|] 2 "\.Y|
|00000db0| 61 6e 6b 20 74 68 65 20 | 6c 61 73 74 20 6b 69 6c |ank the |last kil|
|00000dc0| 6c 65 64 20 72 65 63 74 | 61 6e 67 6c 65 20 77 69 |led rect|angle wi|
|00000dd0| 74 68 20 75 70 70 65 72 | 20 6c 65 66 74 20 63 6f |th upper| left co|
|00000de0| 72 6e 65 72 20 61 74 20 | 70 6f 69 6e 74 2e 22 20 |rner at |point." |
|00000df0| 6e 69 6c 5d 29 0a 28 64 | 65 66 61 6c 69 61 73 20 |nil]).(d|efalias |
|00000e00| 27 69 6e 73 65 72 74 2d | 72 65 63 74 61 6e 67 6c |'insert-|rectangl|
|00000e10| 65 20 23 5b 28 72 65 63 | 74 61 6e 67 6c 65 29 20 |e #[(rec|tangle) |
|00000e20| 22 08 69 c1 1a 1b 1c c5 | 20 88 5c 66 85 2e 00 5c |".i.....| .\f...\|
|00000e30| 6e 84 20 00 c6 79 88 6e | 84 1b 00 c7 63 88 c8 0b |n. ..y.n|....c...|
|00000e40| c1 5c 22 88 c9 12 5c 66 | 40 63 88 5c 66 41 89 14 |.\"...\f|@c.\fA..|
|00000e50| 84 0d 00 c9 2b 87 22 20 | 5b 72 65 63 74 61 6e 67 |....+." |[rectang|
|00000e60| 6c 65 20 74 20 66 69 72 | 73 74 20 69 6e 73 65 72 |le t fir|st inser|
|00000e70| 74 63 6f 6c 75 6d 6e 20 | 6c 69 6e 65 73 20 70 75 |tcolumn |lines pu|
|00000e80| 73 68 2d 6d 61 72 6b 20 | 31 20 31 30 20 6d 6f 76 |sh-mark |1 10 mov|
|00000e90| 65 2d 74 6f 2d 63 6f 6c | 75 6d 6e 20 6e 69 6c 5d |e-to-col|umn nil]|
|00000ea0| 20 34 20 22 5c 0a 49 6e | 73 65 72 74 20 74 65 78 | 4 "\.In|sert tex|
|00000eb0| 74 20 6f 66 20 52 45 43 | 54 41 4e 47 4c 45 20 77 |t of REC|TANGLE w|
|00000ec0| 69 74 68 20 75 70 70 65 | 72 20 6c 65 66 74 20 63 |ith uppe|r left c|
|00000ed0| 6f 72 6e 65 72 20 61 74 | 20 70 6f 69 6e 74 2e 0a |orner at| point..|
|00000ee0| 52 45 43 54 41 4e 47 4c | 45 27 73 20 66 69 72 73 |RECTANGL|E's firs|
|00000ef0| 74 20 6c 69 6e 65 20 69 | 73 20 69 6e 73 65 72 74 |t line i|s insert|
|00000f00| 65 64 20 61 74 20 70 6f | 69 6e 74 2c 20 69 74 73 |ed at po|int, its|
|00000f10| 20 73 65 63 6f 6e 64 0a | 6c 69 6e 65 20 69 73 20 | second.|line is |
|00000f20| 69 6e 73 65 72 74 65 64 | 20 61 74 20 61 20 70 6f |inserted| at a po|
|00000f30| 69 6e 74 20 76 65 72 74 | 69 63 61 6c 6c 79 20 75 |int vert|ically u|
|00000f40| 6e 64 65 72 20 70 6f 69 | 6e 74 2c 20 65 74 63 2e |nder poi|nt, etc.|
|00000f50| 0a 52 45 43 54 41 4e 47 | 4c 45 20 73 68 6f 75 6c |.RECTANG|LE shoul|
|00000f60| 64 20 62 65 20 61 20 6c | 69 73 74 20 6f 66 20 73 |d be a l|ist of s|
|00000f70| 74 72 69 6e 67 73 2e 0a | 41 66 74 65 72 20 74 68 |trings..|After th|
|00000f80| 69 73 20 63 6f 6d 6d 61 | 6e 64 2c 20 74 68 65 20 |is comma|nd, the |
|00000f90| 6d 61 72 6b 20 69 73 20 | 61 74 20 74 68 65 20 75 |mark is |at the u|
|00000fa0| 70 70 65 72 20 6c 65 66 | 74 20 63 6f 72 6e 65 72 |pper lef|t corner|
|00000fb0| 0a 61 6e 64 20 70 6f 69 | 6e 74 20 69 73 20 61 74 |.and poi|nt is at|
|00000fc0| 20 74 68 65 20 6c 6f 77 | 65 72 20 72 69 67 68 74 | the low|er right|
|00000fd0| 20 63 6f 72 6e 65 72 2e | 22 5d 29 0a 28 64 65 66 | corner.|"]).(def|
|00000fe0| 61 6c 69 61 73 20 27 6f | 70 65 6e 2d 72 65 63 74 |alias 'o|pen-rect|
|00000ff0| 61 6e 67 6c 65 20 23 5b | 28 73 74 61 72 74 20 65 |angle #[|(start e|
|00001000| 6e 64 29 20 22 c0 c1 5c | 6e 0b c4 24 88 5c 6e 62 |nd) "..\|n..$.\nb|
|00001010| 87 22 20 5b 6f 70 65 72 | 61 74 65 2d 6f 6e 2d 72 |." [oper|ate-on-r|
|00001020| 65 63 74 61 6e 67 6c 65 | 20 6f 70 65 6e 2d 72 65 |ectangle| open-re|
|00001030| 63 74 61 6e 67 6c 65 2d | 6c 69 6e 65 20 73 74 61 |ctangle-|line sta|
|00001040| 72 74 20 65 6e 64 20 6e | 69 6c 5d 20 35 20 22 5c |rt end n|il] 5 "\|
|00001050| 0a 42 6c 61 6e 6b 20 6f | 75 74 20 72 65 63 74 61 |.Blank o|ut recta|
|00001060| 6e 67 6c 65 20 77 69 74 | 68 20 63 6f 72 6e 65 72 |ngle wit|h corner|
|00001070| 73 20 61 74 20 70 6f 69 | 6e 74 20 61 6e 64 20 6d |s at poi|nt and m|
|00001080| 61 72 6b 2c 20 73 68 69 | 66 74 69 6e 67 20 74 65 |ark, shi|fting te|
|00001090| 78 74 20 72 69 67 68 74 | 2e 0a 54 68 65 20 74 65 |xt right|..The te|
|000010a0| 78 74 20 70 72 65 76 69 | 6f 75 73 6c 79 20 69 6e |xt previ|ously in|
|000010b0| 20 74 68 65 20 72 65 67 | 69 6f 6e 20 69 73 20 6e | the reg|ion is n|
|000010c0| 6f 74 20 6f 76 65 72 77 | 72 69 74 74 65 6e 20 62 |ot overw|ritten b|
|000010d0| 79 20 74 68 65 20 62 6c | 61 6e 6b 73 2c 0a 62 75 |y the bl|anks,.bu|
|000010e0| 74 20 69 6e 73 74 65 61 | 64 20 77 69 6e 64 73 20 |t instea|d winds |
|000010f0| 75 70 20 74 6f 20 74 68 | 65 20 72 69 67 68 74 20 |up to th|e right |
|00001100| 6f 66 20 74 68 65 20 72 | 65 63 74 61 6e 67 6c 65 |of the r|ectangle|
|00001110| 2e 22 20 22 72 22 5d 29 | 0a 28 64 65 66 61 6c 69 |." "r"])|.(defali|
|00001120| 61 73 20 28 71 75 6f 74 | 65 20 6f 70 65 6e 2d 72 |as (quot|e open-r|
|00001130| 65 63 74 61 6e 67 6c 65 | 2d 6c 69 6e 65 29 20 23 |ectangle|-line) #|
|00001140| 5b 28 73 74 61 72 74 70 | 6f 73 20 62 65 67 65 78 |[(startp|os begex|
|00001150| 74 72 61 20 65 6e 64 65 | 78 74 72 61 29 20 22 69 |tra ende|xtra) "i|
|00001160| 08 5c 5c c1 1a 1b 5c 66 | 62 88 69 0d 5a 1e 06 c7 |.\\...\f|b.i.Z...|
|00001170| c1 77 88 69 0e 06 5a 12 | 29 5c 66 60 7c 88 0b 5c |.w.i..Z.|)\f`|..\|
|00001180| 6e 5c 5c 6a 2a 87 22 20 | 5b 65 6e 64 65 78 74 72 |n\\j*." |[endextr|
|00001190| 61 20 6e 69 6c 20 77 68 | 69 74 65 77 69 64 74 68 |a nil wh|itewidth|
|000011a0| 20 65 6e 64 63 6f 6c 20 | 73 74 61 72 74 70 6f 73 | endcol |startpos|
|000011b0| 20 62 65 67 65 78 74 72 | 61 20 62 65 67 63 6f 6c | begextr|a begcol|
|000011c0| 20 22 20 09 22 5d 20 32 | 5d 29 0a 28 64 65 66 61 | " ."] 2|]).(defa|
|000011d0| 6c 69 61 73 20 27 73 74 | 72 69 6e 67 2d 72 65 63 |lias 'st|ring-rec|
|000011e0| 74 61 6e 67 6c 65 20 23 | 5b 28 73 74 61 72 74 20 |tangle #|[(start |
|000011f0| 65 6e 64 20 73 74 72 69 | 6e 67 29 20 22 c0 c1 5c |end stri|ng) "..\|
|00001200| 6e 0b c4 24 88 5c 6e 62 | 87 22 20 5b 6f 70 65 72 |n..$.\nb|." [oper|
|00001210| 61 74 65 2d 6f 6e 2d 72 | 65 63 74 61 6e 67 6c 65 |ate-on-r|ectangle|
|00001220| 20 73 74 72 69 6e 67 2d | 72 65 63 74 61 6e 67 6c | string-|rectangl|
|00001230| 65 2d 6c 69 6e 65 20 73 | 74 61 72 74 20 65 6e 64 |e-line s|tart end|
|00001240| 20 74 5d 20 35 20 22 5c | 0a 49 6e 73 65 72 74 20 | t] 5 "\|.Insert |
|00001250| 53 54 52 49 4e 47 20 6f | 6e 20 65 61 63 68 20 6c |STRING o|n each l|
|00001260| 69 6e 65 20 6f 66 20 74 | 68 65 20 72 65 67 69 6f |ine of t|he regio|
|00001270| 6e 2d 72 65 63 74 61 6e | 67 6c 65 2c 20 73 68 69 |n-rectan|gle, shi|
|00001280| 66 74 69 6e 67 20 74 65 | 78 74 20 72 69 67 68 74 |fting te|xt right|
|00001290| 2e 0a 54 68 65 20 6c 65 | 66 74 20 65 64 67 65 20 |..The le|ft edge |
|000012a0| 6f 66 20 74 68 65 20 72 | 65 63 74 61 6e 67 6c 65 |of the r|ectangle|
|000012b0| 20 73 70 65 63 69 66 69 | 65 73 20 74 68 65 20 63 | specifi|es the c|
|000012c0| 6f 6c 75 6d 6e 20 66 6f | 72 20 69 6e 73 65 72 74 |olumn fo|r insert|
|000012d0| 69 6f 6e 2e 0a 54 68 69 | 73 20 63 6f 6d 6d 61 6e |ion..Thi|s comman|
|000012e0| 64 20 64 6f 65 73 20 6e | 6f 74 20 64 65 6c 65 74 |d does n|ot delet|
|000012f0| 65 20 6f 72 20 6f 76 65 | 72 77 72 69 74 65 20 61 |e or ove|rwrite a|
|00001300| 6e 79 20 65 78 69 73 74 | 69 6e 67 20 74 65 78 74 |ny exist|ing text|
|00001310| 2e 0a 0a 43 61 6c 6c 65 | 64 20 66 72 6f 6d 20 61 |...Calle|d from a|
|00001320| 20 70 72 6f 67 72 61 6d | 2c 20 74 61 6b 65 73 20 | program|, takes |
|00001330| 74 68 72 65 65 20 61 72 | 67 73 3b 20 53 54 41 52 |three ar|gs; STAR|
|00001340| 54 2c 20 45 4e 44 20 61 | 6e 64 20 53 54 52 49 4e |T, END a|nd STRIN|
|00001350| 47 2e 22 20 22 72 5c 6e | 73 53 74 72 69 6e 67 20 |G." "r\n|sString |
|00001360| 72 65 63 74 61 6e 67 6c | 65 3a 20 22 5d 29 0a 28 |rectangl|e: "]).(|
|00001370| 64 65 66 61 6c 69 61 73 | 20 28 71 75 6f 74 65 20 |defalias| (quote |
|00001380| 73 74 72 69 6e 67 2d 72 | 65 63 74 61 6e 67 6c 65 |string-r|ectangle|
|00001390| 2d 6c 69 6e 65 29 20 23 | 5b 28 73 74 61 72 74 70 |-line) #|[(startp|
|000013a0| 6f 73 20 62 65 67 65 78 | 74 72 61 20 65 6e 64 65 |os begex|tra ende|
|000013b0| 78 74 72 61 29 20 22 c0 | 19 5c 6e 62 88 69 1b c4 |xtra) ".|.\nb.i..|
|000013c0| c0 77 88 69 0b 5a 11 29 | 5c 6e 60 7c 88 0d 63 88 |.w.i.Z.)|\n`|..c.|
|000013d0| 69 09 5c 5c 6a 29 87 22 | 20 5b 6e 69 6c 20 77 68 |i.\\j)."| [nil wh|
|000013e0| 69 74 65 73 70 61 63 65 | 20 73 74 61 72 74 70 6f |itespace| startpo|
|000013f0| 73 20 6f 63 6f 6c 20 22 | 20 09 22 20 73 74 72 69 |s ocol "| ." stri|
|00001400| 6e 67 5d 20 32 5d 29 0a | 28 64 65 66 61 6c 69 61 |ng] 2]).|(defalia|
|00001410| 73 20 27 63 6c 65 61 72 | 2d 72 65 63 74 61 6e 67 |s 'clear|-rectang|
|00001420| 6c 65 20 23 5b 28 73 74 | 61 72 74 20 65 6e 64 29 |le #[(st|art end)|
|00001430| 20 22 c0 c1 5c 6e 0b c4 | 24 87 22 20 5b 6f 70 65 | "..\n..|$." [ope|
|00001440| 72 61 74 65 2d 6f 6e 2d | 72 65 63 74 61 6e 67 6c |rate-on-|rectangl|
|00001450| 65 20 63 6c 65 61 72 2d | 72 65 63 74 61 6e 67 6c |e clear-|rectangl|
|00001460| 65 2d 6c 69 6e 65 20 73 | 74 61 72 74 20 65 6e 64 |e-line s|tart end|
|00001470| 20 74 5d 20 35 20 22 5c | 0a 42 6c 61 6e 6b 20 6f | t] 5 "\|.Blank o|
|00001480| 75 74 20 72 65 63 74 61 | 6e 67 6c 65 20 77 69 74 |ut recta|ngle wit|
|00001490| 68 20 63 6f 72 6e 65 72 | 73 20 61 74 20 70 6f 69 |h corner|s at poi|
|000014a0| 6e 74 20 61 6e 64 20 6d | 61 72 6b 2e 0a 54 68 65 |nt and m|ark..The|
|000014b0| 20 74 65 78 74 20 70 72 | 65 76 69 6f 75 73 6c 79 | text pr|eviously|
|000014c0| 20 69 6e 20 74 68 65 20 | 72 65 67 69 6f 6e 20 69 | in the |region i|
|000014d0| 73 20 6f 76 65 72 77 72 | 69 74 74 65 6e 20 62 79 |s overwr|itten by|
|000014e0| 20 74 68 65 20 62 6c 61 | 6e 6b 73 2e 0a 57 68 65 | the bla|nks..Whe|
|000014f0| 6e 20 63 61 6c 6c 65 64 | 20 66 72 6f 6d 20 61 20 |n called| from a |
|00001500| 70 72 6f 67 72 61 6d 2c | 20 72 65 71 75 69 72 65 |program,| require|
|00001510| 73 20 74 77 6f 20 61 72 | 67 73 20 77 68 69 63 68 |s two ar|gs which|
|00001520| 20 73 70 65 63 69 66 79 | 20 74 68 65 20 63 6f 72 | specify| the cor|
|00001530| 6e 65 72 73 2e 22 20 22 | 72 22 5d 29 0a 28 62 79 |ners." "|r"]).(by|
|00001540| 74 65 2d 63 6f 64 65 20 | 22 c0 c1 c2 5c 22 88 c3 |te-code |"...\"..|
|00001550| c4 21 87 22 20 5b 64 65 | 66 61 6c 69 61 73 20 63 |.!." [de|falias c|
|00001560| 6c 65 61 72 2d 72 65 63 | 74 61 6e 67 6c 65 2d 6c |lear-rec|tangle-l|
|00001570| 69 6e 65 20 23 5b 28 73 | 74 61 72 74 70 6f 73 20 |ine #[(s|tartpos |
|00001580| 62 65 67 65 78 74 72 61 | 20 65 6e 64 65 78 74 72 |begextra| endextr|
|00001590| 61 29 20 22 c0 c1 77 88 | 69 5c 6e 5c 5c 1b 60 5c |a) "..w.|i\n\\.`\|
|000015a0| 66 62 88 c0 c1 78 88 60 | 7c 88 0b 6a 29 87 22 20 |fb...x.`||..j)." |
|000015b0| 5b 22 20 09 22 20 6e 69 | 6c 20 65 6e 64 65 78 74 |[" ." ni|l endext|
|000015c0| 72 61 20 63 6f 6c 75 6d | 6e 20 73 74 61 72 74 70 |ra colum|n startp|
|000015d0| 6f 73 5d 20 33 5d 20 70 | 72 6f 76 69 64 65 20 72 |os] 3] p|rovide r|
|000015e0| 65 63 74 5d 20 33 29 0a | |ect] 3).| |
+--------+-------------------------+-------------------------+--------+--------+