home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / lisp / prim / replace.elc.z / replace.elc
Emacs Compiled Lisp  |  1998-05-21  |  18.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 v20 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 14 00 00 00 | 0a 3b 3b 3b 20 63 6f 6d |;ELC....|.;;; com|
|00000010| 70 69 6c 65 64 20 62 79 | 20 6a 75 73 74 69 6e 62 |piled by| justinb|
|00000020| 40 65 62 6f 6e 79 2e 63 | 72 61 79 2e 63 6f 6d 20 |@ebony.c|ray.com |
|00000030| 6f 6e 20 54 68 75 20 4a | 61 6e 20 32 32 20 31 34 |on Thu J|an 22 14|
|00000040| 3a 34 37 3a 30 38 20 31 | 39 39 38 0a 3b 3b 3b 20 |:47:08 1|998.;;; |
|00000050| 66 72 6f 6d 20 66 69 6c | 65 20 2f 68 6f 6d 65 2f |from fil|e /home/|
|00000060| 61 73 70 65 6e 30 37 2f | 6a 75 73 74 69 6e 62 2f |aspen07/|justinb/|
|00000070| 72 6f 6f 74 73 2f 66 72 | 65 65 77 61 72 65 2f 78 |roots/fr|eeware/x|
|00000080| 65 6d 61 63 73 2f 78 65 | 6d 61 63 73 2d 32 30 2e |emacs/xe|macs-20.|
|00000090| 33 2f 6c 69 73 70 2f 70 | 72 69 6d 2f 72 65 70 6c |3/lisp/p|rim/repl|
|000000a0| 61 63 65 2e 65 6c 0a 3b | 3b 3b 20 65 6d 61 63 73 |ace.el.;|;; emacs|
|000000b0| 20 76 65 72 73 69 6f 6e | 20 32 30 2e 33 20 22 56 | version| 20.3 "V|
|000000c0| 61 74 69 63 61 6e 20 43 | 69 74 79 22 20 58 45 6d |atican C|ity" XEm|
|000000d0| 61 63 73 20 20 4c 75 63 | 69 64 2e 0a 3b 3b 3b 20 |acs Luc|id..;;; |
|000000e0| 62 79 74 65 63 6f 6d 70 | 20 76 65 72 73 69 6f 6e |bytecomp| version|
|000000f0| 20 32 2e 32 35 20 58 45 | 6d 61 63 73 3b 20 32 32 | 2.25 XE|macs; 22|
|00000100| 2d 4d 61 72 2d 39 36 2e | 0a 3b 3b 3b 20 6f 70 74 |-Mar-96.|.;;; opt|
|00000110| 69 6d 69 7a 61 74 69 6f | 6e 20 69 73 20 6f 6e 2e |imizatio|n is on.|
|00000120| 0a 3b 3b 3b 20 74 68 69 | 73 20 66 69 6c 65 20 75 |.;;; thi|s file u|
|00000130| 73 65 73 20 6f 70 63 6f | 64 65 73 20 77 68 69 63 |ses opco|des whic|
|00000140| 68 20 64 6f 20 6e 6f 74 | 20 65 78 69 73 74 20 69 |h do not| exist i|
|00000150| 6e 20 45 6d 61 63 73 20 | 31 39 2e 0a 0a 28 69 66 |n Emacs |19...(if|
|00000160| 20 28 61 6e 64 20 28 62 | 6f 75 6e 64 70 20 27 65 | (and (b|oundp 'e|
|00000170| 6d 61 63 73 2d 76 65 72 | 73 69 6f 6e 29 0a 09 20 |macs-ver|sion).. |
|00000180| 28 6f 72 20 28 61 6e 64 | 20 28 62 6f 75 6e 64 70 |(or (and| (boundp|
|00000190| 20 27 65 70 6f 63 68 3a | 3a 76 65 72 73 69 6f 6e | 'epoch:|:version|
|000001a0| 29 20 65 70 6f 63 68 3a | 3a 76 65 72 73 69 6f 6e |) epoch:|:version|
|000001b0| 29 0a 09 20 20 20 20 20 | 28 73 74 72 69 6e 67 2d |).. |(string-|
|000001c0| 6c 65 73 73 70 20 65 6d | 61 63 73 2d 76 65 72 73 |lessp em|acs-vers|
|000001d0| 69 6f 6e 20 22 32 30 22 | 29 29 29 0a 20 20 20 20 |ion "20"|))). |
|000001e0| 28 65 72 72 6f 72 20 22 | 60 72 65 70 6c 61 63 65 |(error "|`replace|
|000001f0| 2e 65 6c 27 20 77 61 73 | 20 63 6f 6d 70 69 6c 65 |.el' was| compile|
|00000200| 64 20 66 6f 72 20 45 6d | 61 63 73 20 32 30 22 29 |d for Em|acs 20")|
|00000210| 29 0a 0a 28 6f 72 20 28 | 62 6f 75 6e 64 70 20 27 |)..(or (|boundp '|
|00000220| 63 75 72 72 65 6e 74 2d | 6c 6f 61 64 2d 6c 69 73 |current-|load-lis|
|00000230| 74 29 20 28 73 65 74 71 | 20 63 75 72 72 65 6e 74 |t) (setq| current|
|00000240| 2d 6c 6f 61 64 2d 6c 69 | 73 74 20 6e 69 6c 29 29 |-load-li|st nil))|
|00000250| 0a 0a 0a 23 40 34 38 37 | 20 2a 4e 6f 6e 2d 6e 69 |...#@487| *Non-ni|
|00000260| 6c 20 6d 65 61 6e 73 20 | 60 71 75 65 72 79 2d 72 |l means |`query-r|
|00000270| 65 70 6c 61 63 65 27 20 | 73 68 6f 75 6c 64 20 70 |eplace' |should p|
|00000280| 72 65 73 65 72 76 65 20 | 63 61 73 65 20 69 6e 20 |reserve |case in |
|00000290| 72 65 70 6c 61 63 65 6d | 65 6e 74 73 2e 0a 57 68 |replacem|ents..Wh|
|000002a0| 61 74 20 74 68 69 73 20 | 6d 65 61 6e 73 20 69 73 |at this |means is|
|000002b0| 20 74 68 61 74 20 60 71 | 75 65 72 79 2d 72 65 70 | that `q|uery-rep|
|000002c0| 6c 61 63 65 27 20 77 69 | 6c 6c 20 63 68 61 6e 67 |lace' wi|ll chang|
|000002d0| 65 20 74 68 65 20 63 61 | 73 65 20 6f 66 20 74 68 |e the ca|se of th|
|000002e0| 65 0a 72 65 70 6c 61 63 | 65 6d 65 6e 74 20 74 65 |e.replac|ement te|
|000002f0| 78 74 20 73 6f 20 74 68 | 61 74 20 69 74 20 6d 61 |xt so th|at it ma|
|00000300| 74 63 68 65 73 20 74 68 | 65 20 74 65 78 74 20 74 |tches th|e text t|
|00000310| 68 61 74 20 77 61 73 20 | 72 65 70 6c 61 63 65 64 |hat was |replaced|
|00000320| 2e 0a 49 66 20 74 68 69 | 73 20 76 61 72 69 61 62 |..If thi|s variab|
|00000330| 6c 65 20 69 73 20 6e 69 | 6c 2c 20 74 68 65 20 72 |le is ni|l, the r|
|00000340| 65 70 6c 61 63 65 6d 65 | 6e 74 20 74 65 78 74 20 |eplaceme|nt text |
|00000350| 77 69 6c 6c 20 62 65 20 | 69 6e 73 65 72 74 65 64 |will be |inserted|
|00000360| 0a 65 78 61 63 74 6c 79 | 20 61 73 20 69 74 20 77 |.exactly| as it w|
|00000370| 61 73 20 73 70 65 63 69 | 66 69 65 64 20 62 79 20 |as speci|fied by |
|00000380| 74 68 65 20 75 73 65 72 | 2c 20 69 72 72 65 73 70 |the user|, irresp|
|00000390| 65 63 74 69 76 65 20 6f | 66 20 74 68 65 20 63 61 |ective o|f the ca|
|000003a0| 73 65 0a 6f 66 20 74 68 | 65 20 74 65 78 74 20 74 |se.of th|e text t|
|000003b0| 68 61 74 20 77 61 73 20 | 72 65 70 6c 61 63 65 64 |hat was |replaced|
|000003c0| 2e 0a 0a 4e 6f 74 65 20 | 74 68 61 74 20 74 68 69 |...Note |that thi|
|000003d0| 73 20 66 6c 61 67 20 68 | 61 73 20 6e 6f 20 65 66 |s flag h|as no ef|
|000003e0| 66 65 63 74 20 69 66 20 | 60 63 61 73 65 2d 66 6f |fect if |`case-fo|
|000003f0| 6c 64 2d 73 65 61 72 63 | 68 27 20 69 73 20 6e 69 |ld-searc|h' is ni|
|00000400| 6c 2c 0a 6f 72 20 69 66 | 20 74 68 65 20 72 65 70 |l,.or if| the rep|
|00000410| 6c 61 63 65 6d 65 6e 74 | 20 74 65 78 74 20 68 61 |lacement| text ha|
|00000420| 73 20 61 6e 79 20 75 70 | 70 65 72 63 61 73 65 20 |s any up|percase |
|00000430| 6c 65 74 74 65 72 73 20 | 69 6e 20 69 74 2e 1f 0a |letters |in it...|
|00000440| 28 64 65 66 76 61 72 20 | 63 61 73 65 2d 72 65 70 |(defvar |case-rep|
|00000450| 6c 61 63 65 20 74 20 28 | 23 24 20 2e 20 2d 36 30 |lace t (|#$ . -60|
|00000460| 31 29 29 0a 28 62 79 74 | 65 2d 63 6f 64 65 20 22 |1)).(byt|e-code "|
|00000470| c0 c1 21 ac 82 c2 11 c1 | 0b 42 13 c2 87 22 20 5b |..!.....|.B..." [|
|00000480| 62 6f 75 6e 64 70 20 71 | 75 65 72 79 2d 72 65 70 |boundp q|uery-rep|
|00000490| 6c 61 63 65 2d 68 69 73 | 74 6f 72 79 20 6e 69 6c |lace-his|tory nil|
|000004a0| 20 63 75 72 72 65 6e 74 | 2d 6c 6f 61 64 2d 6c 69 | current|-load-li|
|000004b0| 73 74 5d 20 32 29 0a 23 | 40 39 38 20 4e 6f 6e 2d |st] 2).#|@98 Non-|
|000004c0| 6e 69 6c 20 6d 65 61 6e | 73 20 60 71 75 65 72 79 |nil mean|s `query|
|000004d0| 2d 72 65 70 6c 61 63 65 | 27 20 75 73 65 73 20 74 |-replace|' uses t|
|000004e0| 68 65 20 6c 61 73 74 20 | 73 65 61 72 63 68 20 73 |he last |search s|
|000004f0| 74 72 69 6e 67 2e 0a 54 | 68 61 74 20 62 65 63 6f |tring..T|hat beco|
|00000500| 6d 65 73 20 74 68 65 20 | 22 73 74 72 69 6e 67 20 |mes the |"string |
|00000510| 74 6f 20 72 65 70 6c 61 | 63 65 22 2e 1f 0a 28 64 |to repla|ce"...(d|
|00000520| 65 66 76 61 72 20 71 75 | 65 72 79 2d 72 65 70 6c |efvar qu|ery-repl|
|00000530| 61 63 65 2d 69 6e 74 65 | 72 61 63 74 69 76 65 20 |ace-inte|ractive |
|00000540| 6e 69 6c 20 28 23 24 20 | 2e 20 31 32 31 32 29 29 |nil (#$ |. 1212))|
|00000550| 0a 28 64 65 66 61 6c 69 | 61 73 20 27 71 75 65 72 |.(defali|as 'quer|
|00000560| 79 2d 72 65 70 6c 61 63 | 65 2d 72 65 61 64 2d 61 |y-replac|e-read-a|
|00000570| 72 67 73 20 23 5b 28 73 | 74 72 69 6e 67 20 72 65 |rgs #[(s|tring re|
|00000580| 67 65 78 70 2d 66 6c 61 | 67 29 20 22 c0 89 19 1a |gexp-fla|g) "....|
|00000590| 0b ab 8c 0c ab 83 0d aa | 82 0e 06 40 12 aa 8e c7 |........|...@....|
|000005a0| c8 c9 ca 0e 0b 21 5c 22 | c0 89 89 cc 25 12 c7 c8 |.....!\"|....%...|
|000005b0| cd ca 0e 0b 21 5c 6e 23 | c0 89 89 cc 25 11 5c 6e |....!\n#|....%.\n|
|000005c0| 09 0e 0e 45 2a 87 22 20 | 5b 6e 69 6c 20 74 6f 20 |...E*." |[nil to |
|000005d0| 66 72 6f 6d 20 71 75 65 | 72 79 2d 72 65 70 6c 61 |from que|ry-repla|
|000005e0| 63 65 2d 69 6e 74 65 72 | 61 63 74 69 76 65 20 72 |ce-inter|active r|
|000005f0| 65 67 65 78 70 2d 66 6c | 61 67 20 72 65 67 65 78 |egexp-fl|ag regex|
|00000600| 70 2d 73 65 61 72 63 68 | 2d 72 69 6e 67 20 73 65 |p-search|-ring se|
|00000610| 61 72 63 68 2d 72 69 6e | 67 20 72 65 61 64 2d 66 |arch-rin|g read-f|
|00000620| 72 6f 6d 2d 6d 69 6e 69 | 62 75 66 66 65 72 20 66 |rom-mini|buffer f|
|00000630| 6f 72 6d 61 74 20 22 25 | 73 3a 20 22 20 67 65 74 |ormat "%|s: " get|
|00000640| 74 65 78 74 20 73 74 72 | 69 6e 67 20 71 75 65 72 |text str|ing quer|
|00000650| 79 2d 72 65 70 6c 61 63 | 65 2d 68 69 73 74 6f 72 |y-replac|e-histor|
|00000660| 79 20 22 25 73 20 25 73 | 20 77 69 74 68 3a 20 22 |y "%s %s| with: "|
|00000670| 20 63 75 72 72 65 6e 74 | 2d 70 72 65 66 69 78 2d | current|-prefix-|
|00000680| 61 72 67 5d 20 36 5d 29 | 0a 23 40 38 30 33 20 52 |arg] 6])|.#@803 R|
|00000690| 65 70 6c 61 63 65 20 73 | 6f 6d 65 20 6f 63 63 75 |eplace s|ome occu|
|000006a0| 72 72 65 6e 63 65 73 20 | 6f 66 20 46 52 4f 4d 2d |rrences |of FROM-|
|000006b0| 53 54 52 49 4e 47 20 77 | 69 74 68 20 54 4f 2d 53 |STRING w|ith TO-S|
|000006c0| 54 52 49 4e 47 2e 0a 41 | 73 20 65 61 63 68 20 6d |TRING..A|s each m|
|000006d0| 61 74 63 68 20 69 73 20 | 66 6f 75 6e 64 2c 20 74 |atch is |found, t|
|000006e0| 68 65 20 75 73 65 72 20 | 6d 75 73 74 20 74 79 70 |he user |must typ|
|000006f0| 65 20 61 20 63 68 61 72 | 61 63 74 65 72 20 73 61 |e a char|acter sa|
|00000700| 79 69 6e 67 0a 77 68 61 | 74 20 74 6f 20 64 6f 20 |ying.wha|t to do |
|00000710| 77 69 74 68 20 69 74 2e | 20 20 46 6f 72 20 64 69 |with it.| For di|
|00000720| 72 65 63 74 69 6f 6e 73 | 2c 20 74 79 70 65 20 5c |rections|, type \|
|00000730| 5b 68 65 6c 70 2d 63 6f | 6d 6d 61 6e 64 5d 20 61 |[help-co|mmand] a|
|00000740| 74 20 74 68 61 74 20 74 | 69 6d 65 2e 0a 0a 49 66 |t that t|ime...If|
|00000750| 20 60 71 75 65 72 79 2d | 72 65 70 6c 61 63 65 2d | `query-|replace-|
|00000760| 69 6e 74 65 72 61 63 74 | 69 76 65 27 20 69 73 20 |interact|ive' is |
|00000770| 6e 6f 6e 2d 6e 69 6c 2c | 20 74 68 65 20 6c 61 73 |non-nil,| the las|
|00000780| 74 20 69 6e 63 72 65 6d | 65 6e 74 61 6c 20 73 65 |t increm|ental se|
|00000790| 61 72 63 68 0a 73 74 72 | 69 6e 67 20 69 73 20 75 |arch.str|ing is u|
|000007a0| 73 65 64 20 61 73 20 46 | 52 4f 4d 2d 53 54 52 49 |sed as F|ROM-STRI|
|000007b0| 4e 47 2d 2d 79 6f 75 20 | 64 6f 6e 27 74 20 68 61 |NG--you |don't ha|
|000007c0| 76 65 20 74 6f 20 73 70 | 65 63 69 66 79 20 69 74 |ve to sp|ecify it|
|000007d0| 20 77 69 74 68 20 74 68 | 65 0a 6d 69 6e 69 62 75 | with th|e.minibu|
|000007e0| 66 66 65 72 2e 0a 0a 50 | 72 65 73 65 72 76 65 73 |ffer...P|reserves|
|000007f0| 20 63 61 73 65 20 69 6e | 20 65 61 63 68 20 72 65 | case in| each re|
|00000800| 70 6c 61 63 65 6d 65 6e | 74 20 69 66 20 60 63 61 |placemen|t if `ca|
|00000810| 73 65 2d 72 65 70 6c 61 | 63 65 27 20 61 6e 64 20 |se-repla|ce' and |
|00000820| 60 63 61 73 65 2d 66 6f | 6c 64 2d 73 65 61 72 63 |`case-fo|ld-searc|
|00000830| 68 27 0a 61 72 65 20 6e | 6f 6e 2d 6e 69 6c 20 61 |h'.are n|on-nil a|
|00000840| 6e 64 20 46 52 4f 4d 2d | 53 54 52 49 4e 47 20 68 |nd FROM-|STRING h|
|00000850| 61 73 20 6e 6f 20 75 70 | 70 65 72 63 61 73 65 20 |as no up|percase |
|00000860| 6c 65 74 74 65 72 73 2e | 0a 28 50 72 65 73 65 72 |letters.|.(Preser|
|00000870| 76 69 6e 67 20 63 61 73 | 65 20 6d 65 61 6e 73 20 |ving cas|e means |
|00000880| 74 68 61 74 20 69 66 20 | 74 68 65 20 73 74 72 69 |that if |the stri|
|00000890| 6e 67 20 6d 61 74 63 68 | 65 64 20 69 73 20 61 6c |ng match|ed is al|
|000008a0| 6c 20 63 61 70 73 2c 20 | 6f 72 20 63 61 70 69 74 |l caps, |or capit|
|000008b0| 61 6c 69 7a 65 64 2c 0a | 74 68 65 6e 20 69 74 73 |alized,.|then its|
|000008c0| 20 72 65 70 6c 61 63 65 | 6d 65 6e 74 20 69 73 20 | replace|ment is |
|000008d0| 75 70 63 61 73 65 64 20 | 6f 72 20 63 61 70 69 74 |upcased |or capit|
|000008e0| 61 6c 69 7a 65 64 2e 29 | 0a 0a 54 68 69 72 64 20 |alized.)|..Third |
|000008f0| 61 72 67 20 44 45 4c 49 | 4d 49 54 45 44 20 28 70 |arg DELI|MITED (p|
|00000900| 72 65 66 69 78 20 61 72 | 67 20 69 66 20 69 6e 74 |refix ar|g if int|
|00000910| 65 72 61 63 74 69 76 65 | 29 2c 20 69 66 20 6e 6f |eractive|), if no|
|00000920| 6e 2d 6e 69 6c 2c 20 6d | 65 61 6e 73 20 72 65 70 |n-nil, m|eans rep|
|00000930| 6c 61 63 65 0a 6f 6e 6c | 79 20 6d 61 74 63 68 65 |lace.onl|y matche|
|00000940| 73 20 73 75 72 72 6f 75 | 6e 64 65 64 20 62 79 20 |s surrou|nded by |
|00000950| 77 6f 72 64 20 62 6f 75 | 6e 64 61 72 69 65 73 2e |word bou|ndaries.|
|00000960| 0a 0a 54 6f 20 63 75 73 | 74 6f 6d 69 7a 65 20 70 |..To cus|tomize p|
|00000970| 6f 73 73 69 62 6c 65 20 | 72 65 73 70 6f 6e 73 65 |ossible |response|
|00000980| 73 2c 20 63 68 61 6e 67 | 65 20 74 68 65 20 22 62 |s, chang|e the "b|
|00000990| 69 6e 64 69 6e 67 73 22 | 20 69 6e 20 60 71 75 65 |indings"| in `que|
|000009a0| 72 79 2d 72 65 70 6c 61 | 63 65 2d 6d 61 70 27 2e |ry-repla|ce-map'.|
|000009b0| 1f 0a 28 64 65 66 61 6c | 69 61 73 20 27 71 75 65 |..(defal|ias 'que|
|000009c0| 72 79 2d 72 65 70 6c 61 | 63 65 20 23 5b 28 66 72 |ry-repla|ce #[(fr|
|000009d0| 6f 6d 2d 73 74 72 69 6e | 67 20 74 6f 2d 73 74 72 |om-strin|g to-str|
|000009e0| 69 6e 67 20 26 6f 70 74 | 69 6f 6e 61 6c 20 61 72 |ing &opt|ional ar|
|000009f0| 67 29 20 22 c0 09 5c 6e | c3 c4 0d 25 87 22 20 5b |g) "..\n|...%." [|
|00000a00| 70 65 72 66 6f 72 6d 2d | 72 65 70 6c 61 63 65 20 |perform-|replace |
|00000a10| 66 72 6f 6d 2d 73 74 72 | 69 6e 67 20 74 6f 2d 73 |from-str|ing to-s|
|00000a20| 74 72 69 6e 67 20 74 20 | 6e 69 6c 20 61 72 67 5d |tring t |nil arg]|
|00000a30| 20 36 20 28 23 24 20 2e | 20 31 36 37 39 29 20 28 | 6 (#$ .| 1679) (|
|00000a40| 71 75 65 72 79 2d 72 65 | 70 6c 61 63 65 2d 72 65 |query-re|place-re|
|00000a50| 61 64 2d 61 72 67 73 20 | 22 51 75 65 72 79 20 72 |ad-args |"Query r|
|00000a60| 65 70 6c 61 63 65 22 20 | 6e 69 6c 29 5d 29 0a 23 |eplace" |nil)]).#|
|00000a70| 40 37 35 35 20 52 65 70 | 6c 61 63 65 20 73 6f 6d |@755 Rep|lace som|
|00000a80| 65 20 74 68 69 6e 67 73 | 20 61 66 74 65 72 20 70 |e things| after p|
|00000a90| 6f 69 6e 74 20 6d 61 74 | 63 68 69 6e 67 20 52 45 |oint mat|ching RE|
|00000aa0| 47 45 58 50 20 77 69 74 | 68 20 54 4f 2d 53 54 52 |GEXP wit|h TO-STR|
|00000ab0| 49 4e 47 2e 0a 41 73 20 | 65 61 63 68 20 6d 61 74 |ING..As |each mat|
|00000ac0| 63 68 20 69 73 20 66 6f | 75 6e 64 2c 20 74 68 65 |ch is fo|und, the|
|00000ad0| 20 75 73 65 72 20 6d 75 | 73 74 20 74 79 70 65 20 | user mu|st type |
|00000ae0| 61 20 63 68 61 72 61 63 | 74 65 72 20 73 61 79 69 |a charac|ter sayi|
|00000af0| 6e 67 0a 77 68 61 74 20 | 74 6f 20 64 6f 20 77 69 |ng.what |to do wi|
|00000b00| 74 68 20 69 74 2e 20 20 | 46 6f 72 20 64 69 72 65 |th it. |For dire|
|00000b10| 63 74 69 6f 6e 73 2c 20 | 74 79 70 65 20 5c 5b 68 |ctions, |type \[h|
|00000b20| 65 6c 70 2d 63 6f 6d 6d | 61 6e 64 5d 20 61 74 20 |elp-comm|and] at |
|00000b30| 74 68 61 74 20 74 69 6d | 65 2e 0a 0a 49 66 20 60 |that tim|e...If `|
|00000b40| 71 75 65 72 79 2d 72 65 | 70 6c 61 63 65 2d 69 6e |query-re|place-in|
|00000b50| 74 65 72 61 63 74 69 76 | 65 27 20 69 73 20 6e 6f |teractiv|e' is no|
|00000b60| 6e 2d 6e 69 6c 2c 20 74 | 68 65 20 6c 61 73 74 20 |n-nil, t|he last |
|00000b70| 69 6e 63 72 65 6d 65 6e | 74 61 6c 20 73 65 61 72 |incremen|tal sear|
|00000b80| 63 68 0a 72 65 67 65 78 | 70 20 69 73 20 75 73 65 |ch.regex|p is use|
|00000b90| 64 20 61 73 20 52 45 47 | 45 58 50 2d 2d 79 6f 75 |d as REG|EXP--you|
|00000ba0| 20 64 6f 6e 27 74 20 68 | 61 76 65 20 74 6f 20 73 | don't h|ave to s|
|00000bb0| 70 65 63 69 66 79 20 69 | 74 20 77 69 74 68 20 74 |pecify i|t with t|
|00000bc0| 68 65 0a 6d 69 6e 69 62 | 75 66 66 65 72 2e 0a 0a |he.minib|uffer...|
|00000bd0| 50 72 65 73 65 72 76 65 | 73 20 63 61 73 65 20 69 |Preserve|s case i|
|00000be0| 6e 20 65 61 63 68 20 72 | 65 70 6c 61 63 65 6d 65 |n each r|eplaceme|
|00000bf0| 6e 74 20 69 66 20 60 63 | 61 73 65 2d 72 65 70 6c |nt if `c|ase-repl|
|00000c00| 61 63 65 27 20 61 6e 64 | 20 60 63 61 73 65 2d 66 |ace' and| `case-f|
|00000c10| 6f 6c 64 2d 73 65 61 72 | 63 68 27 0a 61 72 65 20 |old-sear|ch'.are |
|00000c20| 6e 6f 6e 2d 6e 69 6c 20 | 61 6e 64 20 52 45 47 45 |non-nil |and REGE|
|00000c30| 58 50 20 68 61 73 20 6e | 6f 20 75 70 70 65 72 63 |XP has n|o upperc|
|00000c40| 61 73 65 20 6c 65 74 74 | 65 72 73 2e 0a 54 68 69 |ase lett|ers..Thi|
|00000c50| 72 64 20 61 72 67 20 44 | 45 4c 49 4d 49 54 45 44 |rd arg D|ELIMITED|
|00000c60| 20 28 70 72 65 66 69 78 | 20 61 72 67 20 69 66 20 | (prefix| arg if |
|00000c70| 69 6e 74 65 72 61 63 74 | 69 76 65 29 2c 20 69 66 |interact|ive), if|
|00000c80| 20 6e 6f 6e 2d 6e 69 6c | 2c 20 6d 65 61 6e 73 20 | non-nil|, means |
|00000c90| 72 65 70 6c 61 63 65 0a | 6f 6e 6c 79 20 6d 61 74 |replace.|only mat|
|00000ca0| 63 68 65 73 20 73 75 72 | 72 6f 75 6e 64 65 64 20 |ches sur|rounded |
|00000cb0| 62 79 20 77 6f 72 64 20 | 62 6f 75 6e 64 61 72 69 |by word |boundari|
|00000cc0| 65 73 2e 0a 49 6e 20 54 | 4f 2d 53 54 52 49 4e 47 |es..In T|O-STRING|
|00000cd0| 2c 20 60 5c 26 27 20 73 | 74 61 6e 64 73 20 66 6f |, `\&' s|tands fo|
|00000ce0| 72 20 77 68 61 74 65 76 | 65 72 20 6d 61 74 63 68 |r whatev|er match|
|00000cf0| 65 64 20 74 68 65 20 77 | 68 6f 6c 65 20 6f 66 20 |ed the w|hole of |
|00000d00| 52 45 47 45 58 50 2c 0a | 61 6e 64 20 60 5c 3d 5c |REGEXP,.|and `\=\|
|00000d10| 4e 27 20 28 77 68 65 72 | 65 20 4e 20 69 73 20 61 |N' (wher|e N is a|
|00000d20| 20 64 69 67 69 74 29 20 | 73 74 61 6e 64 73 20 66 | digit) |stands f|
|00000d30| 6f 72 0a 20 77 68 61 74 | 65 76 65 72 20 77 68 61 |or. what|ever wha|
|00000d40| 74 20 6d 61 74 63 68 65 | 64 20 74 68 65 20 4e 74 |t matche|d the Nt|
|00000d50| 68 20 60 5c 28 2e 2e 2e | 5c 29 27 20 69 6e 20 52 |h `\(...|\)' in R|
|00000d60| 45 47 45 58 50 2e 1f 0a | 28 64 65 66 61 6c 69 61 |EGEXP...|(defalia|
|00000d70| 73 20 27 71 75 65 72 79 | 2d 72 65 70 6c 61 63 65 |s 'query|-replace|
|00000d80| 2d 72 65 67 65 78 70 20 | 23 5b 28 72 65 67 65 78 |-regexp |#[(regex|
|00000d90| 70 20 74 6f 2d 73 74 72 | 69 6e 67 20 26 6f 70 74 |p to-str|ing &opt|
|00000da0| 69 6f 6e 61 6c 20 61 72 | 67 29 20 22 c0 09 5c 6e |ional ar|g) "..\n|
|00000db0| c3 89 0c 25 87 22 20 5b | 70 65 72 66 6f 72 6d 2d |...%." [|perform-|
|00000dc0| 72 65 70 6c 61 63 65 20 | 72 65 67 65 78 70 20 74 |replace |regexp t|
|00000dd0| 6f 2d 73 74 72 69 6e 67 | 20 74 20 61 72 67 5d 20 |o-string| t arg] |
|00000de0| 36 20 28 23 24 20 2e 20 | 32 36 37 37 29 20 28 71 |6 (#$ . |2677) (q|
|00000df0| 75 65 72 79 2d 72 65 70 | 6c 61 63 65 2d 72 65 61 |uery-rep|lace-rea|
|00000e00| 64 2d 61 72 67 73 20 22 | 51 75 65 72 79 20 72 65 |d-args "|Query re|
|00000e10| 70 6c 61 63 65 20 72 65 | 67 65 78 70 22 20 74 29 |place re|gexp" t)|
|00000e20| 5d 29 0a 23 40 36 35 34 | 20 52 65 70 6c 61 63 65 |]).#@654| Replace|
|00000e30| 20 73 6f 6d 65 20 6d 61 | 74 63 68 65 73 20 66 6f | some ma|tches fo|
|00000e40| 72 20 52 45 47 45 58 50 | 20 77 69 74 68 20 76 61 |r REGEXP| with va|
|00000e50| 72 69 6f 75 73 20 73 74 | 72 69 6e 67 73 2c 20 69 |rious st|rings, i|
|00000e60| 6e 20 72 6f 74 61 74 69 | 6f 6e 2e 0a 54 68 65 20 |n rotati|on..The |
|00000e70| 73 65 63 6f 6e 64 20 61 | 72 67 75 6d 65 6e 74 20 |second a|rgument |
|00000e80| 54 4f 2d 53 54 52 49 4e | 47 53 20 63 6f 6e 74 61 |TO-STRIN|GS conta|
|00000e90| 69 6e 73 20 74 68 65 20 | 72 65 70 6c 61 63 65 6d |ins the |replacem|
|00000ea0| 65 6e 74 20 73 74 72 69 | 6e 67 73 2c 20 73 65 70 |ent stri|ngs, sep|
|00000eb0| 61 72 61 74 65 64 0a 62 | 79 20 73 70 61 63 65 73 |arated.b|y spaces|
|00000ec0| 2e 20 20 54 68 69 73 20 | 63 6f 6d 6d 61 6e 64 20 |. This |command |
|00000ed0| 77 6f 72 6b 73 20 6c 69 | 6b 65 20 60 71 75 65 72 |works li|ke `quer|
|00000ee0| 79 2d 72 65 70 6c 61 63 | 65 2d 72 65 67 65 78 70 |y-replac|e-regexp|
|00000ef0| 27 20 65 78 63 65 70 74 | 0a 74 68 61 74 20 65 61 |' except|.that ea|
|00000f00| 63 68 20 73 75 63 63 65 | 73 73 69 76 65 20 72 65 |ch succe|ssive re|
|00000f10| 70 6c 61 63 65 6d 65 6e | 74 20 75 73 65 73 20 74 |placemen|t uses t|
|00000f20| 68 65 20 6e 65 78 74 20 | 73 75 63 63 65 73 73 69 |he next |successi|
|00000f30| 76 65 20 72 65 70 6c 61 | 63 65 6d 65 6e 74 20 73 |ve repla|cement s|
|00000f40| 74 72 69 6e 67 2c 0a 77 | 72 61 70 70 69 6e 67 20 |tring,.w|rapping |
|00000f50| 61 72 6f 75 6e 64 20 66 | 72 6f 6d 20 74 68 65 20 |around f|rom the |
|00000f60| 6c 61 73 74 20 73 75 63 | 68 20 73 74 72 69 6e 67 |last suc|h string|
|00000f70| 20 74 6f 20 74 68 65 20 | 66 69 72 73 74 2e 0a 0a | to the |first...|
|00000f80| 4e 6f 6e 2d 69 6e 74 65 | 72 61 63 74 69 76 65 6c |Non-inte|ractivel|
|00000f90| 79 2c 20 54 4f 2d 53 54 | 52 49 4e 47 53 20 6d 61 |y, TO-ST|RINGS ma|
|00000fa0| 79 20 62 65 20 61 20 6c | 69 73 74 20 6f 66 20 72 |y be a l|ist of r|
|00000fb0| 65 70 6c 61 63 65 6d 65 | 6e 74 20 73 74 72 69 6e |eplaceme|nt strin|
|00000fc0| 67 73 2e 0a 0a 49 66 20 | 60 71 75 65 72 79 2d 72 |gs...If |`query-r|
|00000fd0| 65 70 6c 61 63 65 2d 69 | 6e 74 65 72 61 63 74 69 |eplace-i|nteracti|
|00000fe0| 76 65 27 20 69 73 20 6e | 6f 6e 2d 6e 69 6c 2c 20 |ve' is n|on-nil, |
|00000ff0| 74 68 65 20 6c 61 73 74 | 20 69 6e 63 72 65 6d 65 |the last| increme|
|00001000| 6e 74 61 6c 20 73 65 61 | 72 63 68 0a 72 65 67 65 |ntal sea|rch.rege|
|00001010| 78 70 20 69 73 20 75 73 | 65 64 20 61 73 20 52 45 |xp is us|ed as RE|
|00001020| 47 45 58 50 2d 2d 79 6f | 75 20 64 6f 6e 27 74 20 |GEXP--yo|u don't |
|00001030| 68 61 76 65 20 74 6f 20 | 73 70 65 63 69 66 79 20 |have to |specify |
|00001040| 69 74 20 77 69 74 68 20 | 74 68 65 20 6d 69 6e 69 |it with |the mini|
|00001050| 62 75 66 66 65 72 2e 0a | 0a 41 20 70 72 65 66 69 |buffer..|.A prefi|
|00001060| 78 20 61 72 67 75 6d 65 | 6e 74 20 4e 20 73 61 79 |x argume|nt N say|
|00001070| 73 20 74 6f 20 75 73 65 | 20 65 61 63 68 20 72 65 |s to use| each re|
|00001080| 70 6c 61 63 65 6d 65 6e | 74 20 73 74 72 69 6e 67 |placemen|t string|
|00001090| 20 4e 20 74 69 6d 65 73 | 0a 62 65 66 6f 72 65 20 | N times|.before |
|000010a0| 72 6f 74 61 74 69 6e 67 | 20 74 6f 20 74 68 65 20 |rotating| to the |
|000010b0| 6e 65 78 74 2e 1f 0a 28 | 64 65 66 61 6c 69 61 73 |next...(|defalias|
|000010c0| 20 27 6d 61 70 2d 71 75 | 65 72 79 2d 72 65 70 6c | 'map-qu|ery-repl|
|000010d0| 61 63 65 2d 72 65 67 65 | 78 70 20 23 5b 28 72 65 |ace-rege|xp #[(re|
|000010e0| 67 65 78 70 20 74 6f 2d | 73 74 72 69 6e 67 73 20 |gexp to-|strings |
|000010f0| 26 6f 70 74 69 6f 6e 61 | 6c 20 61 72 67 29 20 22 |&optiona|l arg) "|
|00001100| c0 19 5c 6e 3c ab 84 5c | 6e 11 aa af 5c 6e 47 c3 |..\n<..\|n...\nG.|
|00001110| 55 ac a9 c4 c5 5c 6e 5c | 22 ab 98 c6 09 5c 6e c3 |U....\n\|"....\n.|
|00001120| c4 c5 5c 6e 5c 22 4f 43 | 5c 22 11 5c 6e c4 c5 5c |..\n\"OC|\".\n..\|
|00001130| 6e 5c 22 54 c0 4f 89 12 | aa 5d c6 09 5c 6e 43 5c |n\"T.O..|.]..\nC\|
|00001140| 22 11 c7 89 12 aa 52 c8 | 0e 09 09 ca 89 c0 0e 0b |".....R.|........|
|00001150| 26 06 29 87 22 20 5b 6e | 69 6c 20 72 65 70 6c 61 |&.)." [n|il repla|
|00001160| 63 65 6d 65 6e 74 73 20 | 74 6f 2d 73 74 72 69 6e |cements |to-strin|
|00001170| 67 73 20 30 20 73 74 72 | 69 6e 67 2d 6d 61 74 63 |gs 0 str|ing-matc|
|00001180| 68 20 22 20 22 20 61 70 | 70 65 6e 64 20 22 22 20 |h " " ap|pend "" |
|00001190| 70 65 72 66 6f 72 6d 2d | 72 65 70 6c 61 63 65 20 |perform-|replace |
|000011a0| 72 65 67 65 78 70 20 74 | 20 61 72 67 5d 20 38 20 |regexp t| arg] 8 |
|000011b0| 28 23 24 20 2e 20 33 36 | 32 35 29 20 28 6c 65 74 |(#$ . 36|25) (let|
|000011c0| 20 28 66 72 6f 6d 20 74 | 6f 29 20 28 73 65 74 71 | (from t|o) (setq|
|000011d0| 20 66 72 6f 6d 20 28 69 | 66 20 71 75 65 72 79 2d | from (i|f query-|
|000011e0| 72 65 70 6c 61 63 65 2d | 69 6e 74 65 72 61 63 74 |replace-|interact|
|000011f0| 69 76 65 20 28 63 61 72 | 20 72 65 67 65 78 70 2d |ive (car| regexp-|
|00001200| 73 65 61 72 63 68 2d 72 | 69 6e 67 29 20 28 72 65 |search-r|ing) (re|
|00001210| 61 64 2d 66 72 6f 6d 2d | 6d 69 6e 69 62 75 66 66 |ad-from-|minibuff|
|00001220| 65 72 20 22 4d 61 70 20 | 71 75 65 72 79 20 72 65 |er "Map |query re|
|00001230| 70 6c 61 63 65 20 28 72 | 65 67 65 78 70 29 3a 20 |place (r|egexp): |
|00001240| 22 20 6e 69 6c 20 6e 69 | 6c 20 6e 69 6c 20 27 71 |" nil ni|l nil 'q|
|00001250| 75 65 72 79 2d 72 65 70 | 6c 61 63 65 2d 68 69 73 |uery-rep|lace-his|
|00001260| 74 6f 72 79 29 29 29 20 | 28 73 65 74 71 20 74 6f |tory))) |(setq to|
|00001270| 20 28 72 65 61 64 2d 66 | 72 6f 6d 2d 6d 69 6e 69 | (read-f|rom-mini|
|00001280| 62 75 66 66 65 72 20 28 | 66 6f 72 6d 61 74 20 22 |buffer (|format "|
|00001290| 51 75 65 72 79 20 72 65 | 70 6c 61 63 65 20 25 73 |Query re|place %s|
|000012a0| 20 77 69 74 68 20 28 73 | 70 61 63 65 2d 73 65 70 | with (s|pace-sep|
|000012b0| 61 72 61 74 65 64 20 73 | 74 72 69 6e 67 73 29 3a |arated s|trings):|
|000012c0| 20 22 20 66 72 6f 6d 29 | 20 6e 69 6c 20 6e 69 6c | " from)| nil nil|
|000012d0| 20 6e 69 6c 20 27 71 75 | 65 72 79 2d 72 65 70 6c | nil 'qu|ery-repl|
|000012e0| 61 63 65 2d 68 69 73 74 | 6f 72 79 29 29 20 28 6c |ace-hist|ory)) (l|
|000012f0| 69 73 74 20 66 72 6f 6d | 20 74 6f 20 63 75 72 72 |ist from| to curr|
|00001300| 65 6e 74 2d 70 72 65 66 | 69 78 2d 61 72 67 29 29 |ent-pref|ix-arg))|
|00001310| 5d 29 0a 23 40 38 33 36 | 20 52 65 70 6c 61 63 65 |]).#@836| Replace|
|00001320| 20 6f 63 63 75 72 72 65 | 6e 63 65 73 20 6f 66 20 | occurre|nces of |
|00001330| 46 52 4f 4d 2d 53 54 52 | 49 4e 47 20 77 69 74 68 |FROM-STR|ING with|
|00001340| 20 54 4f 2d 53 54 52 49 | 4e 47 2e 0a 50 72 65 73 | TO-STRI|NG..Pres|
|00001350| 65 72 76 65 20 63 61 73 | 65 20 69 6e 20 65 61 63 |erve cas|e in eac|
|00001360| 68 20 6d 61 74 63 68 20 | 69 66 20 60 63 61 73 65 |h match |if `case|
|00001370| 2d 72 65 70 6c 61 63 65 | 27 20 61 6e 64 20 60 63 |-replace|' and `c|
|00001380| 61 73 65 2d 66 6f 6c 64 | 2d 73 65 61 72 63 68 27 |ase-fold|-search'|
|00001390| 0a 61 72 65 20 6e 6f 6e | 2d 6e 69 6c 20 61 6e 64 |.are non|-nil and|
|000013a0| 20 46 52 4f 4d 2d 53 54 | 52 49 4e 47 20 68 61 73 | FROM-ST|RING has|
|000013b0| 20 6e 6f 20 75 70 70 65 | 72 63 61 73 65 20 6c 65 | no uppe|rcase le|
|000013c0| 74 74 65 72 73 2e 0a 28 | 50 72 65 73 65 72 76 69 |tters..(|Preservi|
|000013d0| 6e 67 20 63 61 73 65 20 | 6d 65 61 6e 73 20 74 68 |ng case |means th|
|000013e0| 61 74 20 69 66 20 74 68 | 65 20 73 74 72 69 6e 67 |at if th|e string|
|000013f0| 20 6d 61 74 63 68 65 64 | 20 69 73 20 61 6c 6c 20 | matched| is all |
|00001400| 63 61 70 73 2c 20 6f 72 | 20 63 61 70 69 74 61 6c |caps, or| capital|
|00001410| 69 7a 65 64 2c 0a 74 68 | 65 6e 20 69 74 73 20 72 |ized,.th|en its r|
|00001420| 65 70 6c 61 63 65 6d 65 | 6e 74 20 69 73 20 75 70 |eplaceme|nt is up|
|00001430| 63 61 73 65 64 20 6f 72 | 20 63 61 70 69 74 61 6c |cased or| capital|
|00001440| 69 7a 65 64 2e 29 0a 0a | 54 68 69 72 64 20 61 72 |ized.)..|Third ar|
|00001450| 67 20 44 45 4c 49 4d 49 | 54 45 44 20 28 70 72 65 |g DELIMI|TED (pre|
|00001460| 66 69 78 20 61 72 67 20 | 69 66 20 69 6e 74 65 72 |fix arg |if inter|
|00001470| 61 63 74 69 76 65 29 2c | 20 69 66 20 6e 6f 6e 2d |active),| if non-|
|00001480| 6e 69 6c 2c 20 6d 65 61 | 6e 73 20 72 65 70 6c 61 |nil, mea|ns repla|
|00001490| 63 65 0a 6f 6e 6c 79 20 | 6d 61 74 63 68 65 73 20 |ce.only |matches |
|000014a0| 73 75 72 72 6f 75 6e 64 | 65 64 20 62 79 20 77 6f |surround|ed by wo|
|000014b0| 72 64 20 62 6f 75 6e 64 | 61 72 69 65 73 2e 0a 0a |rd bound|aries...|
|000014c0| 49 66 20 60 71 75 65 72 | 79 2d 72 65 70 6c 61 63 |If `quer|y-replac|
|000014d0| 65 2d 69 6e 74 65 72 61 | 63 74 69 76 65 27 20 69 |e-intera|ctive' i|
|000014e0| 73 20 6e 6f 6e 2d 6e 69 | 6c 2c 20 74 68 65 20 6c |s non-ni|l, the l|
|000014f0| 61 73 74 20 69 6e 63 72 | 65 6d 65 6e 74 61 6c 20 |ast incr|emental |
|00001500| 73 65 61 72 63 68 0a 73 | 74 72 69 6e 67 20 69 73 |search.s|tring is|
|00001510| 20 75 73 65 64 20 61 73 | 20 46 52 4f 4d 2d 53 54 | used as| FROM-ST|
|00001520| 52 49 4e 47 2d 2d 79 6f | 75 20 64 6f 6e 27 74 20 |RING--yo|u don't |
|00001530| 68 61 76 65 20 74 6f 20 | 73 70 65 63 69 66 79 20 |have to |specify |
|00001540| 69 74 20 77 69 74 68 20 | 74 68 65 0a 6d 69 6e 69 |it with |the.mini|
|00001550| 62 75 66 66 65 72 2e 0a | 0a 54 68 69 73 20 66 75 |buffer..|.This fu|
|00001560| 6e 63 74 69 6f 6e 20 69 | 73 20 75 73 75 61 6c 6c |nction i|s usuall|
|00001570| 79 20 74 68 65 20 77 72 | 6f 6e 67 20 74 68 69 6e |y the wr|ong thin|
|00001580| 67 20 74 6f 20 75 73 65 | 20 69 6e 20 61 20 4c 69 |g to use| in a Li|
|00001590| 73 70 20 70 72 6f 67 72 | 61 6d 2e 0a 57 68 61 74 |sp progr|am..What|
|000015a0| 20 79 6f 75 20 70 72 6f | 62 61 62 6c 79 20 77 61 | you pro|bably wa|
|000015b0| 6e 74 20 69 73 20 61 20 | 6c 6f 6f 70 20 6c 69 6b |nt is a |loop lik|
|000015c0| 65 20 74 68 69 73 3a 0a | 20 20 28 77 68 69 6c 65 |e this:.| (while|
|000015d0| 20 28 73 65 61 72 63 68 | 2d 66 6f 72 77 61 72 64 | (search|-forward|
|000015e0| 20 46 52 4f 4d 2d 53 54 | 52 49 4e 47 20 6e 69 6c | FROM-ST|RING nil|
|000015f0| 20 74 29 0a 20 20 20 20 | 28 72 65 70 6c 61 63 65 | t). |(replace|
|00001600| 2d 6d 61 74 63 68 20 54 | 4f 2d 53 54 52 49 4e 47 |-match T|O-STRING|
|00001610| 20 6e 69 6c 20 74 29 29 | 0a 77 68 69 63 68 20 77 | nil t))|.which w|
|00001620| 69 6c 6c 20 72 75 6e 20 | 66 61 73 74 65 72 20 61 |ill run |faster a|
|00001630| 6e 64 20 77 69 6c 6c 20 | 6e 6f 74 20 73 65 74 20 |nd will |not set |
|00001640| 74 68 65 20 6d 61 72 6b | 20 6f 72 20 70 72 69 6e |the mark| or prin|
|00001650| 74 20 61 6e 79 74 68 69 | 6e 67 2e 1f 0a 28 64 65 |t anythi|ng...(de|
|00001660| 66 61 6c 69 61 73 20 27 | 72 65 70 6c 61 63 65 2d |falias '|replace-|
|00001670| 73 74 72 69 6e 67 20 23 | 5b 28 66 72 6f 6d 2d 73 |string #|[(from-s|
|00001680| 74 72 69 6e 67 20 74 6f | 2d 73 74 72 69 6e 67 20 |tring to|-string |
|00001690| 26 6f 70 74 69 6f 6e 61 | 6c 20 64 65 6c 69 6d 69 |&optiona|l delimi|
|000016a0| 74 65 64 29 20 22 c0 09 | 5c 6e c3 89 0c 25 87 22 |ted) "..|\n...%."|
|000016b0| 20 5b 70 65 72 66 6f 72 | 6d 2d 72 65 70 6c 61 63 | [perfor|m-replac|
|000016c0| 65 20 66 72 6f 6d 2d 73 | 74 72 69 6e 67 20 74 6f |e from-s|tring to|
|000016d0| 2d 73 74 72 69 6e 67 20 | 6e 69 6c 20 64 65 6c 69 |-string |nil deli|
|000016e0| 6d 69 74 65 64 5d 20 36 | 20 28 23 24 20 2e 20 34 |mited] 6| (#$ . 4|
|000016f0| 38 38 39 29 20 28 71 75 | 65 72 79 2d 72 65 70 6c |889) (qu|ery-repl|
|00001700| 61 63 65 2d 72 65 61 64 | 2d 61 72 67 73 20 22 52 |ace-read|-args "R|
|00001710| 65 70 6c 61 63 65 20 73 | 74 72 69 6e 67 22 20 6e |eplace s|tring" n|
|00001720| 69 6c 29 5d 29 0a 23 40 | 39 39 37 20 52 65 70 6c |il)]).#@|997 Repl|
|00001730| 61 63 65 20 74 68 69 6e | 67 73 20 61 66 74 65 72 |ace thin|gs after|
|00001740| 20 70 6f 69 6e 74 20 6d | 61 74 63 68 69 6e 67 20 | point m|atching |
|00001750| 52 45 47 45 58 50 20 77 | 69 74 68 20 54 4f 2d 53 |REGEXP w|ith TO-S|
|00001760| 54 52 49 4e 47 2e 0a 50 | 72 65 73 65 72 76 65 20 |TRING..P|reserve |
|00001770| 63 61 73 65 20 69 6e 20 | 65 61 63 68 20 6d 61 74 |case in |each mat|
|00001780| 63 68 20 69 66 20 60 63 | 61 73 65 2d 72 65 70 6c |ch if `c|ase-repl|
|00001790| 61 63 65 27 20 61 6e 64 | 20 60 63 61 73 65 2d 66 |ace' and| `case-f|
|000017a0| 6f 6c 64 2d 73 65 61 72 | 63 68 27 0a 61 72 65 20 |old-sear|ch'.are |
|000017b0| 6e 6f 6e 2d 6e 69 6c 20 | 61 6e 64 20 52 45 47 45 |non-nil |and REGE|
|000017c0| 58 50 20 68 61 73 20 6e | 6f 20 75 70 70 65 72 63 |XP has n|o upperc|
|000017d0| 61 73 65 20 6c 65 74 74 | 65 72 73 2e 0a 28 50 72 |ase lett|ers..(Pr|
|000017e0| 65 73 65 72 76 69 6e 67 | 20 63 61 73 65 20 6d 65 |eserving| case me|
|000017f0| 61 6e 73 20 74 68 61 74 | 20 69 66 20 74 68 65 20 |ans that| if the |
|00001800| 73 74 72 69 6e 67 20 6d | 61 74 63 68 65 64 20 69 |string m|atched i|
|00001810| 73 20 61 6c 6c 20 63 61 | 70 73 2c 20 6f 72 20 63 |s all ca|ps, or c|
|00001820| 61 70 69 74 61 6c 69 7a | 65 64 2c 0a 74 68 65 6e |apitaliz|ed,.then|
|00001830| 20 69 74 73 20 72 65 70 | 6c 61 63 65 6d 65 6e 74 | its rep|lacement|
|00001840| 20 69 73 20 75 70 63 61 | 73 65 64 20 6f 72 20 63 | is upca|sed or c|
|00001850| 61 70 69 74 61 6c 69 7a | 65 64 2e 29 0a 0a 54 68 |apitaliz|ed.)..Th|
|00001860| 69 72 64 20 61 72 67 20 | 44 45 4c 49 4d 49 54 45 |ird arg |DELIMITE|
|00001870| 44 20 28 70 72 65 66 69 | 78 20 61 72 67 20 69 66 |D (prefi|x arg if|
|00001880| 20 69 6e 74 65 72 61 63 | 74 69 76 65 29 2c 20 69 | interac|tive), i|
|00001890| 66 20 6e 6f 6e 2d 6e 69 | 6c 2c 20 6d 65 61 6e 73 |f non-ni|l, means|
|000018a0| 20 72 65 70 6c 61 63 65 | 0a 6f 6e 6c 79 20 6d 61 | replace|.only ma|
|000018b0| 74 63 68 65 73 20 73 75 | 72 72 6f 75 6e 64 65 64 |tches su|rrounded|
|000018c0| 20 62 79 20 77 6f 72 64 | 20 62 6f 75 6e 64 61 72 | by word| boundar|
|000018d0| 69 65 73 2e 0a 49 6e 20 | 54 4f 2d 53 54 52 49 4e |ies..In |TO-STRIN|
|000018e0| 47 2c 20 60 5c 26 27 20 | 73 74 61 6e 64 73 20 66 |G, `\&' |stands f|
|000018f0| 6f 72 20 77 68 61 74 65 | 76 65 72 20 6d 61 74 63 |or whate|ver matc|
|00001900| 68 65 64 20 74 68 65 20 | 77 68 6f 6c 65 20 6f 66 |hed the |whole of|
|00001910| 20 52 45 47 45 58 50 2c | 0a 61 6e 64 20 60 5c 3d | REGEXP,|.and `\=|
|00001920| 5c 4e 27 20 28 77 68 65 | 72 65 20 4e 20 69 73 20 |\N' (whe|re N is |
|00001930| 61 20 64 69 67 69 74 29 | 20 73 74 61 6e 64 73 20 |a digit)| stands |
|00001940| 66 6f 72 0a 20 77 68 61 | 74 65 76 65 72 20 77 68 |for. wha|tever wh|
|00001950| 61 74 20 6d 61 74 63 68 | 65 64 20 74 68 65 20 4e |at match|ed the N|
|00001960| 74 68 20 60 5c 28 2e 2e | 2e 5c 29 27 20 69 6e 20 |th `\(..|.\)' in |
|00001970| 52 45 47 45 58 50 2e 0a | 0a 49 66 20 60 71 75 65 |REGEXP..|.If `que|
|00001980| 72 79 2d 72 65 70 6c 61 | 63 65 2d 69 6e 74 65 72 |ry-repla|ce-inter|
|00001990| 61 63 74 69 76 65 27 20 | 69 73 20 6e 6f 6e 2d 6e |active' |is non-n|
|000019a0| 69 6c 2c 20 74 68 65 20 | 6c 61 73 74 20 69 6e 63 |il, the |last inc|
|000019b0| 72 65 6d 65 6e 74 61 6c | 20 73 65 61 72 63 68 0a |remental| search.|
|000019c0| 72 65 67 65 78 70 20 69 | 73 20 75 73 65 64 20 61 |regexp i|s used a|
|000019d0| 73 20 52 45 47 45 58 50 | 2d 2d 79 6f 75 20 64 6f |s REGEXP|--you do|
|000019e0| 6e 27 74 20 68 61 76 65 | 20 74 6f 20 73 70 65 63 |n't have| to spec|
|000019f0| 69 66 79 20 69 74 20 77 | 69 74 68 20 74 68 65 20 |ify it w|ith the |
|00001a00| 6d 69 6e 69 62 75 66 66 | 65 72 2e 0a 0a 54 68 69 |minibuff|er...Thi|
|00001a10| 73 20 66 75 6e 63 74 69 | 6f 6e 20 69 73 20 75 73 |s functi|on is us|
|00001a20| 75 61 6c 6c 79 20 74 68 | 65 20 77 72 6f 6e 67 20 |ually th|e wrong |
|00001a30| 74 68 69 6e 67 20 74 6f | 20 75 73 65 20 69 6e 20 |thing to| use in |
|00001a40| 61 20 4c 69 73 70 20 70 | 72 6f 67 72 61 6d 2e 0a |a Lisp p|rogram..|
|00001a50| 57 68 61 74 20 79 6f 75 | 20 70 72 6f 62 61 62 6c |What you| probabl|
|00001a60| 79 20 77 61 6e 74 20 69 | 73 20 61 20 6c 6f 6f 70 |y want i|s a loop|
|00001a70| 20 6c 69 6b 65 20 74 68 | 69 73 3a 0a 20 20 28 77 | like th|is:. (w|
|00001a80| 68 69 6c 65 20 28 72 65 | 2d 73 65 61 72 63 68 2d |hile (re|-search-|
|00001a90| 66 6f 72 77 61 72 64 20 | 52 45 47 45 58 50 20 6e |forward |REGEXP n|
|00001aa0| 69 6c 20 74 29 0a 20 20 | 20 20 28 72 65 70 6c 61 |il t). | (repla|
|00001ab0| 63 65 2d 6d 61 74 63 68 | 20 54 4f 2d 53 54 52 49 |ce-match| TO-STRI|
|00001ac0| 4e 47 20 6e 69 6c 20 6e | 69 6c 29 29 0a 77 68 69 |NG nil n|il)).whi|
|00001ad0| 63 68 20 77 69 6c 6c 20 | 72 75 6e 20 66 61 73 74 |ch will |run fast|
|00001ae0| 65 72 20 61 6e 64 20 77 | 69 6c 6c 20 6e 6f 74 20 |er and w|ill not |
|00001af0| 73 65 74 20 74 68 65 20 | 6d 61 72 6b 20 6f 72 20 |set the |mark or |
|00001b00| 70 72 69 6e 74 20 61 6e | 79 74 68 69 6e 67 2e 1f |print an|ything..|
|00001b10| 0a 28 64 65 66 61 6c 69 | 61 73 20 27 72 65 70 6c |.(defali|as 'repl|
|00001b20| 61 63 65 2d 72 65 67 65 | 78 70 20 23 5b 28 72 65 |ace-rege|xp #[(re|
|00001b30| 67 65 78 70 20 74 6f 2d | 73 74 72 69 6e 67 20 26 |gexp to-|string &|
|00001b40| 6f 70 74 69 6f 6e 61 6c | 20 64 65 6c 69 6d 69 74 |optional| delimit|
|00001b50| 65 64 29 20 22 c0 09 5c | 6e c3 c4 0d 25 87 22 20 |ed) "..\|n...%." |
|00001b60| 5b 70 65 72 66 6f 72 6d | 2d 72 65 70 6c 61 63 65 |[perform|-replace|
|00001b70| 20 72 65 67 65 78 70 20 | 74 6f 2d 73 74 72 69 6e | regexp |to-strin|
|00001b80| 67 20 6e 69 6c 20 74 20 | 64 65 6c 69 6d 69 74 65 |g nil t |delimite|
|00001b90| 64 5d 20 36 20 28 23 24 | 20 2e 20 35 39 33 32 29 |d] 6 (#$| . 5932)|
|00001ba0| 20 28 71 75 65 72 79 2d | 72 65 70 6c 61 63 65 2d | (query-|replace-|
|00001bb0| 72 65 61 64 2d 61 72 67 | 73 20 22 52 65 70 6c 61 |read-arg|s "Repla|
|00001bc0| 63 65 20 72 65 67 65 78 | 70 22 20 74 29 5d 29 0a |ce regex|p" t)]).|
|00001bd0| 23 40 36 33 20 48 69 73 | 74 6f 72 79 20 6c 69 73 |#@63 His|tory lis|
|00001be0| 74 20 66 6f 72 20 73 6f | 6d 65 20 63 6f 6d 6d 61 |t for so|me comma|
|00001bf0| 6e 64 73 20 74 68 61 74 | 20 72 65 61 64 20 72 65 |nds that| read re|
|00001c00| 67 75 6c 61 72 20 65 78 | 70 72 65 73 73 69 6f 6e |gular ex|pression|
|00001c10| 73 2e 1f 0a 28 64 65 66 | 76 61 72 20 72 65 67 65 |s...(def|var rege|
|00001c20| 78 70 2d 68 69 73 74 6f | 72 79 20 6e 69 6c 20 28 |xp-histo|ry nil (|
|00001c30| 23 24 20 2e 20 37 31 32 | 35 29 29 0a 28 64 65 66 |#$ . 712|5)).(def|
|00001c40| 69 6e 65 2d 66 75 6e 63 | 74 69 6f 6e 20 27 6b 65 |ine-func|tion 'ke|
|00001c50| 65 70 2d 6c 69 6e 65 73 | 20 27 64 65 6c 65 74 65 |ep-lines| 'delete|
|00001c60| 2d 6e 6f 6e 2d 6d 61 74 | 63 68 69 6e 67 2d 6c 69 |-non-mat|ching-li|
|00001c70| 6e 65 73 29 0a 23 40 31 | 35 39 20 44 65 6c 65 74 |nes).#@1|59 Delet|
|00001c80| 65 20 61 6c 6c 20 6c 69 | 6e 65 73 20 65 78 63 65 |e all li|nes exce|
|00001c90| 70 74 20 74 68 6f 73 65 | 20 63 6f 6e 74 61 69 6e |pt those| contain|
|00001ca0| 69 6e 67 20 6d 61 74 63 | 68 65 73 20 66 6f 72 20 |ing matc|hes for |
|00001cb0| 52 45 47 45 58 50 2e 0a | 41 20 6d 61 74 63 68 20 |REGEXP..|A match |
|00001cc0| 73 70 6c 69 74 20 61 63 | 72 6f 73 73 20 6c 69 6e |split ac|ross lin|
|00001cd0| 65 73 20 70 72 65 73 65 | 72 76 65 73 20 61 6c 6c |es prese|rves all|
|00001ce0| 20 74 68 65 20 6c 69 6e | 65 73 20 69 74 20 6c 69 | the lin|es it li|
|00001cf0| 65 73 20 69 6e 2e 0a 41 | 70 70 6c 69 65 73 20 74 |es in..A|pplies t|
|00001d00| 6f 20 61 6c 6c 20 6c 69 | 6e 65 73 20 61 66 74 65 |o all li|nes afte|
|00001d10| 72 20 70 6f 69 6e 74 2e | 1f 0a 28 64 65 66 61 6c |r point.|..(defal|
|00001d20| 69 61 73 20 27 64 65 6c | 65 74 65 2d 6e 6f 6e 2d |ias 'del|ete-non-|
|00001d30| 6d 61 74 63 68 69 6e 67 | 2d 6c 69 6e 65 73 20 23 |matching|-lines #|
|00001d40| 5b 28 72 65 67 65 78 70 | 29 20 22 8a 6e ac 83 c0 |[(regexp|) ".n...|
|00001d50| 79 88 60 19 6d 3f ad bb | c2 0b c4 c5 23 ac 86 09 |y.`.m?..|....#...|
|00001d60| 64 7c 88 aa 98 8a c6 94 | 62 88 c6 79 88 60 29 1e |d|......|b..y.`).|
|00001d70| 07 09 0e 07 57 ab 85 09 | 0e 07 7c 88 29 8a c0 79 |....W...|..|.)..y|
|00001d80| 88 60 29 11 6d ac 4d c6 | 94 c6 95 55 ab 46 c0 75 |.`).m.M.|...U.F.u|
|00001d90| 88 aa 41 2a 87 22 20 5b | 31 20 73 74 61 72 74 20 |..A*." [|1 start |
|00001da0| 72 65 2d 73 65 61 72 63 | 68 2d 66 6f 72 77 61 72 |re-searc|h-forwar|
|00001db0| 64 20 72 65 67 65 78 70 | 20 6e 69 6c 20 6d 6f 76 |d regexp| nil mov|
|00001dc0| 65 20 30 20 65 6e 64 5d | 20 34 20 28 23 24 20 2e |e 0 end]| 4 (#$ .|
|00001dd0| 20 37 32 39 31 29 20 28 | 6c 69 73 74 20 28 72 65 | 7291) (|list (re|
|00001de0| 61 64 2d 66 72 6f 6d 2d | 6d 69 6e 69 62 75 66 66 |ad-from-|minibuff|
|00001df0| 65 72 20 22 4b 65 65 70 | 20 6c 69 6e 65 73 20 28 |er "Keep| lines (|
|00001e00| 63 6f 6e 74 61 69 6e 69 | 6e 67 20 6d 61 74 63 68 |containi|ng match|
|00001e10| 20 66 6f 72 20 72 65 67 | 65 78 70 29 3a 20 22 20 | for reg|exp): " |
|00001e20| 6e 69 6c 20 6e 69 6c 20 | 6e 69 6c 20 27 72 65 67 |nil nil |nil 'reg|
|00001e30| 65 78 70 2d 68 69 73 74 | 6f 72 79 29 29 5d 29 0a |exp-hist|ory))]).|
|00001e40| 28 64 65 66 69 6e 65 2d | 66 75 6e 63 74 69 6f 6e |(define-|function|
|00001e50| 20 27 66 6c 75 73 68 2d | 6c 69 6e 65 73 20 27 64 | 'flush-|lines 'd|
|00001e60| 65 6c 65 74 65 2d 6d 61 | 74 63 68 69 6e 67 2d 6c |elete-ma|tching-l|
|00001e70| 69 6e 65 73 29 0a 23 40 | 31 34 37 20 44 65 6c 65 |ines).#@|147 Dele|
|00001e80| 74 65 20 6c 69 6e 65 73 | 20 63 6f 6e 74 61 69 6e |te lines| contain|
|00001e90| 69 6e 67 20 6d 61 74 63 | 68 65 73 20 66 6f 72 20 |ing matc|hes for |
|00001ea0| 52 45 47 45 58 50 2e 0a | 49 66 20 61 20 6d 61 74 |REGEXP..|If a mat|
|00001eb0| 63 68 20 69 73 20 73 70 | 6c 69 74 20 61 63 72 6f |ch is sp|lit acro|
|00001ec0| 73 73 20 6c 69 6e 65 73 | 2c 20 61 6c 6c 20 74 68 |ss lines|, all th|
|00001ed0| 65 20 6c 69 6e 65 73 20 | 69 74 20 6c 69 65 73 20 |e lines |it lies |
|00001ee0| 69 6e 20 61 72 65 20 64 | 65 6c 65 74 65 64 2e 0a |in are d|eleted..|
|00001ef0| 41 70 70 6c 69 65 73 20 | 74 6f 20 6c 69 6e 65 73 |Applies |to lines|
|00001f00| 20 61 66 74 65 72 20 70 | 6f 69 6e 74 2e 1f 0a 28 | after p|oint...(|
|00001f10| 64 65 66 61 6c 69 61 73 | 20 27 64 65 6c 65 74 65 |defalias| 'delete|
|00001f20| 2d 6d 61 74 63 68 69 6e | 67 2d 6c 69 6e 65 73 20 |-matchin|g-lines |
|00001f30| 23 5b 28 72 65 67 65 78 | 70 29 20 22 8a 6d 3f ad |#[(regex|p) ".m?.|
|00001f40| 99 c0 09 c2 c3 23 ad 92 | 8a c4 94 62 88 c4 79 88 |.....#..|...b..y.|
|00001f50| 60 29 c5 79 88 60 7c 88 | aa 63 29 87 22 20 5b 72 |`).y.`|.|.c)." [r|
|00001f60| 65 2d 73 65 61 72 63 68 | 2d 66 6f 72 77 61 72 64 |e-search|-forward|
|00001f70| 20 72 65 67 65 78 70 20 | 6e 69 6c 20 74 20 30 20 | regexp |nil t 0 |
|00001f80| 31 5d 20 34 20 28 23 24 | 20 2e 20 37 38 30 34 29 |1] 4 (#$| . 7804)|
|00001f90| 20 28 6c 69 73 74 20 28 | 72 65 61 64 2d 66 72 6f | (list (|read-fro|
|00001fa0| 6d 2d 6d 69 6e 69 62 75 | 66 66 65 72 20 22 46 6c |m-minibu|ffer "Fl|
|00001fb0| 75 73 68 20 6c 69 6e 65 | 73 20 28 63 6f 6e 74 61 |ush line|s (conta|
|00001fc0| 69 6e 69 6e 67 20 6d 61 | 74 63 68 20 66 6f 72 20 |ining ma|tch for |
|00001fd0| 72 65 67 65 78 70 29 3a | 20 22 20 6e 69 6c 20 6e |regexp):| " nil n|
|00001fe0| 69 6c 20 6e 69 6c 20 27 | 72 65 67 65 78 70 2d 68 |il nil '|regexp-h|
|00001ff0| 69 73 74 6f 72 79 29 29 | 5d 29 0a 28 64 65 66 69 |istory))|]).(defi|
|00002000| 6e 65 2d 66 75 6e 63 74 | 69 6f 6e 20 27 68 6f 77 |ne-funct|ion 'how|
|00002010| 2d 6d 61 6e 79 20 27 63 | 6f 75 6e 74 2d 6d 61 74 |-many 'c|ount-mat|
|00002020| 63 68 65 73 29 0a 23 40 | 35 33 20 50 72 69 6e 74 |ches).#@|53 Print|
|00002030| 20 6e 75 6d 62 65 72 20 | 6f 66 20 6d 61 74 63 68 | number |of match|
|00002040| 65 73 20 66 6f 72 20 52 | 45 47 45 58 50 20 66 6f |es for R|EGEXP fo|
|00002050| 6c 6c 6f 77 69 6e 67 20 | 70 6f 69 6e 74 2e 1f 0a |llowing |point...|
|00002060| 28 64 65 66 61 6c 69 61 | 73 20 27 63 6f 75 6e 74 |(defalia|s 'count|
|00002070| 2d 6d 61 74 63 68 65 73 | 20 23 5b 28 72 65 67 65 |-matches| #[(rege|
|00002080| 78 70 29 20 22 c0 c1 1a | 1b 8a 6d ac 98 60 12 c4 |xp) "...|..m..`..|
|00002090| 0d c1 c6 23 ab 8f 5c 6e | 60 55 ab 85 c7 75 88 aa |...#..\n|`U...u..|
|000020a0| 6a 0b 54 13 aa 65 c8 c9 | 0b 5c 22 2b 87 22 20 5b |j.T..e..|.\"+." [|
|000020b0| 30 20 6e 69 6c 20 6f 70 | 6f 69 6e 74 20 63 6f 75 |0 nil op|oint cou|
|000020c0| 6e 74 20 72 65 2d 73 65 | 61 72 63 68 2d 66 6f 72 |nt re-se|arch-for|
|000020d0| 77 61 72 64 20 72 65 67 | 65 78 70 20 74 20 31 20 |ward reg|exp t 1 |
|000020e0| 6d 65 73 73 61 67 65 20 | 22 25 64 20 6f 63 63 75 |message |"%d occu|
|000020f0| 72 72 65 6e 63 65 73 22 | 5d 20 34 20 28 23 24 20 |rrences"|] 4 (#$ |
|00002100| 2e 20 38 32 33 35 29 20 | 28 6c 69 73 74 20 28 72 |. 8235) |(list (r|
|00002110| 65 61 64 2d 66 72 6f 6d | 2d 6d 69 6e 69 62 75 66 |ead-from|-minibuf|
|00002120| 66 65 72 20 22 48 6f 77 | 20 6d 61 6e 79 20 6d 61 |fer "How| many ma|
|00002130| 74 63 68 65 73 20 66 6f | 72 20 28 72 65 67 65 78 |tches fo|r (regex|
|00002140| 70 29 3a 20 22 20 6e 69 | 6c 20 6e 69 6c 20 6e 69 |p): " ni|l nil ni|
|00002150| 6c 20 27 72 65 67 65 78 | 70 2d 68 69 73 74 6f 72 |l 'regex|p-histor|
|00002160| 79 29 29 5d 29 0a 28 62 | 79 74 65 2d 63 6f 64 65 |y))]).(b|yte-code|
|00002170| 20 22 c0 c1 21 ac 82 c2 | 11 c1 0b 42 13 09 ac 9a | "..!...|...B....|
|00002180| c4 20 11 c5 09 c1 5c 22 | 88 c6 09 c7 c8 23 88 c6 |. ....\"|.....#..|
|00002190| 09 c9 ca 23 88 c6 09 cb | ca 23 88 c0 cc 21 ac 83 |...#....|.#...!..|
|000021a0| c2 16 0c cc 0b 42 13 c0 | cd 21 ac 83 c2 16 0d cd |.....B..|.!......|
|000021b0| 0b 42 13 c0 ce 21 ac 83 | c2 16 0e ce 0b 42 13 c2 |.B...!..|.....B..|
|000021c0| 87 22 20 5b 62 6f 75 6e | 64 70 20 6f 63 63 75 72 |." [boun|dp occur|
|000021d0| 2d 6d 6f 64 65 2d 6d 61 | 70 20 6e 69 6c 20 63 75 |-mode-ma|p nil cu|
|000021e0| 72 72 65 6e 74 2d 6c 6f | 61 64 2d 6c 69 73 74 20 |rrent-lo|ad-list |
|000021f0| 6d 61 6b 65 2d 73 70 61 | 72 73 65 2d 6b 65 79 6d |make-spa|rse-keym|
|00002200| 61 70 20 73 65 74 2d 6b | 65 79 6d 61 70 2d 6e 61 |ap set-k|eymap-na|
|00002210| 6d 65 20 64 65 66 69 6e | 65 2d 6b 65 79 20 62 75 |me defin|e-key bu|
|00002220| 74 74 6f 6e 32 20 6f 63 | 63 75 72 2d 6d 6f 64 65 |tton2 oc|cur-mode|
|00002230| 2d 6d 6f 75 73 65 2d 67 | 6f 74 6f 20 22 03 03 22 |-mouse-g|oto ".."|
|00002240| 20 6f 63 63 75 72 2d 6d | 6f 64 65 2d 67 6f 74 6f | occur-m|ode-goto|
|00002250| 2d 6f 63 63 75 72 72 65 | 6e 63 65 20 22 0d 22 20 |-occurre|nce "." |
|00002260| 6f 63 63 75 72 2d 62 75 | 66 66 65 72 20 6f 63 63 |occur-bu|ffer occ|
|00002270| 75 72 2d 6e 6c 69 6e 65 | 73 20 6f 63 63 75 72 2d |ur-nline|s occur-|
|00002280| 70 6f 73 2d 6c 69 73 74 | 5d 20 34 29 0a 23 40 32 |pos-list|] 4).#@2|
|00002290| 37 39 20 4d 61 6a 6f 72 | 20 6d 6f 64 65 20 66 6f |79 Major| mode fo|
|000022a0| 72 20 6f 75 74 70 75 74 | 20 66 72 6f 6d 20 5c 5b |r output| from \[|
|000022b0| 6f 63 63 75 72 5d 2e 0a | 5c 3c 6f 63 63 75 72 2d |occur]..|\<occur-|
|000022c0| 6d 6f 64 65 2d 6d 61 70 | 3e 4d 6f 76 65 20 70 6f |mode-map|>Move po|
|000022d0| 69 6e 74 20 74 6f 20 6f | 6e 65 20 6f 66 20 74 68 |int to o|ne of th|
|000022e0| 65 20 69 74 65 6d 73 20 | 69 6e 20 74 68 69 73 20 |e items |in this |
|000022f0| 62 75 66 66 65 72 2c 20 | 74 68 65 6e 20 75 73 65 |buffer, |then use|
|00002300| 0a 5c 5b 6f 63 63 75 72 | 2d 6d 6f 64 65 2d 67 6f |.\[occur|-mode-go|
|00002310| 74 6f 2d 6f 63 63 75 72 | 72 65 6e 63 65 5d 20 74 |to-occur|rence] t|
|00002320| 6f 20 67 6f 20 74 6f 20 | 74 68 65 20 6f 63 63 75 |o go to |the occu|
|00002330| 72 72 65 6e 63 65 20 74 | 68 61 74 20 74 68 65 20 |rrence t|hat the |
|00002340| 69 74 65 6d 20 72 65 66 | 65 72 73 20 74 6f 2e 0a |item ref|ers to..|
|00002350| 41 6c 74 65 72 6e 61 74 | 69 76 65 6c 79 2c 20 63 |Alternat|ively, c|
|00002360| 6c 69 63 6b 20 5c 5b 6f | 63 63 75 72 2d 6d 6f 64 |lick \[o|ccur-mod|
|00002370| 65 2d 6d 6f 75 73 65 2d | 67 6f 74 6f 5d 20 6f 6e |e-mouse-|goto] on|
|00002380| 20 61 6e 20 69 74 65 6d | 20 74 6f 20 67 6f 20 74 | an item| to go t|
|00002390| 6f 20 69 74 2e 0a 0a 5c | 7b 6f 63 63 75 72 2d 6d |o it...\|{occur-m|
|000023a0| 6f 64 65 2d 6d 61 70 7d | 1f 0a 28 64 65 66 61 6c |ode-map}|..(defal|
|000023b0| 69 61 73 20 27 6f 63 63 | 75 72 2d 6d 6f 64 65 20 |ias 'occ|ur-mode |
|000023c0| 23 5b 6e 69 6c 20 22 c0 | 20 88 c1 5c 6e 21 88 c3 |#[nil ".| ..\n!..|
|000023d0| 14 c5 c6 21 16 07 c8 c9 | 21 88 c8 ca 21 88 c8 cb |...!....|!...!...|
|000023e0| 21 88 cc cd 21 88 ce 16 | 0f d0 d1 21 87 22 20 5b |!...!...|...!." [|
|000023f0| 6b 69 6c 6c 2d 61 6c 6c | 2d 6c 6f 63 61 6c 2d 76 |kill-all|-local-v|
|00002400| 61 72 69 61 62 6c 65 73 | 20 75 73 65 2d 6c 6f 63 |ariables| use-loc|
|00002410| 61 6c 2d 6d 61 70 20 6f | 63 63 75 72 2d 6d 6f 64 |al-map o|ccur-mod|
|00002420| 65 2d 6d 61 70 20 6f 63 | 63 75 72 2d 6d 6f 64 65 |e-map oc|cur-mode|
|00002430| 20 6d 61 6a 6f 72 2d 6d | 6f 64 65 20 67 65 74 74 | major-m|ode gett|
|00002440| 65 78 74 20 22 4f 63 63 | 75 72 22 20 6d 6f 64 65 |ext "Occ|ur" mode|
|00002450| 2d 6e 61 6d 65 20 6d 61 | 6b 65 2d 6c 6f 63 61 6c |-name ma|ke-local|
|00002460| 2d 76 61 72 69 61 62 6c | 65 20 6f 63 63 75 72 2d |-variabl|e occur-|
|00002470| 62 75 66 66 65 72 20 6f | 63 63 75 72 2d 6e 6c 69 |buffer o|ccur-nli|
|00002480| 6e 65 73 20 6f 63 63 75 | 72 2d 70 6f 73 2d 6c 69 |nes occu|r-pos-li|
|00002490| 73 74 20 72 65 71 75 69 | 72 65 20 6d 6f 64 65 2d |st requi|re mode-|
|000024a0| 6d 6f 74 69 6f 6e 20 6d | 6f 64 65 2d 6d 6f 74 69 |motion m|ode-moti|
|000024b0| 6f 6e 2d 68 69 67 68 6c | 69 67 68 74 2d 6c 69 6e |on-highl|ight-lin|
|000024c0| 65 20 6d 6f 64 65 2d 6d | 6f 74 69 6f 6e 2d 68 6f |e mode-m|otion-ho|
|000024d0| 6f 6b 20 72 75 6e 2d 68 | 6f 6f 6b 73 20 6f 63 63 |ok run-h|ooks occ|
|000024e0| 75 72 2d 6d 6f 64 65 2d | 68 6f 6f 6b 5d 20 32 20 |ur-mode-|hook] 2 |
|000024f0| 28 23 24 20 2e 20 38 38 | 35 31 29 5d 29 0a 23 40 |(#$ . 88|51)]).#@|
|00002500| 31 32 33 20 47 6f 20 74 | 6f 20 74 68 65 20 6f 63 |123 Go t|o the oc|
|00002510| 63 75 72 72 65 6e 63 65 | 20 68 69 67 68 6c 69 67 |currence| highlig|
|00002520| 68 74 65 64 20 62 79 20 | 6d 6f 75 73 65 2e 0a 54 |hted by |mouse..T|
|00002530| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 20 69 73 20 |his func|tion is |
|00002540| 6f 6e 6c 79 20 72 65 61 | 73 6f 6e 61 62 6c 65 20 |only rea|sonable |
|00002550| 77 68 65 6e 20 62 6f 75 | 6e 64 20 74 6f 20 61 20 |when bou|nd to a |
|00002560| 6d 6f 75 73 65 20 6b 65 | 79 20 69 6e 20 74 68 65 |mouse ke|y in the|
|00002570| 20 6f 63 63 75 72 20 62 | 75 66 66 65 72 1f 0a 28 | occur b|uffer..(|
|00002580| 64 65 66 61 6c 69 61 73 | 20 27 6f 63 63 75 72 2d |defalias| 'occur-|
|00002590| 6d 6f 64 65 2d 6d 6f 75 | 73 65 2d 67 6f 74 6f 20 |mode-mou|se-goto |
|000025a0| 23 5b 28 65 76 65 6e 74 | 29 20 22 c0 20 c1 20 1a |#[(event|) ". . .|
|000025b0| 1b c4 8e c5 0e 06 21 88 | c7 20 2b 87 22 20 5b 73 |......!.|. +." [s|
|000025c0| 65 6c 65 63 74 65 64 2d | 77 69 6e 64 6f 77 20 73 |elected-|window s|
|000025d0| 65 6c 65 63 74 65 64 2d | 66 72 61 6d 65 20 66 72 |elected-|frame fr|
|000025e0| 61 6d 65 2d 73 61 76 65 | 20 77 69 6e 64 6f 77 2d |ame-save| window-|
|000025f0| 73 61 76 65 20 28 28 62 | 79 74 65 2d 63 6f 64 65 |save ((b|yte-code|
|00002600| 20 22 c0 09 21 88 c2 0b | 21 87 22 20 5b 73 65 6c | "..!...|!." [sel|
|00002610| 65 63 74 2d 66 72 61 6d | 65 20 66 72 61 6d 65 2d |ect-fram|e frame-|
|00002620| 73 61 76 65 20 73 65 6c | 65 63 74 2d 77 69 6e 64 |save sel|ect-wind|
|00002630| 6f 77 20 77 69 6e 64 6f | 77 2d 73 61 76 65 5d 20 |ow windo|w-save] |
|00002640| 32 29 29 20 6d 6f 75 73 | 65 2d 73 65 74 2d 70 6f |2)) mous|e-set-po|
|00002650| 69 6e 74 20 65 76 65 6e | 74 20 6f 63 63 75 72 2d |int even|t occur-|
|00002660| 6d 6f 64 65 2d 67 6f 74 | 6f 2d 6f 63 63 75 72 72 |mode-got|o-occurr|
|00002670| 65 6e 63 65 5d 20 32 20 | 28 23 24 20 2e 20 39 34 |ence] 2 |(#$ . 94|
|00002680| 37 36 29 20 22 65 22 5d | 29 0a 23 40 35 30 20 47 |76) "e"]|).#@50 G|
|00002690| 6f 20 74 6f 20 74 68 65 | 20 6f 63 63 75 72 72 65 |o to the| occurre|
|000026a0| 6e 63 65 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 |nce the |current |
|000026b0| 6c 69 6e 65 20 64 65 73 | 63 72 69 62 65 73 2e 1f |line des|cribes..|
|000026c0| 0a 28 64 65 66 61 6c 69 | 61 73 20 27 6f 63 63 75 |.(defali|as 'occu|
|000026d0| 72 2d 6d 6f 64 65 2d 67 | 6f 74 6f 2d 6f 63 63 75 |r-mode-g|oto-occu|
|000026e0| 72 72 65 6e 63 65 20 23 | 5b 6e 69 6c 20 22 08 ab |rrence #|[nil "..|
|000026f0| 85 c1 08 21 ac 88 c2 10 | c2 13 c4 c5 21 88 c6 65 |...!....|....!..e|
|00002700| 8a c7 79 88 60 29 5c 22 | 1e 08 8a c7 79 88 0e 08 |..y.`)\"|....y...|
|00002710| 53 0e 09 c7 57 ab 86 ca | 0e 09 5a aa 8f 0e 09 c7 |S...W...|..Z.....|
|00002720| 56 ab 88 0e 09 89 5c 5c | ca 5c 5c aa 81 cb a5 29 |V.....\\|.\\....)|
|00002730| 89 1e 0c 0b 38 1e 0d ce | 08 21 1e 0f 08 1e 10 0e |....8...|.!......|
|00002740| 08 cb 57 ab 84 c4 d1 21 | 88 0e 0d ac 84 c4 d1 21 |..W....!|.......!|
|00002750| 88 0e 0f ab 93 d2 0e 0f | 21 ab 8d d3 d4 0e 0f 21 |........|!......!|
|00002760| 21 ab 85 0e 10 71 ac 8c | d5 0e 10 21 ab 86 ce 0e |!....q..|...!....|
|00002770| 10 21 16 0f 0e 0d 62 88 | d6 0e 0f 0e 0d 5c 22 2d |.!....b.|.....\"-|
|00002780| 87 22 20 5b 6f 63 63 75 | 72 2d 62 75 66 66 65 72 |." [occu|r-buffer|
|00002790| 20 62 75 66 66 65 72 2d | 6e 61 6d 65 20 6e 69 6c | buffer-|name nil|
|000027a0| 20 6f 63 63 75 72 2d 70 | 6f 73 2d 6c 69 73 74 20 | occur-p|os-list |
|000027b0| 65 72 72 6f 72 20 22 42 | 75 66 66 65 72 20 69 6e |error "B|uffer in|
|000027c0| 20 77 68 69 63 68 20 6f | 63 63 75 72 72 65 6e 63 | which o|ccurrenc|
|000027d0| 65 73 20 77 65 72 65 20 | 66 6f 75 6e 64 20 69 73 |es were |found is|
|000027e0| 20 64 65 6c 65 74 65 64 | 22 20 63 6f 75 6e 74 2d | deleted|" count-|
|000027f0| 6c 69 6e 65 73 20 30 20 | 6c 69 6e 65 2d 63 6f 75 |lines 0 |line-cou|
|00002800| 6e 74 20 6f 63 63 75 72 | 2d 6e 6c 69 6e 65 73 20 |nt occur|-nlines |
|00002810| 32 20 31 20 6f 63 63 75 | 72 2d 6e 75 6d 62 65 72 |2 1 occu|r-number|
|00002820| 20 70 6f 73 20 67 65 74 | 2d 62 75 66 66 65 72 2d | pos get|-buffer-|
|00002830| 77 69 6e 64 6f 77 20 77 | 69 6e 64 6f 77 20 6f 63 |window w|indow oc|
|00002840| 63 75 72 2d 73 6f 75 72 | 63 65 2d 62 75 66 66 65 |cur-sour|ce-buffe|
|00002850| 72 20 22 4e 6f 20 6f 63 | 63 75 72 72 65 6e 63 65 |r "No oc|currence|
|00002860| 20 6f 6e 20 74 68 69 73 | 20 6c 69 6e 65 22 20 77 | on this| line" w|
|00002870| 69 6e 64 6f 77 2d 6c 69 | 76 65 2d 70 20 66 72 61 |indow-li|ve-p fra|
|00002880| 6d 65 2d 76 69 73 69 62 | 6c 65 2d 70 20 77 69 6e |me-visib|le-p win|
|00002890| 64 6f 77 2d 66 72 61 6d | 65 20 70 6f 70 2d 74 6f |dow-fram|e pop-to|
|000028a0| 2d 62 75 66 66 65 72 20 | 73 65 74 2d 77 69 6e 64 |-buffer |set-wind|
|000028b0| 6f 77 2d 70 6f 69 6e 74 | 5d 20 34 20 28 23 24 20 |ow-point|] 4 (#$ |
|000028c0| 2e 20 39 38 37 31 29 20 | 6e 69 6c 5d 29 0a 23 40 |. 9871) |nil]).#@|
|000028d0| 32 32 37 20 2a 44 65 66 | 61 75 6c 74 20 6e 75 6d |227 *Def|ault num|
|000028e0| 62 65 72 20 6f 66 20 63 | 6f 6e 74 65 78 74 20 6c |ber of c|ontext l|
|000028f0| 69 6e 65 73 20 74 6f 20 | 69 6e 63 6c 75 64 65 20 |ines to |include |
|00002900| 61 72 6f 75 6e 64 20 61 | 20 60 6c 69 73 74 2d 6d |around a| `list-m|
|00002910| 61 74 63 68 69 6e 67 2d | 6c 69 6e 65 73 27 0a 6d |atching-|lines'.m|
|00002920| 61 74 63 68 2e 20 20 41 | 20 6e 65 67 61 74 69 76 |atch. A| negativ|
|00002930| 65 20 6e 75 6d 62 65 72 | 20 6d 65 61 6e 73 20 74 |e number| means t|
|00002940| 6f 20 69 6e 63 6c 75 64 | 65 20 74 68 61 74 20 6d |o includ|e that m|
|00002950| 61 6e 79 20 6c 69 6e 65 | 73 20 62 65 66 6f 72 65 |any line|s before|
|00002960| 20 74 68 65 20 6d 61 74 | 63 68 2e 0a 41 20 70 6f | the mat|ch..A po|
|00002970| 73 69 74 69 76 65 20 6e | 75 6d 62 65 72 20 6d 65 |sitive n|umber me|
|00002980| 61 6e 73 20 74 6f 20 69 | 6e 63 6c 75 64 65 20 74 |ans to i|nclude t|
|00002990| 68 61 74 20 6d 61 6e 79 | 20 6c 69 6e 65 73 20 62 |hat many| lines b|
|000029a0| 6f 74 68 20 62 65 66 6f | 72 65 20 61 6e 64 20 61 |oth befo|re and a|
|000029b0| 66 74 65 72 2e 1f 0a 28 | 64 65 66 76 61 72 20 6c |fter...(|defvar l|
|000029c0| 69 73 74 2d 6d 61 74 63 | 68 69 6e 67 2d 6c 69 6e |ist-matc|hing-lin|
|000029d0| 65 73 2d 64 65 66 61 75 | 6c 74 2d 63 6f 6e 74 65 |es-defau|lt-conte|
|000029e0| 78 74 2d 6c 69 6e 65 73 | 20 30 20 28 23 24 20 2e |xt-lines| 0 (#$ .|
|000029f0| 20 2d 31 30 34 35 32 29 | 29 0a 23 40 38 38 20 49 | -10452)|).#@88 I|
|00002a00| 66 20 74 2c 20 6f 63 63 | 75 72 20 6f 70 65 72 61 |f t, occ|ur opera|
|00002a10| 74 65 73 20 6f 6e 20 77 | 68 6f 6c 65 20 62 75 66 |tes on w|hole buf|
|00002a20| 66 65 72 2c 20 6f 74 68 | 65 72 77 69 73 65 20 6f |fer, oth|erwise o|
|00002a30| 63 63 75 72 20 73 74 61 | 72 74 73 20 66 72 6f 6d |ccur sta|rts from|
|00002a40| 20 70 6f 69 6e 74 2e 0a | 64 65 66 61 75 6c 74 20 | point..|default |
|00002a50| 69 73 20 74 2e 1f 0a 28 | 64 65 66 76 61 72 20 6c |is t...(|defvar l|
|00002a60| 69 73 74 2d 6d 61 74 63 | 68 69 6e 67 2d 6c 69 6e |ist-matc|hing-lin|
|00002a70| 65 73 2d 77 68 6f 6c 65 | 2d 62 75 66 66 65 72 20 |es-whole|-buffer |
|00002a80| 74 20 28 23 24 20 2e 20 | 31 30 37 35 31 29 29 0a |t (#$ . |10751)).|
|00002a90| 28 64 65 66 69 6e 65 2d | 66 75 6e 63 74 69 6f 6e |(define-|function|
|00002aa0| 20 27 6f 63 63 75 72 20 | 27 6c 69 73 74 2d 6d 61 | 'occur |'list-ma|
|00002ab0| 74 63 68 69 6e 67 2d 6c | 69 6e 65 73 29 0a 23 40 |tching-l|ines).#@|
|00002ac0| 36 33 32 20 53 68 6f 77 | 20 61 6c 6c 20 6c 69 6e |632 Show| all lin|
|00002ad0| 65 73 20 69 6e 20 74 68 | 65 20 63 75 72 72 65 6e |es in th|e curren|
|00002ae0| 74 20 62 75 66 66 65 72 | 20 63 6f 6e 74 61 69 6e |t buffer| contain|
|00002af0| 69 6e 67 20 61 20 6d 61 | 74 63 68 20 66 6f 72 20 |ing a ma|tch for |
|00002b00| 52 45 47 45 58 50 2e 0a | 0a 49 66 20 61 20 6d 61 |REGEXP..|.If a ma|
|00002b10| 74 63 68 20 73 70 72 65 | 61 64 73 20 61 63 72 6f |tch spre|ads acro|
|00002b20| 73 73 20 6d 75 6c 74 69 | 70 6c 65 20 6c 69 6e 65 |ss multi|ple line|
|00002b30| 73 2c 20 61 6c 6c 20 74 | 68 6f 73 65 20 6c 69 6e |s, all t|hose lin|
|00002b40| 65 73 20 61 72 65 20 73 | 68 6f 77 6e 2e 0a 0a 49 |es are s|hown...I|
|00002b50| 66 20 76 61 72 69 61 62 | 6c 65 20 60 6c 69 73 74 |f variab|le `list|
|00002b60| 2d 6d 61 74 63 68 69 6e | 67 2d 6c 69 6e 65 73 2d |-matchin|g-lines-|
|00002b70| 77 68 6f 6c 65 2d 62 75 | 66 66 65 72 27 20 69 73 |whole-bu|ffer' is|
|00002b80| 20 6e 6f 6e 2d 6e 69 6c | 2c 20 74 68 65 20 65 6e | non-nil|, the en|
|00002b90| 74 69 72 65 20 62 75 66 | 66 65 72 20 69 73 0a 73 |tire buf|fer is.s|
|00002ba0| 65 61 72 63 68 65 64 2c | 20 6f 74 68 65 72 77 69 |earched,| otherwi|
|00002bb0| 73 65 20 73 65 61 72 63 | 68 20 62 65 67 69 6e 73 |se searc|h begins|
|00002bc0| 20 61 74 20 70 6f 69 6e | 74 2e 0a 0a 45 61 63 68 | at poin|t...Each|
|00002bd0| 20 6c 69 6e 65 20 69 73 | 20 64 69 73 70 6c 61 79 | line is| display|
|00002be0| 65 64 20 77 69 74 68 20 | 4e 4c 49 4e 45 53 20 6c |ed with |NLINES l|
|00002bf0| 69 6e 65 73 20 62 65 66 | 6f 72 65 20 61 6e 64 20 |ines bef|ore and |
|00002c00| 61 66 74 65 72 2c 20 6f | 72 20 2d 4e 4c 49 4e 45 |after, o|r -NLINE|
|00002c10| 53 0a 62 65 66 6f 72 65 | 20 69 66 20 4e 4c 49 4e |S.before| if NLIN|
|00002c20| 45 53 20 69 73 20 6e 65 | 67 61 74 69 76 65 2e 0a |ES is ne|gative..|
|00002c30| 4e 4c 49 4e 45 53 20 64 | 65 66 61 75 6c 74 73 20 |NLINES d|efaults |
|00002c40| 74 6f 20 60 6c 69 73 74 | 2d 6d 61 74 63 68 69 6e |to `list|-matchin|
|00002c50| 67 2d 6c 69 6e 65 73 2d | 64 65 66 61 75 6c 74 2d |g-lines-|default-|
|00002c60| 63 6f 6e 74 65 78 74 2d | 6c 69 6e 65 73 27 2e 0a |context-|lines'..|
|00002c70| 49 6e 74 65 72 61 63 74 | 69 76 65 6c 79 20 69 74 |Interact|ively it|
|00002c80| 20 69 73 20 74 68 65 20 | 70 72 65 66 69 78 20 61 | is the |prefix a|
|00002c90| 72 67 2e 0a 0a 54 68 65 | 20 6c 69 6e 65 73 20 61 |rg...The| lines a|
|00002ca0| 72 65 20 73 68 6f 77 6e | 20 69 6e 20 61 20 62 75 |re shown| in a bu|
|00002cb0| 66 66 65 72 20 6e 61 6d | 65 64 20 60 2a 4f 63 63 |ffer nam|ed `*Occ|
|00002cc0| 75 72 2a 27 2e 0a 49 74 | 20 73 65 72 76 65 73 20 |ur*'..It| serves |
|00002cd0| 61 73 20 61 20 6d 65 6e | 75 20 74 6f 20 66 69 6e |as a men|u to fin|
|00002ce0| 64 20 61 6e 79 20 6f 66 | 20 74 68 65 20 6f 63 63 |d any of| the occ|
|00002cf0| 75 72 72 65 6e 63 65 73 | 20 69 6e 20 74 68 69 73 |urrences| in this|
|00002d00| 20 62 75 66 66 65 72 2e | 0a 5c 5b 64 65 73 63 72 | buffer.|.\[descr|
|00002d10| 69 62 65 2d 6d 6f 64 65 | 5d 20 69 6e 20 74 68 61 |ibe-mode|] in tha|
|00002d20| 74 20 62 75 66 66 65 72 | 20 77 69 6c 6c 20 65 78 |t buffer| will ex|
|00002d30| 70 6c 61 69 6e 20 68 6f | 77 2e 1f 0a 28 64 65 66 |plain ho|w...(def|
|00002d40| 61 6c 69 61 73 20 27 6c | 69 73 74 2d 6d 61 74 63 |alias 'l|ist-matc|
|00002d50| 68 69 6e 67 2d 6c 69 6e | 65 73 20 23 5b 28 72 65 |hing-lin|es #[(re|
|00002d60| 67 65 78 70 20 26 6f 70 | 74 69 6f 6e 61 6c 20 6e |gexp &op|tional n|
|00002d70| 6c 69 6e 65 73 29 20 22 | 08 c1 6b ab 84 c2 c3 21 |lines) "|..k....!|
|00002d80| 88 0c ab 85 c5 0c 21 aa | 82 0e 06 14 c7 0e 08 70 |......!.|.......p|
|00002d90| c9 65 ca 20 1e 0b 1e 0c | 1e 0d 1e 0e 1e 0f 1e 10 |.e. ....|........|
|00002da0| 0e 11 ac 8f 8a d2 79 88 | d3 65 60 5c 22 54 16 0d |......y.|.e`\"T..|
|00002db0| 60 16 0c 29 d4 90 8a 0e | 15 71 88 0e 0f 16 08 c7 |`..)....|.q......|
|00002dc0| 1e 16 d7 d8 08 d9 0e 0e | 21 23 63 88 29 da 20 88 |........|!#c.). .|
|00002dd0| 0e 0e 16 1b 0c 16 1c dd | 16 1e 29 0e 0e 0e 15 61 |........|..)....a|
|00002de0| ab 83 64 62 88 8a 0e 11 | ab 83 df 20 88 e0 e1 08 |..db....|... ....|
|00002df0| 5c 22 88 0e 0c 64 55 84 | a9 01 e2 08 dd c7 23 83 |\"...dU.|......#.|
|00002e00| a9 01 d2 94 62 88 d2 79 | 88 e3 20 1e 24 e5 8e 0e |....b..y|.. .$...|
|00002e10| 0d d3 0e 0c 60 5c 22 5c | 5c 16 0d 2a 60 16 0c d2 |....`\"\|\..*`...|
|00002e20| 95 62 88 8a d2 94 62 88 | 0c d2 57 ab 83 0c aa 82 |.b....b.|..W.....|
|00002e30| 0c 5b 79 88 60 29 1e 26 | 8a d2 95 62 88 0c d2 56 |.[y.`).&|...b...V|
|00002e40| ab 86 0c 54 79 88 aa 83 | c9 79 88 60 29 1e 27 d7 |...Ty...|.y.`).'.|
|00002e50| e8 0e 0d 5c 22 1e 29 ea | 0e 29 47 eb 5c 22 1e 2c |...\".).|.)G.\".,|
|00002e60| dd 1e 2d 8a ca 20 89 16 | 2d 60 dd 93 88 0e 15 71 |..-.. ..|-`.....q|
|00002e70| 88 0e 2d 0e 1e 42 16 1e | 0e 10 ac 88 ee 0c 21 ac |..-..B..|......!.|
|00002e80| 83 ef 63 88 dd 16 10 f0 | 0e 0e 0e 26 0e 27 23 88 |..c.....|...&.'#.|
|00002e90| 0e 0b 60 0e 27 d2 95 5a | 5a dd 93 88 f1 0e 27 0e |..`.'..Z|Z.....'.|
|00002ea0| 26 5a 21 88 0c d2 57 ab | 84 0c 5b aa 81 0c 89 16 |&Z!...W.|..[.....|
|00002eb0| 2d d2 56 ab 91 0e 2c f2 | b1 02 88 c9 79 88 0e 2d |-.V...,.|....y..-|
|00002ec0| 53 89 16 2d aa 6b 0e 0d | 1e 33 60 0e 0b 57 ab 9e |S..-.k..|.3`..W..|
|00002ed0| 0e 29 ac 87 d7 e8 0e 33 | 5c 22 16 29 0e 29 f2 b1 |.).....3|\".).)..|
|00002ee0| 02 88 c9 79 88 dd 16 29 | 0e 33 54 16 33 aa 5c 5c |...y...)|.3T.3.\\|
|00002ef0| 60 0e 0b 58 ab 90 0e 2c | f2 b1 02 88 c9 79 88 0e |`..X...,|.....y..|
|00002f00| 33 54 16 33 aa 6a 29 0e | 2d 0c 57 ab 91 0e 2c f2 |3T.3.j).|-.W...,.|
|00002f10| b1 02 88 c9 79 88 0e 2d | 54 89 16 2d aa 6b 64 62 |....y..-|T..-.kdb|
|00002f20| 88 29 c9 79 88 2d 82 79 | 00 0e 15 71 88 0e 1e 9f |.).y.-.y|...q....|
|00002f30| 16 1e 65 62 88 0e 1e 47 | c9 55 ab 85 f4 63 88 aa |..eb...G|.U...c..|
|00002f40| 88 d7 f5 0e 1e 47 5c 22 | 63 88 74 ad 86 e0 f6 0e |.....G\"|c.t.....|
|00002f50| 1e 47 5c 22 29 91 2e 06 | 87 22 20 5b 72 65 67 65 |.G\")...|." [rege|
|00002f60| 78 70 20 22 22 20 65 72 | 72 6f 72 20 22 4d 75 73 |xp "" er|ror "Mus|
|00002f70| 74 20 70 61 73 73 20 6e | 6f 6e 2d 65 6d 70 74 79 |t pass n|on-empty|
|00002f80| 20 72 65 67 65 78 70 20 | 74 6f 20 60 6c 69 73 74 | regexp |to `list|
|00002f90| 2d 6d 61 74 63 68 69 6e | 67 2d 6c 69 6e 65 73 27 |-matchin|g-lines'|
|00002fa0| 22 20 6e 6c 69 6e 65 73 | 20 70 72 65 66 69 78 2d |" nlines| prefix-|
|00002fb0| 6e 75 6d 65 72 69 63 2d | 76 61 6c 75 65 20 6c 69 |numeric-|value li|
|00002fc0| 73 74 2d 6d 61 74 63 68 | 69 6e 67 2d 6c 69 6e 65 |st-match|ing-line|
|00002fd0| 73 2d 64 65 66 61 75 6c | 74 2d 63 6f 6e 74 65 78 |s-defaul|t-contex|
|00002fe0| 74 2d 6c 69 6e 65 73 20 | 74 20 64 65 66 61 75 6c |t-lines |t defaul|
|00002ff0| 74 2d 64 69 72 65 63 74 | 6f 72 79 20 31 20 6d 61 |t-direct|ory 1 ma|
|00003000| 6b 65 2d 6d 61 72 6b 65 | 72 20 66 69 6e 61 6c 2d |ke-marke|r final-|
|00003010| 63 6f 6e 74 65 78 74 2d | 73 74 61 72 74 20 70 72 |context-|start pr|
|00003020| 65 76 70 6f 73 20 6c 69 | 6e 65 6e 75 6d 20 62 75 |evpos li|nenum bu|
|00003030| 66 66 65 72 20 64 69 72 | 20 66 69 72 73 74 20 6c |ffer dir| first l|
|00003040| 69 73 74 2d 6d 61 74 63 | 68 69 6e 67 2d 6c 69 6e |ist-matc|hing-lin|
|00003050| 65 73 2d 77 68 6f 6c 65 | 2d 62 75 66 66 65 72 20 |es-whole|-buffer |
|00003060| 30 20 63 6f 75 6e 74 2d | 6c 69 6e 65 73 20 22 2a |0 count-|lines "*|
|00003070| 4f 63 63 75 72 2a 22 20 | 73 74 61 6e 64 61 72 64 |Occur*" |standard|
|00003080| 2d 6f 75 74 70 75 74 20 | 70 72 69 6e 74 2d 65 73 |-output |print-es|
|00003090| 63 61 70 65 2d 6e 65 77 | 6c 69 6e 65 73 20 66 6f |cape-new|lines fo|
|000030a0| 72 6d 61 74 20 22 20 6d | 61 74 63 68 69 6e 67 20 |rmat " m|atching |
|000030b0| 25 73 20 69 6e 20 62 75 | 66 66 65 72 20 25 73 2e |%s in bu|ffer %s.|
|000030c0| 5c 6e 22 20 62 75 66 66 | 65 72 2d 6e 61 6d 65 20 |\n" buff|er-name |
|000030d0| 6f 63 63 75 72 2d 6d 6f | 64 65 20 6f 63 63 75 72 |occur-mo|de occur|
|000030e0| 2d 62 75 66 66 65 72 20 | 6f 63 63 75 72 2d 6e 6c |-buffer |occur-nl|
|000030f0| 69 6e 65 73 20 6e 69 6c | 20 6f 63 63 75 72 2d 70 |ines nil| occur-p|
|00003100| 6f 73 2d 6c 69 73 74 20 | 62 65 67 69 6e 6e 69 6e |os-list |beginnin|
|00003110| 67 2d 6f 66 2d 62 75 66 | 66 65 72 20 6d 65 73 73 |g-of-buf|fer mess|
|00003120| 61 67 65 20 22 53 65 61 | 72 63 68 69 6e 67 20 66 |age "Sea|rching f|
|00003130| 6f 72 20 25 73 20 2e 2e | 2e 22 20 72 65 2d 73 65 |or %s ..|." re-se|
|00003140| 61 72 63 68 2d 66 6f 72 | 77 61 72 64 20 6d 61 74 |arch-for|ward mat|
|00003150| 63 68 2d 64 61 74 61 20 | 6d 61 74 63 68 2d 64 61 |ch-data |match-da|
|00003160| 74 61 20 28 28 73 74 6f | 72 65 2d 6d 61 74 63 68 |ta ((sto|re-match|
|00003170| 2d 64 61 74 61 20 6d 61 | 74 63 68 2d 64 61 74 61 |-data ma|tch-data|
|00003180| 29 29 20 73 74 61 72 74 | 20 65 6e 64 20 22 25 35 |)) start| end "%5|
|00003190| 64 22 20 74 61 67 20 6d | 61 6b 65 2d 73 74 72 69 |d" tag m|ake-stri|
|000031a0| 6e 67 20 3f 5c 20 20 65 | 6d 70 74 79 20 74 65 6d |ng ?\ e|mpty tem|
|000031b0| 20 7a 65 72 6f 70 20 22 | 2d 2d 2d 2d 2d 2d 2d 2d | zerop "|--------|
|000031c0| 5c 6e 22 20 69 6e 73 65 | 72 74 2d 62 75 66 66 65 |\n" inse|rt-buffe|
|000031d0| 72 2d 73 75 62 73 74 72 | 69 6e 67 20 62 61 63 6b |r-substr|ing back|
|000031e0| 77 61 72 64 2d 63 68 61 | 72 20 3f 5c 3a 20 74 68 |ward-cha|r ?\: th|
|000031f0| 69 73 2d 6c 69 6e 65 6e | 75 6d 20 22 31 20 6c 69 |is-linen|um "1 li|
|00003200| 6e 65 22 20 22 25 64 20 | 6c 69 6e 65 73 22 20 22 |ne" "%d |lines" "|
|00003210| 25 64 20 6d 61 74 63 68 | 69 6e 67 20 6c 69 6e 65 |%d match|ing line|
|00003220| 73 2e 22 5d 20 37 20 28 | 23 24 20 2e 20 31 30 39 |s."] 7 (|#$ . 109|
|00003230| 34 38 29 20 28 6c 69 73 | 74 20 28 6c 65 74 2a 20 |48) (lis|t (let* |
|00003240| 28 28 64 65 66 61 75 6c | 74 20 28 6f 72 20 28 73 |((defaul|t (or (s|
|00003250| 79 6d 62 6f 6c 2d 6e 65 | 61 72 2d 70 6f 69 6e 74 |ymbol-ne|ar-point|
|00003260| 29 20 28 61 6e 64 20 72 | 65 67 65 78 70 2d 68 69 |) (and r|egexp-hi|
|00003270| 73 74 6f 72 79 20 28 63 | 61 72 20 72 65 67 65 78 |story (c|ar regex|
|00003280| 70 2d 68 69 73 74 6f 72 | 79 29 29 29 29 20 28 6d |p-histor|y)))) (m|
|00003290| 69 6e 69 62 75 66 66 65 | 72 2d 68 69 73 74 6f 72 |inibuffe|r-histor|
|000032a0| 79 2d 6d 69 6e 69 6d 75 | 6d 2d 73 74 72 69 6e 67 |y-minimu|m-string|
|000032b0| 2d 6c 65 6e 67 74 68 20 | 30 29 20 28 69 6e 70 75 |-length |0) (inpu|
|000032c0| 74 20 28 69 66 20 64 65 | 66 61 75 6c 74 20 28 72 |t (if de|fault (r|
|000032d0| 65 61 64 2d 66 72 6f 6d | 2d 6d 69 6e 69 62 75 66 |ead-from|-minibuf|
|000032e0| 66 65 72 20 28 66 6f 72 | 6d 61 74 20 22 4c 69 73 |fer (for|mat "Lis|
|000032f0| 74 20 6c 69 6e 65 73 20 | 6d 61 74 63 68 69 6e 67 |t lines |matching|
|00003300| 20 72 65 67 65 78 70 20 | 28 64 65 66 61 75 6c 74 | regexp |(default|
|00003310| 20 60 25 73 27 29 3a 20 | 22 20 64 65 66 61 75 6c | `%s'): |" defaul|
|00003320| 74 29 20 6e 69 6c 20 6e | 69 6c 20 6e 69 6c 20 27 |t) nil n|il nil '|
|00003330| 72 65 67 65 78 70 2d 68 | 69 73 74 6f 72 79 29 20 |regexp-h|istory) |
|00003340| 28 72 65 61 64 2d 66 72 | 6f 6d 2d 6d 69 6e 69 62 |(read-fr|om-minib|
|00003350| 75 66 66 65 72 20 22 4c | 69 73 74 20 6c 69 6e 65 |uffer "L|ist line|
|00003360| 73 20 6d 61 74 63 68 69 | 6e 67 20 72 65 67 65 78 |s matchi|ng regex|
|00003370| 70 3a 20 22 20 6e 69 6c | 20 6e 69 6c 20 6e 69 6c |p: " nil| nil nil|
|00003380| 20 27 72 65 67 65 78 70 | 2d 68 69 73 74 6f 72 79 | 'regexp|-history|
|00003390| 29 29 29 29 20 28 69 66 | 20 28 61 6e 64 20 28 65 |)))) (if| (and (e|
|000033a0| 71 75 61 6c 20 69 6e 70 | 75 74 20 22 22 29 20 64 |qual inp|ut "") d|
|000033b0| 65 66 61 75 6c 74 29 20 | 28 70 72 6f 67 6e 20 28 |efault) |(progn (|
|000033c0| 73 65 74 71 20 69 6e 70 | 75 74 20 64 65 66 61 75 |setq inp|ut defau|
|000033d0| 6c 74 29 20 28 73 65 74 | 63 61 72 20 72 65 67 65 |lt) (set|car rege|
|000033e0| 78 70 2d 68 69 73 74 6f | 72 79 20 64 65 66 61 75 |xp-histo|ry defau|
|000033f0| 6c 74 29 29 29 20 28 73 | 65 74 63 64 72 20 72 65 |lt))) (s|etcdr re|
|00003400| 67 65 78 70 2d 68 69 73 | 74 6f 72 79 20 28 64 65 |gexp-his|tory (de|
|00003410| 6c 65 74 65 20 28 63 61 | 72 20 72 65 67 65 78 70 |lete (ca|r regexp|
|00003420| 2d 68 69 73 74 6f 72 79 | 29 20 28 63 64 72 20 72 |-history|) (cdr r|
|00003430| 65 67 65 78 70 2d 68 69 | 73 74 6f 72 79 29 29 29 |egexp-hi|story)))|
|00003440| 20 69 6e 70 75 74 29 20 | 63 75 72 72 65 6e 74 2d | input) |current-|
|00003450| 70 72 65 66 69 78 2d 61 | 72 67 29 5d 29 0a 23 40 |prefix-a|rg)]).#@|
|00003460| 33 37 20 48 65 6c 70 20 | 6d 65 73 73 61 67 65 20 |37 Help |message |
|00003470| 77 68 69 6c 65 20 69 6e | 20 71 75 65 72 79 2d 72 |while in| query-r|
|00003480| 65 70 6c 61 63 65 1f 0a | 28 64 65 66 63 6f 6e 73 |eplace..|(defcons|
|00003490| 74 20 71 75 65 72 79 2d | 72 65 70 6c 61 63 65 2d |t query-|replace-|
|000034a0| 68 65 6c 70 20 28 70 75 | 72 65 63 6f 70 79 20 22 |help (pu|recopy "|
|000034b0| 54 79 70 65 20 53 70 61 | 63 65 20 6f 72 20 60 79 |Type Spa|ce or `y|
|000034c0| 27 20 74 6f 20 72 65 70 | 6c 61 63 65 20 6f 6e 65 |' to rep|lace one|
|000034d0| 20 6d 61 74 63 68 2c 20 | 44 65 6c 65 74 65 20 6f | match, |Delete o|
|000034e0| 72 20 60 6e 27 20 74 6f | 20 73 6b 69 70 20 74 6f |r `n' to| skip to|
|000034f0| 20 6e 65 78 74 2c 5c 6e | 52 45 54 20 6f 72 20 60 | next,\n|RET or `|
|00003500| 71 27 20 74 6f 20 65 78 | 69 74 2c 20 50 65 72 69 |q' to ex|it, Peri|
|00003510| 6f 64 20 74 6f 20 72 65 | 70 6c 61 63 65 20 6f 6e |od to re|place on|
|00003520| 65 20 6d 61 74 63 68 20 | 61 6e 64 20 65 78 69 74 |e match |and exit|
|00003530| 2c 5c 6e 43 6f 6d 6d 61 | 20 74 6f 20 72 65 70 6c |,\nComma| to repl|
|00003540| 61 63 65 20 62 75 74 20 | 6e 6f 74 20 6d 6f 76 65 |ace but |not move|
|00003550| 20 70 6f 69 6e 74 20 69 | 6d 6d 65 64 69 61 74 65 | point i|mmediate|
|00003560| 6c 79 2c 5c 6e 43 2d 72 | 20 74 6f 20 65 6e 74 65 |ly,\nC-r| to ente|
|00003570| 72 20 72 65 63 75 72 73 | 69 76 65 20 65 64 69 74 |r recurs|ive edit|
|00003580| 20 28 5c 5c 5b 65 78 69 | 74 2d 72 65 63 75 72 73 | (\\[exi|t-recurs|
|00003590| 69 76 65 2d 65 64 69 74 | 5d 20 74 6f 20 67 65 74 |ive-edit|] to get|
|000035a0| 20 6f 75 74 20 61 67 61 | 69 6e 29 2c 5c 6e 43 2d | out aga|in),\nC-|
|000035b0| 77 20 74 6f 20 64 65 6c | 65 74 65 20 6d 61 74 63 |w to del|ete matc|
|000035c0| 68 20 61 6e 64 20 72 65 | 63 75 72 73 69 76 65 20 |h and re|cursive |
|000035d0| 65 64 69 74 2c 5c 6e 43 | 2d 6c 20 74 6f 20 63 6c |edit,\nC|-l to cl|
|000035e0| 65 61 72 20 74 68 65 20 | 66 72 61 6d 65 2c 20 72 |ear the |frame, r|
|000035f0| 65 64 69 73 70 6c 61 79 | 2c 20 61 6e 64 20 6f 66 |edisplay|, and of|
|00003600| 66 65 72 20 73 61 6d 65 | 20 72 65 70 6c 61 63 65 |fer same| replace|
|00003610| 6d 65 6e 74 20 61 67 61 | 69 6e 2c 5c 6e 21 20 74 |ment aga|in,\n! t|
|00003620| 6f 20 72 65 70 6c 61 63 | 65 20 61 6c 6c 20 72 65 |o replac|e all re|
|00003630| 6d 61 69 6e 69 6e 67 20 | 6d 61 74 63 68 65 73 20 |maining |matches |
|00003640| 77 69 74 68 20 6e 6f 20 | 6d 6f 72 65 20 71 75 65 |with no |more que|
|00003650| 73 74 69 6f 6e 73 2c 5c | 6e 5e 20 74 6f 20 6d 6f |stions,\|n^ to mo|
|00003660| 76 65 20 70 6f 69 6e 74 | 20 62 61 63 6b 20 74 6f |ve point| back to|
|00003670| 20 70 72 65 76 69 6f 75 | 73 20 6d 61 74 63 68 2e | previou|s match.|
|00003680| 22 29 20 28 23 24 20 2e | 20 31 33 34 31 31 29 29 |") (#$ .| 13411))|
|00003690| 0a 23 40 33 30 31 20 4b | 65 79 6d 61 70 20 74 68 |.#@301 K|eymap th|
|000036a0| 61 74 20 64 65 66 69 6e | 65 73 20 74 68 65 20 72 |at defin|es the r|
|000036b0| 65 73 70 6f 6e 73 65 73 | 20 74 6f 20 71 75 65 73 |esponses| to ques|
|000036c0| 74 69 6f 6e 73 20 69 6e | 20 60 71 75 65 72 79 2d |tions in| `query-|
|000036d0| 72 65 70 6c 61 63 65 27 | 2e 0a 54 68 65 20 22 62 |replace'|..The "b|
|000036e0| 69 6e 64 69 6e 67 73 22 | 20 69 6e 20 74 68 69 73 |indings"| in this|
|000036f0| 20 6d 61 70 20 61 72 65 | 20 6e 6f 74 20 63 6f 6d | map are| not com|
|00003700| 6d 61 6e 64 73 3b 20 74 | 68 65 79 20 61 72 65 20 |mands; t|hey are |
|00003710| 61 6e 73 77 65 72 73 2e | 0a 54 68 65 20 76 61 6c |answers.|.The val|
|00003720| 69 64 20 61 6e 73 77 65 | 72 73 20 69 6e 63 6c 75 |id answe|rs inclu|
|00003730| 64 65 20 60 61 63 74 27 | 2c 20 60 73 6b 69 70 27 |de `act'|, `skip'|
|00003740| 2c 20 60 61 63 74 2d 61 | 6e 64 2d 73 68 6f 77 27 |, `act-a|nd-show'|
|00003750| 2c 0a 60 65 78 69 74 27 | 2c 20 60 61 63 74 2d 61 |,.`exit'|, `act-a|
|00003760| 6e 64 2d 65 78 69 74 27 | 2c 20 60 65 64 69 74 27 |nd-exit'|, `edit'|
|00003770| 2c 20 60 64 65 6c 65 74 | 65 2d 61 6e 64 2d 65 64 |, `delet|e-and-ed|
|00003780| 69 74 27 2c 20 60 72 65 | 63 65 6e 74 65 72 27 2c |it', `re|center',|
|00003790| 0a 60 61 75 74 6f 6d 61 | 74 69 63 27 2c 20 60 62 |.`automa|tic', `b|
|000037a0| 61 63 6b 75 70 27 2c 20 | 60 65 78 69 74 2d 70 72 |ackup', |`exit-pr|
|000037b0| 65 66 69 78 27 2c 20 61 | 6e 64 20 60 68 65 6c 70 |efix', a|nd `help|
|000037c0| 27 2e 1f 0a 28 64 65 66 | 76 61 72 20 71 75 65 72 |'...(def|var quer|
|000037d0| 79 2d 72 65 70 6c 61 63 | 65 2d 6d 61 70 20 6e 69 |y-replac|e-map ni|
|000037e0| 6c 20 28 23 24 20 2e 20 | 31 33 39 37 35 29 29 0a |l (#$ . |13975)).|
|000037f0| 28 62 79 74 65 2d 63 6f | 64 65 20 22 08 84 a5 00 |(byte-co|de "....|
|00003800| c1 20 1a c3 5c 6e c0 5c | 22 88 c4 5c 6e c5 c6 23 |. ..\n.\|"..\n..#|
|00003810| 88 c4 5c 6e c7 c8 23 88 | c4 5c 6e c9 c8 23 88 c4 |..\n..#.|.\n..#..|
|00003820| 5c 6e ca c8 23 88 c4 5c | 6e cb c6 23 88 c4 5c 6e |\n..#..\|n..#..\n|
|00003830| cc c8 23 88 c4 5c 6e cd | c6 23 88 c4 5c 6e ce c8 |..#..\n.|.#..\n..|
|00003840| 23 88 c4 5c 6e cf d0 23 | 88 c4 5c 6e d1 d2 23 88 |#..\n..#|..\n..#.|
|00003850| c4 5c 6e d3 d2 23 88 c4 | 5c 6e d4 d2 23 88 c4 5c |.\n..#..|\n..#..\|
|00003860| 6e d5 d6 23 88 c4 5c 6e | d7 d8 23 88 c4 5c 6e d9 |n..#..\n|..#..\n.|
|00003870| da 23 88 c4 5c 6e db dc | 23 88 c4 5c 6e dd de 23 |.#..\n..|#..\n..#|
|00003880| 88 c4 5c 6e df e0 23 88 | c4 5c 6e e1 e2 23 88 c4 |..\n..#.|.\n..#..|
|00003890| 5c 6e e3 e2 23 88 c4 5c | 6e e4 e2 23 88 c4 5c 6e |\n..#..\|n..#..\n|
|000038a0| e5 e2 23 88 c4 5c 6e e6 | e7 23 88 c4 5c 6e e8 e7 |..#..\n.|.#..\n..|
|000038b0| 23 88 c4 5c 6e e9 ea 23 | 88 5c 6e 10 29 eb ec ed |#..\n..#|.\n.)...|
|000038c0| 5c 22 87 22 20 5b 71 75 | 65 72 79 2d 72 65 70 6c |\"." [qu|ery-repl|
|000038d0| 61 63 65 2d 6d 61 70 20 | 6d 61 6b 65 2d 73 70 61 |ace-map |make-spa|
|000038e0| 72 73 65 2d 6b 65 79 6d | 61 70 20 6d 61 70 20 73 |rse-keym|ap map s|
|000038f0| 65 74 2d 6b 65 79 6d 61 | 70 2d 6e 61 6d 65 20 64 |et-keyma|p-name d|
|00003900| 65 66 69 6e 65 2d 6b 65 | 79 20 22 20 22 20 61 63 |efine-ke|y " " ac|
|00003910| 74 20 22 7f 22 20 73 6b | 69 70 20 5b 64 65 6c 65 |t "." sk|ip [dele|
|00003920| 74 65 5d 20 5b 62 61 63 | 6b 73 70 61 63 65 5d 20 |te] [bac|kspace] |
|00003930| 22 79 22 20 22 6e 22 20 | 22 59 22 20 22 4e 22 20 |"y" "n" |"Y" "N" |
|00003940| 22 2c 22 20 61 63 74 2d | 61 6e 64 2d 73 68 6f 77 |"," act-|and-show|
|00003950| 20 5b 65 73 63 61 70 65 | 5d 20 65 78 69 74 20 22 | [escape|] exit "|
|00003960| 71 22 20 5b 72 65 74 75 | 72 6e 5d 20 22 2e 22 20 |q" [retu|rn] "." |
|00003970| 61 63 74 2d 61 6e 64 2d | 65 78 69 74 20 22 12 22 |act-and-|exit "."|
|00003980| 20 65 64 69 74 20 22 17 | 22 20 64 65 6c 65 74 65 | edit ".|" delete|
|00003990| 2d 61 6e 64 2d 65 64 69 | 74 20 22 0c 22 20 72 65 |-and-edi|t "." re|
|000039a0| 63 65 6e 74 65 72 20 22 | 21 22 20 61 75 74 6f 6d |center "|!" autom|
|000039b0| 61 74 69 63 20 22 5e 22 | 20 62 61 63 6b 75 70 20 |atic "^"| backup |
|000039c0| 5b 28 63 6f 6e 74 72 6f | 6c 20 68 29 5d 20 68 65 |[(contro|l h)] he|
|000039d0| 6c 70 20 5b 66 31 5d 20 | 5b 68 65 6c 70 5d 20 22 |lp [f1] |[help] "|
|000039e0| 3f 22 20 22 07 22 20 71 | 75 69 74 20 22 1d 22 20 |?" "." q|uit "." |
|000039f0| 5b 65 73 63 61 70 65 5d | 20 65 78 69 74 2d 70 72 |[escape]| exit-pr|
|00003a00| 65 66 69 78 20 61 75 74 | 6f 6c 6f 61 64 20 69 73 |efix aut|oload is|
|00003a10| 65 61 72 63 68 2d 68 69 | 67 68 6c 69 67 68 74 20 |earch-hi|ghlight |
|00003a20| 22 69 73 65 61 72 63 68 | 22 5d 20 34 29 0a 28 64 |"isearch|"] 4).(d|
|00003a30| 65 66 61 6c 69 61 73 20 | 27 70 65 72 66 6f 72 6d |efalias |'perform|
|00003a40| 2d 72 65 70 6c 61 63 65 | 2d 6e 65 78 74 2d 65 76 |-replace|-next-ev|
|00003a50| 65 6e 74 20 23 5b 28 65 | 76 65 6e 74 29 20 22 08 |ent #[(e|vent) ".|
|00003a60| ab 99 c1 1a c3 8e c4 94 | ab 87 c0 c4 94 c4 95 5c |........|.......\|
|00003a70| 22 88 c5 0e 06 21 88 c7 | 89 12 2a 87 c5 0e 06 21 |"....!..|..*....!|
|00003a80| 87 22 20 5b 69 73 65 61 | 72 63 68 2d 68 69 67 68 |." [isea|rch-high|
|00003a90| 6c 69 67 68 74 20 74 20 | 61 62 6f 72 74 65 64 20 |light t |aborted |
|00003aa0| 28 28 69 73 65 61 72 63 | 68 2d 64 65 68 69 67 68 |((isearc|h-dehigh|
|00003ab0| 6c 69 67 68 74 20 61 62 | 6f 72 74 65 64 29 29 20 |light ab|orted)) |
|00003ac0| 30 20 6e 65 78 74 2d 63 | 6f 6d 6d 61 6e 64 2d 65 |0 next-c|ommand-e|
|00003ad0| 76 65 6e 74 20 65 76 65 | 6e 74 20 6e 69 6c 5d 20 |vent eve|nt nil] |
|00003ae0| 33 5d 29 0a 23 40 33 37 | 33 20 53 75 62 72 6f 75 |3]).#@37|3 Subrou|
|00003af0| 74 69 6e 65 20 6f 66 20 | 60 71 75 65 72 79 2d 72 |tine of |`query-r|
|00003b00| 65 70 6c 61 63 65 27 2e | 20 20 49 74 73 20 63 6f |eplace'.| Its co|
|00003b10| 6d 70 6c 65 78 69 74 79 | 20 68 61 6e 64 6c 65 73 |mplexity| handles|
|00003b20| 20 69 6e 74 65 72 61 63 | 74 69 76 65 20 71 75 65 | interac|tive que|
|00003b30| 72 69 65 73 2e 0a 44 6f | 6e 27 74 20 75 73 65 20 |ries..Do|n't use |
|00003b40| 74 68 69 73 20 69 6e 20 | 79 6f 75 72 20 6f 77 6e |this in |your own|
|00003b50| 20 70 72 6f 67 72 61 6d | 20 75 6e 6c 65 73 73 20 | program| unless |
|00003b60| 79 6f 75 20 77 61 6e 74 | 20 74 6f 20 71 75 65 72 |you want| to quer|
|00003b70| 79 20 61 6e 64 20 73 65 | 74 20 74 68 65 20 6d 61 |y and se|t the ma|
|00003b80| 72 6b 0a 6a 75 73 74 20 | 61 73 20 60 71 75 65 72 |rk.just |as `quer|
|00003b90| 79 2d 72 65 70 6c 61 63 | 65 27 20 64 6f 65 73 2e |y-replac|e' does.|
|00003ba0| 20 20 49 6e 73 74 65 61 | 64 2c 20 77 72 69 74 65 | Instea|d, write|
|00003bb0| 20 61 20 73 69 6d 70 6c | 65 20 6c 6f 6f 70 20 6c | a simpl|e loop l|
|00003bc0| 69 6b 65 20 74 68 69 73 | 3a 0a 20 20 28 77 68 69 |ike this|:. (whi|
|00003bd0| 6c 65 20 28 72 65 2d 73 | 65 61 72 63 68 2d 66 6f |le (re-s|earch-fo|
|00003be0| 72 77 61 72 64 20 22 66 | 6f 6f 5b 20 09 5d 2b 62 |rward "f|oo[ .]+b|
|00003bf0| 61 72 22 20 6e 69 6c 20 | 74 29 0a 20 20 20 20 28 |ar" nil |t). (|
|00003c00| 72 65 70 6c 61 63 65 2d | 6d 61 74 63 68 20 22 66 |replace-|match "f|
|00003c10| 6f 6f 62 61 72 22 20 6e | 69 6c 20 6e 69 6c 29 29 |oobar" n|il nil))|
|00003c20| 0a 77 68 69 63 68 20 77 | 69 6c 6c 20 72 75 6e 20 |.which w|ill run |
|00003c30| 66 61 73 74 65 72 20 61 | 6e 64 20 70 72 6f 62 61 |faster a|nd proba|
|00003c40| 62 6c 79 20 64 6f 20 65 | 78 61 63 74 6c 79 20 77 |bly do e|xactly w|
|00003c50| 68 61 74 20 79 6f 75 20 | 77 61 6e 74 2e 1f 0a 28 |hat you |want...(|
|00003c60| 64 65 66 61 6c 69 61 73 | 20 27 70 65 72 66 6f 72 |defalias| 'perfor|
|00003c70| 6d 2d 72 65 70 6c 61 63 | 65 20 23 5b 28 66 72 6f |m-replac|e #[(fro|
|00003c80| 6d 2d 73 74 72 69 6e 67 | 20 72 65 70 6c 61 63 65 |m-string| replace|
|00003c90| 6d 65 6e 74 73 20 71 75 | 65 72 79 2d 66 6c 61 67 |ments qu|ery-flag|
|00003ca0| 20 72 65 67 65 78 70 2d | 66 6c 61 67 20 64 65 6c | regexp-|flag del|
|00003cb0| 69 6d 69 74 65 64 2d 66 | 6c 61 67 20 26 6f 70 74 |imited-f|lag &opt|
|00003cc0| 69 6f 6e 61 6c 20 72 65 | 70 65 61 74 2d 63 6f 75 |ional re|peat-cou|
|00003cd0| 6e 74 20 6d 61 70 29 20 | 22 08 ac 82 09 10 c2 20 |nt map) |"...... |
|00003ce0| 1b 0c ad 88 0d ad 85 0e | 06 89 97 98 3f 1e 07 0e |........|....?...|
|00003cf0| 08 3f 1e 09 0e 08 ab 83 | ca aa 81 cb 1e 0c 0e 06 |.?......|........|
|00003d00| 1e 0d ce 1e 0f ce 1e 10 | d1 1e 12 d3 1e 14 ce 1e |........|........|
|00003d10| 15 d1 1e 16 d1 1e 17 ce | 1e 18 d3 1e 19 0c ab 8a |........|........|
|00003d20| 0e 1a ab 86 db 0e 0d 21 | aa 81 0c 1e 1c 0e 1d ad |.......!|........|
|00003d30| 83 de df 21 1e 20 0e 21 | 3b ab 86 0e 21 16 10 aa |...!. .!|;...!...|
|00003d40| 87 0e 5c 22 ac 83 e3 16 | 5c 22 0e 24 ab 94 ca 16 |..\"....|\".$....|
|00003d50| 0c e5 0e 08 ab 84 0e 06 | aa 84 e6 0e 06 21 e5 51 |........|.....!.Q|
|00003d60| 16 0d e7 20 88 e8 20 88 | e9 8e 0e 14 83 f4 02 6d |... .. .|.......m|
|00003d70| 84 f4 02 0e 1c 1c 0e 0c | 0e 0d ce d3 23 29 83 f4 |........|....#)..|
|00003d80| 02 0e 18 60 61 ac 8f 0e | 08 ab 9f 0e 18 d1 94 61 |...`a...|.......a|
|00003d90| ab 98 0e 19 ac 94 6d 84 | f4 02 e3 75 88 0e 1c 1c |......m.|...u....|
|00003da0| 0e 0c 0e 0d ce d3 23 29 | aa 81 d3 83 f4 02 ea 20 |......#)|....... |
|00003db0| 16 0f 0e 08 ab 8b eb 0e | 0d 21 16 19 ec 0e 0f 21 |........|.!.....!|
|00003dc0| 88 0e 21 3c ab 9e 0e 16 | 0e 17 55 ab 97 0e 16 0e |..!<....|..U.....|
|00003dd0| 5c 22 5c 5c 16 16 0e 12 | 0e 21 38 16 10 0e 12 54 |\"\\....|.!8....T|
|00003de0| 0e 21 47 a6 16 12 0e 1d | ac 96 ec 0e 0f 21 88 ed |.!G.....|.....!..|
|00003df0| 0e 10 0e 07 0e 09 23 88 | 0e 17 54 16 17 82 ee 02 |......#.|..T.....|
|00003e00| e8 20 88 ee ce 89 89 1e | 2f 1e 30 1e 31 1e 32 0e |. ......|/.0.1.2.|
|00003e10| 31 84 d0 02 f3 f4 f5 0e | 20 0e 06 0e 10 23 5c 22 |1.......| ....#\"|
|00003e20| 88 f6 0b 21 88 f7 08 f8 | 0b 21 5c 22 16 2f ec 0e |...!....|.!\"./..|
|00003e30| 0f 21 88 0e 2f f9 61 ab | a9 fa fb 21 90 fc f5 fd |.!../.a.|...!....|
|00003e40| 0e 08 ab 83 fe aa 81 ff | 0e 06 0e 10 24 de 0e 40 |........|....$..@|
|00003e50| 21 50 21 88 8a 0e 41 71 | 88 81 42 00 20 29 91 88 |!P!...Aq|..B. )..|
|00003e60| aa 2f 0e 2f 81 43 00 61 | ab 89 ce 16 14 d3 89 16 |././.C.a|........|
|00003e70| 31 aa 20 0e 2f 81 44 00 | 61 ab bd 0e 15 ab a2 0e |1. ./.D.|a.......|
|00003e80| 15 40 89 1e 45 40 62 88 | 0e 45 41 d3 61 89 16 30 |.@..E@b.|.EA.a..0|
|00003e90| ac 86 ec 0e 45 41 21 88 | 0e 15 41 16 15 29 82 32 |....EA!.|..A..).2|
|00003ea0| 01 e0 81 46 00 21 88 81 | 47 00 81 48 00 21 88 81 |...F.!..|G..H.!..|
|00003eb0| 49 00 e3 21 88 82 32 01 | 0e 2f 81 4a 00 61 ab 96 |I..!..2.|./.J.a..|
|00003ec0| 0e 30 ac 89 ed 0e 10 0e | 07 0e 09 23 88 d3 16 31 |.0......|...#...1|
|00003ed0| d3 16 30 82 32 01 0e 2f | 81 4b 00 61 ab 99 0e 30 |..0.2../|.K.a...0|
|00003ee0| ac 89 ed 0e 10 0e 07 0e | 09 23 88 ce 16 14 d3 16 |........|.#......|
|00003ef0| 31 d3 16 30 82 32 01 0e | 2f 81 4c 00 61 ab 98 0e |1..0.2..|/.L.a...|
|00003f00| 30 84 32 01 ed 0e 10 0e | 07 0e 09 23 88 ec ce 21 |0.2.....|...#...!|
|00003f10| 88 d3 16 30 82 32 01 0e | 2f 81 4d 00 61 ab 99 0e |...0.2..|/.M.a...|
|00003f20| 30 ac 89 ed 0e 10 0e 07 | 0e 09 23 88 d3 16 31 ce |0.......|..#...1.|
|00003f30| 16 1d d3 16 30 82 32 01 | 0e 2f 81 4e 00 61 ab 87 |....0.2.|./.N.a..|
|00003f40| d3 89 16 31 82 34 01 0e | 2f 81 4f 00 61 ab 89 81 |...1.4..|/.O.a...|
|00003f50| 4f 00 ce 21 88 82 32 01 | 0e 2f 81 50 00 61 ab 9a |O..!..2.|./.P.a..|
|00003f60| ec ea 20 8a 81 51 00 20 | 88 29 21 88 0e 08 83 32 |.. ..Q. |.)!....2|
|00003f70| 01 eb 0e 0d 21 16 19 82 | 32 01 0e 2f 81 52 00 61 |....!...|2../.R.a|
|00003f80| ab 98 d1 94 d1 95 7c 88 | ec ea 20 8a 81 51 00 20 |......|.|.. ..Q. |
|00003f90| 88 29 21 88 d3 16 30 82 | 32 01 81 53 00 16 54 ce |.)!...0.|2..S..T.|
|00003fa0| 16 14 0b 0e 55 42 16 55 | d3 89 16 31 83 37 01 60 |....UB.U|...1.7.`|
|00003fb0| 0e 30 ae 89 81 56 00 81 | 57 00 ea 20 5c 22 42 0e |.0...V..|W.. \"B.|
|00003fc0| 15 42 16 15 0e 30 ab 85 | 0e 17 54 16 17 2c 60 16 |.B...0..|..T..,`.|
|00003fd0| 18 82 8f 00 29 0e 55 ac | 93 e0 81 58 00 0e 17 89 |....).U.|...X....|
|00003fe0| e3 55 ab 83 ff aa 83 81 | 59 00 23 88 0e 14 ad 82 |.U......|Y.#.....|
|00003ff0| 0e 15 2e 10 87 22 20 5b | 6d 61 70 20 71 75 65 72 |....." [|map quer|
|00004000| 79 2d 72 65 70 6c 61 63 | 65 2d 6d 61 70 20 6d 61 |y-replac|e-map ma|
|00004010| 6b 65 2d 65 76 65 6e 74 | 20 65 76 65 6e 74 20 63 |ke-event| event c|
|00004020| 61 73 65 2d 66 6f 6c 64 | 2d 73 65 61 72 63 68 20 |ase-fold|-search |
|00004030| 63 61 73 65 2d 72 65 70 | 6c 61 63 65 20 66 72 6f |case-rep|lace fro|
|00004040| 6d 2d 73 74 72 69 6e 67 | 20 6e 6f 63 61 73 69 66 |m-string| nocasif|
|00004050| 79 20 72 65 67 65 78 70 | 2d 66 6c 61 67 20 6c 69 |y regexp|-flag li|
|00004060| 74 65 72 61 6c 20 72 65 | 2d 73 65 61 72 63 68 2d |teral re|-search-|
|00004070| 66 6f 72 77 61 72 64 20 | 73 65 61 72 63 68 2d 66 |forward |search-f|
|00004080| 6f 72 77 61 72 64 20 73 | 65 61 72 63 68 2d 66 75 |orward s|earch-fu|
|00004090| 6e 63 74 69 6f 6e 20 73 | 65 61 72 63 68 2d 73 74 |nction s|earch-st|
|000040a0| 72 69 6e 67 20 6e 69 6c | 20 72 65 61 6c 2d 6d 61 |ring nil| real-ma|
|000040b0| 74 63 68 2d 64 61 74 61 | 20 6e 65 78 74 2d 72 65 |tch-data| next-re|
|000040c0| 70 6c 61 63 65 6d 65 6e | 74 20 30 20 72 65 70 6c |placemen|t 0 repl|
|000040d0| 61 63 65 6d 65 6e 74 2d | 69 6e 64 65 78 20 74 20 |acement-|index t |
|000040e0| 6b 65 65 70 2d 67 6f 69 | 6e 67 20 73 74 61 63 6b |keep-goi|ng stack|
|000040f0| 20 6e 65 78 74 2d 72 6f | 74 61 74 65 2d 63 6f 75 | next-ro|tate-cou|
|00004100| 6e 74 20 72 65 70 6c 61 | 63 65 2d 63 6f 75 6e 74 |nt repla|ce-count|
|00004110| 20 6c 61 73 74 72 65 70 | 6c 20 6d 61 74 63 68 2d | lastrep|l match-|
|00004120| 61 67 61 69 6e 20 73 65 | 61 72 63 68 2d 63 61 70 |again se|arch-cap|
|00004130| 73 2d 64 69 73 61 62 6c | 65 2d 66 6f 6c 64 69 6e |s-disabl|e-foldin|
|00004140| 67 20 69 73 65 61 72 63 | 68 2d 6e 6f 2d 75 70 70 |g isearc|h-no-upp|
|00004150| 65 72 2d 63 61 73 65 2d | 70 20 71 72 2d 63 61 73 |er-case-|p qr-cas|
|00004160| 65 2d 66 6f 6c 64 2d 73 | 65 61 72 63 68 20 71 75 |e-fold-s|earch qu|
|00004170| 65 72 79 2d 66 6c 61 67 | 20 73 75 62 73 74 69 74 |ery-flag| substit|
|00004180| 75 74 65 2d 63 6f 6d 6d | 61 6e 64 2d 6b 65 79 73 |ute-comm|and-keys|
|00004190| 20 22 51 75 65 72 79 20 | 72 65 70 6c 61 63 69 6e | "Query |replacin|
|000041a0| 67 20 25 73 20 77 69 74 | 68 20 25 73 3a 20 28 5c |g %s wit|h %s: (\|
|000041b0| 5c 3c 71 75 65 72 79 2d | 72 65 70 6c 61 63 65 2d |\<query-|replace-|
|000041c0| 6d 61 70 3e 5c 5c 5b 68 | 65 6c 70 5d 20 66 6f 72 |map>\\[h|elp] for|
|000041d0| 20 68 65 6c 70 29 20 22 | 20 6d 65 73 73 61 67 65 | help) "| message|
|000041e0| 20 72 65 70 6c 61 63 65 | 6d 65 6e 74 73 20 72 65 | replace|ments re|
|000041f0| 70 65 61 74 2d 63 6f 75 | 6e 74 20 31 20 64 65 6c |peat-cou|nt 1 del|
|00004200| 69 6d 69 74 65 64 2d 66 | 6c 61 67 20 22 5c 5c 62 |imited-f|lag "\\b|
|00004210| 22 20 72 65 67 65 78 70 | 2d 71 75 6f 74 65 20 70 |" regexp|-quote p|
|00004220| 75 73 68 2d 6d 61 72 6b | 20 75 6e 64 6f 2d 62 6f |ush-mark| undo-bo|
|00004230| 75 6e 64 61 72 79 20 28 | 28 72 65 70 6c 61 63 65 |undary (|(replace|
|00004240| 2d 64 65 68 69 67 68 6c | 69 67 68 74 29 29 20 6d |-dehighl|ight)) m|
|00004250| 61 74 63 68 2d 64 61 74 | 61 20 6c 6f 6f 6b 69 6e |atch-dat|a lookin|
|00004260| 67 2d 61 74 20 73 74 6f | 72 65 2d 6d 61 74 63 68 |g-at sto|re-match|
|00004270| 2d 64 61 74 61 20 72 65 | 70 6c 61 63 65 2d 6d 61 |-data re|place-ma|
|00004280| 74 63 68 20 28 63 6f 6e | 63 61 74 20 28 66 6f 72 |tch (con|cat (for|
|00004290| 6d 61 74 20 22 51 75 65 | 72 79 20 72 65 70 6c 61 |mat "Que|ry repla|
|000042a0| 63 69 6e 67 20 25 73 25 | 73 20 77 69 74 68 20 25 |cing %s%|s with %|
|000042b0| 73 2e 5c 6e 5c 6e 22 20 | 28 69 66 20 72 65 67 65 |s.\n\n" |(if rege|
|000042c0| 78 70 2d 66 6c 61 67 20 | 28 67 65 74 74 65 78 74 |xp-flag |(gettext|
|000042d0| 20 22 72 65 67 65 78 70 | 20 22 29 20 22 22 29 20 | "regexp| ") "") |
|000042e0| 66 72 6f 6d 2d 73 74 72 | 69 6e 67 20 6e 65 78 74 |from-str|ing next|
|000042f0| 2d 72 65 70 6c 61 63 65 | 6d 65 6e 74 29 20 28 73 |-replace|ment) (s|
|00004300| 75 62 73 74 69 74 75 74 | 65 2d 63 6f 6d 6d 61 6e |ubstitut|e-comman|
|00004310| 64 2d 6b 65 79 73 20 71 | 75 65 72 79 2d 72 65 70 |d-keys q|uery-rep|
|00004320| 6c 61 63 65 2d 68 65 6c | 70 29 29 20 64 65 66 20 |lace-hel|p)) def |
|00004330| 72 65 70 6c 61 63 65 64 | 20 64 6f 6e 65 20 68 65 |replaced| done he|
|00004340| 6c 70 2d 66 6f 72 6d 20 | 64 69 73 70 6c 61 79 2d |lp-form |display-|
|00004350| 6d 65 73 73 61 67 65 20 | 70 72 6f 6d 70 74 20 66 |message |prompt f|
|00004360| 6f 72 6d 61 74 20 70 65 | 72 66 6f 72 6d 2d 72 65 |ormat pe|rform-re|
|00004370| 70 6c 61 63 65 2d 6e 65 | 78 74 2d 65 76 65 6e 74 |place-ne|xt-event|
|00004380| 20 6c 6f 6f 6b 75 70 2d | 6b 65 79 20 76 65 63 74 | lookup-|key vect|
|00004390| 6f 72 20 68 65 6c 70 20 | 67 65 74 74 65 78 74 20 |or help |gettext |
|000043a0| 22 2a 48 65 6c 70 2a 22 | 20 70 72 69 6e 63 20 22 |"*Help*"| princ "|
|000043b0| 51 75 65 72 79 20 72 65 | 70 6c 61 63 69 6e 67 20 |Query re|placing |
|000043c0| 25 73 25 73 20 77 69 74 | 68 20 25 73 2e 5c 6e 5c |%s%s wit|h %s.\n\|
|000043d0| 6e 22 20 22 72 65 67 65 | 78 70 20 22 20 22 22 20 |n" "rege|xp " "" |
|000043e0| 71 75 65 72 79 2d 72 65 | 70 6c 61 63 65 2d 68 65 |query-re|place-he|
|000043f0| 6c 70 20 73 74 61 6e 64 | 61 72 64 2d 6f 75 74 70 |lp stand|ard-outp|
|00004400| 75 74 20 68 65 6c 70 2d | 6d 6f 64 65 20 65 78 69 |ut help-|mode exi|
|00004410| 74 20 62 61 63 6b 75 70 | 20 65 6c 74 20 22 4e 6f |t backup| elt "No|
|00004420| 20 70 72 65 76 69 6f 75 | 73 20 6d 61 74 63 68 22 | previou|s match"|
|00004430| 20 64 69 6e 67 20 6e 6f | 2d 74 65 72 6d 69 6e 61 | ding no|-termina|
|00004440| 74 65 20 73 69 74 2d 66 | 6f 72 20 61 63 74 20 61 |te sit-f|or act a|
|00004450| 63 74 2d 61 6e 64 2d 65 | 78 69 74 20 61 63 74 2d |ct-and-e|xit act-|
|00004460| 61 6e 64 2d 73 68 6f 77 | 20 61 75 74 6f 6d 61 74 |and-show| automat|
|00004470| 69 63 20 73 6b 69 70 20 | 72 65 63 65 6e 74 65 72 |ic skip |recenter|
|00004480| 20 65 64 69 74 20 72 65 | 63 75 72 73 69 76 65 2d | edit re|cursive-|
|00004490| 65 64 69 74 20 64 65 6c | 65 74 65 2d 61 6e 64 2d |edit del|ete-and-|
|000044a0| 65 64 69 74 20 6d 6f 64 | 65 2d 65 78 69 74 65 64 |edit mod|e-exited|
|000044b0| 20 74 68 69 73 2d 63 6f | 6d 6d 61 6e 64 20 75 6e | this-co|mmand un|
|000044c0| 72 65 61 64 2d 63 6f 6d | 6d 61 6e 64 2d 65 76 65 |read-com|mand-eve|
|000044d0| 6e 74 73 20 6d 61 70 63 | 61 72 20 23 5b 28 65 6c |nts mapc|ar #[(el|
|000044e0| 74 29 20 22 c0 09 21 ab | 89 c2 09 21 09 c3 89 93 |t) "..!.|...!....|
|000044f0| 88 87 09 87 22 20 5b 6d | 61 72 6b 65 72 70 20 65 |...." [m|arkerp e|
|00004500| 6c 74 20 6d 61 72 6b 65 | 72 2d 70 6f 73 69 74 69 |lt marke|r-positi|
|00004510| 6f 6e 20 6e 69 6c 5d 20 | 34 5d 20 22 52 65 70 6c |on nil] |4] "Repl|
|00004520| 61 63 65 64 20 25 64 20 | 6f 63 63 75 72 72 65 6e |aced %d |occurren|
|00004530| 63 65 25 73 22 20 22 73 | 22 5d 20 38 20 28 23 24 |ce%s" "s|"] 8 (#$|
|00004540| 20 2e 20 31 35 30 38 32 | 29 5d 29 0a 23 40 36 31 | . 15082|)]).#@61|
|00004550| 20 2a 4e 6f 6e 2d 6e 69 | 6c 20 6d 65 61 6e 73 20 | *Non-ni|l means |
|00004560| 74 6f 20 68 69 67 68 6c | 69 67 68 74 20 77 6f 72 |to highl|ight wor|
|00004570| 64 73 20 64 75 72 69 6e | 67 20 71 75 65 72 79 20 |ds durin|g query |
|00004580| 72 65 70 6c 61 63 65 6d | 65 6e 74 2e 1f 0a 28 64 |replacem|ent...(d|
|00004590| 65 66 76 61 72 20 71 75 | 65 72 79 2d 72 65 70 6c |efvar qu|ery-repl|
|000045a0| 61 63 65 2d 68 69 67 68 | 6c 69 67 68 74 20 6e 69 |ace-high|light ni|
|000045b0| 6c 20 28 23 24 20 2e 20 | 2d 31 37 37 34 35 29 29 |l (#$ . |-17745))|
|000045c0| 0a 28 62 79 74 65 2d 63 | 6f 64 65 20 22 c0 c1 21 |.(byte-c|ode "..!|
|000045d0| ac 82 c2 11 c1 0b 42 13 | c2 87 22 20 5b 62 6f 75 |......B.|.." [bou|
|000045e0| 6e 64 70 20 72 65 70 6c | 61 63 65 2d 6f 76 65 72 |ndp repl|ace-over|
|000045f0| 6c 61 79 20 6e 69 6c 20 | 63 75 72 72 65 6e 74 2d |lay nil |current-|
|00004600| 6c 6f 61 64 2d 6c 69 73 | 74 5d 20 32 29 0a 28 64 |load-lis|t] 2).(d|
|00004610| 65 66 61 6c 69 61 73 20 | 27 72 65 70 6c 61 63 65 |efalias |'replace|
|00004620| 2d 64 65 68 69 67 68 6c | 69 67 68 74 20 23 5b 6e |-dehighl|ight #[n|
|00004630| 69 6c 20 22 08 ad 87 c1 | 08 21 88 c2 89 10 87 22 |il "....|.!....."|
|00004640| 20 5b 72 65 70 6c 61 63 | 65 2d 6f 76 65 72 6c 61 | [replac|e-overla|
|00004650| 79 20 64 65 6c 65 74 65 | 2d 6f 76 65 72 6c 61 79 |y delete|-overlay|
|00004660| 20 6e 69 6c 5d 20 32 5d | 29 0a 28 64 65 66 61 6c | nil] 2]|).(defal|
|00004670| 69 61 73 20 27 72 65 70 | 6c 61 63 65 2d 68 69 67 |ias 'rep|lace-hig|
|00004680| 68 6c 69 67 68 74 20 23 | 5b 28 73 74 61 72 74 20 |hlight #|[(start |
|00004690| 65 6e 64 29 20 22 08 ad | 9c 09 ac 93 c2 0b 0c 5c |end) "..|.......\|
|000046a0| 22 11 c5 09 c6 c7 c8 21 | ab 83 c8 aa 81 c9 23 88 |"......!|......#.|
|000046b0| ca 09 0b 0c 70 24 87 22 | 20 5b 71 75 65 72 79 2d |....p$."| [query-|
|000046c0| 72 65 70 6c 61 63 65 2d | 68 69 67 68 6c 69 67 68 |replace-|highligh|
|000046d0| 74 20 72 65 70 6c 61 63 | 65 2d 6f 76 65 72 6c 61 |t replac|e-overla|
|000046e0| 79 20 6d 61 6b 65 2d 6f | 76 65 72 6c 61 79 20 73 |y make-o|verlay s|
|000046f0| 74 61 72 74 20 65 6e 64 | 20 6f 76 65 72 6c 61 79 |tart end| overlay|
|00004700| 2d 70 75 74 20 66 61 63 | 65 20 69 6e 74 65 72 6e |-put fac|e intern|
|00004710| 61 6c 2d 66 69 6e 64 2d | 66 61 63 65 20 71 75 65 |al-find-|face que|
|00004720| 72 79 2d 72 65 70 6c 61 | 63 65 20 72 65 67 69 6f |ry-repla|ce regio|
|00004730| 6e 20 6d 6f 76 65 2d 6f | 76 65 72 6c 61 79 5d 20 |n move-o|verlay] |
|00004740| 35 5d 29 0a 23 40 33 33 | 36 20 52 65 74 75 72 6e |5]).#@33|6 Return|
|00004750| 20 73 74 72 69 6e 67 20 | 6f 66 20 74 65 78 74 20 | string |of text |
|00004760| 6d 61 74 63 68 65 64 20 | 62 79 20 6c 61 73 74 20 |matched |by last |
|00004770| 73 65 61 72 63 68 2e 0a | 4e 55 4d 20 73 70 65 63 |search..|NUM spec|
|00004780| 69 66 69 65 73 20 77 68 | 69 63 68 20 70 61 72 65 |ifies wh|ich pare|
|00004790| 6e 74 68 65 73 69 7a 65 | 64 20 65 78 70 72 65 73 |nthesize|d expres|
|000047a0| 73 69 6f 6e 20 69 6e 20 | 74 68 65 20 6c 61 73 74 |sion in |the last|
|000047b0| 20 72 65 67 65 78 70 2e | 0a 20 56 61 6c 75 65 20 | regexp.|. Value |
|000047c0| 69 73 20 6e 69 6c 20 69 | 66 20 4e 55 4d 74 68 20 |is nil i|f NUMth |
|000047d0| 70 61 69 72 20 64 69 64 | 6e 27 74 20 6d 61 74 63 |pair did|n't matc|
|000047e0| 68 2c 20 6f 72 20 74 68 | 65 72 65 20 77 65 72 65 |h, or th|ere were|
|000047f0| 20 6c 65 73 73 20 74 68 | 61 6e 20 4e 55 4d 20 70 | less th|an NUM p|
|00004800| 61 69 72 73 2e 0a 5a 65 | 72 6f 20 6d 65 61 6e 73 |airs..Ze|ro means|
|00004810| 20 74 68 65 20 65 6e 74 | 69 72 65 20 74 65 78 74 | the ent|ire text|
|00004820| 20 6d 61 74 63 68 65 64 | 20 62 79 20 74 68 65 20 | matched| by the |
|00004830| 77 68 6f 6c 65 20 72 65 | 67 65 78 70 20 6f 72 20 |whole re|gexp or |
|00004840| 77 68 6f 6c 65 20 73 74 | 72 69 6e 67 2e 0a 53 54 |whole st|ring..ST|
|00004850| 52 49 4e 47 20 73 68 6f | 75 6c 64 20 62 65 20 67 |RING sho|uld be g|
|00004860| 69 76 65 6e 20 69 66 20 | 74 68 65 20 6c 61 73 74 |iven if |the last|
|00004870| 20 73 65 61 72 63 68 20 | 77 61 73 20 62 79 20 60 | search |was by `|
|00004880| 73 74 72 69 6e 67 2d 6d | 61 74 63 68 27 20 6f 6e |string-m|atch' on|
|00004890| 20 53 54 52 49 4e 47 2e | 1f 0a 28 64 65 66 61 6c | STRING.|..(defal|
|000048a0| 69 61 73 20 27 6d 61 74 | 63 68 2d 73 74 72 69 6e |ias 'mat|ch-strin|
|000048b0| 67 20 23 5b 28 6e 75 6d | 20 26 6f 70 74 69 6f 6e |g #[(num| &option|
|000048c0| 61 6c 20 73 74 72 69 6e | 67 29 20 22 08 94 ad 8f |al strin|g) "....|
|000048d0| 09 ab 87 09 08 94 08 95 | 4f 87 08 94 08 95 7b 87 |........|O.....{.|
|000048e0| 22 20 5b 6e 75 6d 20 73 | 74 72 69 6e 67 5d 20 33 |" [num s|tring] 3|
|000048f0| 20 28 23 24 20 2e 20 31 | 38 32 35 30 29 5d 29 0a | (#$ . 1|8250)]).|
|00004900| 23 40 36 37 20 45 78 65 | 63 75 74 65 20 42 4f 44 |#@67 Exe|cute BOD|
|00004910| 59 20 66 6f 72 6d 73 2c | 20 72 65 73 74 6f 72 69 |Y forms,| restori|
|00004920| 6e 67 20 74 68 65 20 67 | 6c 6f 62 61 6c 20 76 61 |ng the g|lobal va|
|00004930| 6c 75 65 20 6f 66 20 74 | 68 65 20 6d 61 74 63 68 |lue of t|he match|
|00004940| 20 64 61 74 61 2e 1f 0a | 28 64 65 66 61 6c 69 61 | data...|(defalia|
|00004950| 73 20 27 73 61 76 65 2d | 6d 61 74 63 68 2d 64 61 |s 'save-|match-da|
|00004960| 74 61 20 27 28 6d 61 63 | 72 6f 20 2e 20 23 5b 28 |ta '(mac|ro . #[(|
|00004970| 26 72 65 73 74 20 62 6f | 64 79 29 20 22 c0 c1 21 |&rest bo|dy) "..!|
|00004980| 1a c3 5c 6e c4 44 43 c5 | c6 0e 07 42 c8 5c 6e 44 |..\n.DC.|...B.\nD|
|00004990| 45 45 29 87 22 20 5b 6d | 61 6b 65 2d 73 79 6d 62 |EE)." [m|ake-symb|
|000049a0| 6f 6c 20 22 6d 61 74 63 | 68 2d 64 61 74 61 22 20 |ol "matc|h-data" |
|000049b0| 6f 72 69 67 69 6e 61 6c | 20 6c 65 74 20 28 6d 61 |original| let (ma|
|000049c0| 74 63 68 2d 64 61 74 61 | 29 20 75 6e 77 69 6e 64 |tch-data|) unwind|
|000049d0| 2d 70 72 6f 74 65 63 74 | 20 70 72 6f 67 6e 20 62 |-protect| progn b|
|000049e0| 6f 64 79 20 73 74 6f 72 | 65 2d 6d 61 74 63 68 2d |ody stor|e-match-|
|000049f0| 64 61 74 61 5d 20 36 20 | 28 23 24 20 2e 20 31 38 |data] 6 |(#$ . 18|
|00004a00| 36 39 33 29 5d 29 29 0a | |693)])).| |
+--------+-------------------------+-------------------------+--------+--------+