home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / lisp / prim / replace.elc < prev    next >
Emacs Compiled Lisp  |  1995-08-29  |  15.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
1% dexvert Combustion 2 Particle Library (other/combustion2ParticleLibrary) ext Unsupported
100% file Emacs/XEmacs v19 byte-compiled Lisp data default
99% file data default
100% TrID Emacs/XEmacs byte-compiled Lisp (generic) default
100% xdgMime text/x-emacs-lisp default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 3b 45 4c 43 13 00 00 00 | 0a 3b 3b 3b 20 63 6f 6d |;ELC....|.;;; com|
|00000010| 70 69 6c 65 64 20 62 79 | 20 63 74 68 6f 6d 70 40 |piled by| cthomp@|
|00000020| 77 69 6c 6c 6f 77 2e 63 | 73 2e 75 69 75 63 2e 65 |willow.c|s.uiuc.e|
|00000030| 64 75 20 6f 6e 20 54 75 | 65 20 41 75 67 20 32 39 |du on Tu|e Aug 29|
|00000040| 20 31 34 3a 32 32 3a 30 | 31 20 31 39 39 35 0a 3b | 14:22:0|1 1995.;|
|00000050| 3b 3b 20 66 72 6f 6d 20 | 66 69 6c 65 20 2f 78 65 |;; from |file /xe|
|00000060| 6d 61 63 73 2f 78 65 6d | 61 63 73 2d 31 39 2e 31 |macs/xem|acs-19.1|
|00000070| 33 2d 72 65 6c 65 61 73 | 65 2f 65 64 69 74 6f 72 |3-releas|e/editor|
|00000080| 2f 6c 69 73 70 2f 70 72 | 69 6d 2f 72 65 70 6c 61 |/lisp/pr|im/repla|
|00000090| 63 65 2e 65 6c 0a 3b 3b | 3b 20 65 6d 61 63 73 20 |ce.el.;;|; emacs |
|000000a0| 76 65 72 73 69 6f 6e 20 | 31 39 2e 31 33 20 58 45 |version |19.13 XE|
|000000b0| 6d 61 63 73 20 4c 75 63 | 69 64 2e 0a 3b 3b 3b 20 |macs Luc|id..;;; |
|000000c0| 62 79 74 65 63 6f 6d 70 | 20 76 65 72 73 69 6f 6e |bytecomp| version|
|000000d0| 20 32 2e 32 35 3b 20 31 | 2d 53 65 70 2d 39 34 2e | 2.25; 1|-Sep-94.|
|000000e0| 0a 3b 3b 3b 20 6f 70 74 | 69 6d 69 7a 61 74 69 6f |.;;; opt|imizatio|
|000000f0| 6e 20 69 73 20 6f 6e 2e | 0a 3b 3b 3b 20 74 68 69 |n is on.|.;;; thi|
|00000100| 73 20 66 69 6c 65 20 75 | 73 65 73 20 6f 70 63 6f |s file u|ses opco|
|00000110| 64 65 73 20 77 68 69 63 | 68 20 64 6f 20 6e 6f 74 |des whic|h do not|
|00000120| 20 65 78 69 73 74 20 69 | 6e 20 45 6d 61 63 73 20 | exist i|n Emacs |
|00000130| 31 38 2e 0a 0a 28 69 66 | 20 28 61 6e 64 20 28 62 |18...(if| (and (b|
|00000140| 6f 75 6e 64 70 20 27 65 | 6d 61 63 73 2d 76 65 72 |oundp 'e|macs-ver|
|00000150| 73 69 6f 6e 29 0a 09 20 | 28 6f 72 20 28 61 6e 64 |sion).. |(or (and|
|00000160| 20 28 62 6f 75 6e 64 70 | 20 27 65 70 6f 63 68 3a | (boundp| 'epoch:|
|00000170| 3a 76 65 72 73 69 6f 6e | 29 20 65 70 6f 63 68 3a |:version|) epoch:|
|00000180| 3a 76 65 72 73 69 6f 6e | 29 0a 09 20 20 20 20 20 |:version|).. |
|00000190| 28 73 74 72 69 6e 67 2d | 6c 65 73 73 70 20 65 6d |(string-|lessp em|
|000001a0| 61 63 73 2d 76 65 72 73 | 69 6f 6e 20 22 31 39 22 |acs-vers|ion "19"|
|000001b0| 29 29 29 0a 20 20 20 20 | 28 65 72 72 6f 72 20 22 |))). |(error "|
|000001c0| 54 68 69 73 20 66 69 6c | 65 20 77 61 73 20 63 6f |This fil|e was co|
|000001d0| 6d 70 69 6c 65 64 20 66 | 6f 72 20 45 6d 61 63 73 |mpiled f|or Emacs|
|000001e0| 20 31 39 2e 22 29 29 0a | 0a 28 64 65 66 76 61 72 | 19.")).|.(defvar|
|000001f0| 20 63 61 73 65 2d 72 65 | 70 6c 61 63 65 20 74 20 | case-re|place t |
|00000200| 22 5c 0a 2a 4e 6f 6e 2d | 6e 69 6c 20 6d 65 61 6e |"\.*Non-|nil mean|
|00000210| 73 20 60 71 75 65 72 79 | 2d 72 65 70 6c 61 63 65 |s `query|-replace|
|00000220| 27 20 73 68 6f 75 6c 64 | 20 70 72 65 73 65 72 76 |' should| preserv|
|00000230| 65 20 63 61 73 65 20 69 | 6e 20 72 65 70 6c 61 63 |e case i|n replac|
|00000240| 65 6d 65 6e 74 73 2e 0a | 57 68 61 74 20 74 68 69 |ements..|What thi|
|00000250| 73 20 6d 65 61 6e 73 20 | 69 73 20 74 68 61 74 20 |s means |is that |
|00000260| 60 71 75 65 72 79 2d 72 | 65 70 6c 61 63 65 27 20 |`query-r|eplace' |
|00000270| 77 69 6c 6c 20 63 68 61 | 6e 67 65 20 74 68 65 20 |will cha|nge the |
|00000280| 63 61 73 65 20 6f 66 20 | 74 68 65 0a 72 65 70 6c |case of |the.repl|
|00000290| 61 63 65 6d 65 6e 74 20 | 74 65 78 74 20 73 6f 20 |acement |text so |
|000002a0| 74 68 61 74 20 69 74 20 | 6d 61 74 63 68 65 73 20 |that it |matches |
|000002b0| 74 68 65 20 74 65 78 74 | 20 74 68 61 74 20 77 61 |the text| that wa|
|000002c0| 73 20 72 65 70 6c 61 63 | 65 64 2e 0a 49 66 20 74 |s replac|ed..If t|
|000002d0| 68 69 73 20 76 61 72 69 | 61 62 6c 65 20 69 73 20 |his vari|able is |
|000002e0| 6e 69 6c 2c 20 74 68 65 | 20 72 65 70 6c 61 63 65 |nil, the| replace|
|000002f0| 6d 65 6e 74 20 74 65 78 | 74 20 77 69 6c 6c 20 62 |ment tex|t will b|
|00000300| 65 20 69 6e 73 65 72 74 | 65 64 0a 65 78 61 63 74 |e insert|ed.exact|
|00000310| 6c 79 20 61 73 20 69 74 | 20 77 61 73 20 73 70 65 |ly as it| was spe|
|00000320| 63 69 66 69 65 64 20 62 | 79 20 74 68 65 20 75 73 |cified b|y the us|
|00000330| 65 72 2c 20 69 72 72 65 | 73 70 65 63 74 69 76 65 |er, irre|spective|
|00000340| 20 6f 66 20 74 68 65 20 | 63 61 73 65 0a 6f 66 20 | of the |case.of |
|00000350| 74 68 65 20 74 65 78 74 | 20 74 68 61 74 20 77 61 |the text| that wa|
|00000360| 73 20 72 65 70 6c 61 63 | 65 64 2e 0a 0a 4e 6f 74 |s replac|ed...Not|
|00000370| 65 20 74 68 61 74 20 74 | 68 69 73 20 66 6c 61 67 |e that t|his flag|
|00000380| 20 68 61 73 20 6e 6f 20 | 65 66 66 65 63 74 20 69 | has no |effect i|
|00000390| 66 20 60 63 61 73 65 2d | 66 6f 6c 64 2d 73 65 61 |f `case-|fold-sea|
|000003a0| 72 63 68 27 20 69 73 20 | 6e 69 6c 2c 0a 6f 72 20 |rch' is |nil,.or |
|000003b0| 69 66 20 74 68 65 20 72 | 65 70 6c 61 63 65 6d 65 |if the r|eplaceme|
|000003c0| 6e 74 20 74 65 78 74 20 | 68 61 73 20 61 6e 79 20 |nt text |has any |
|000003d0| 75 70 70 65 72 63 61 73 | 65 20 6c 65 74 74 65 72 |uppercas|e letter|
|000003e0| 73 20 69 6e 20 69 74 2e | 22 29 0a 28 62 79 74 65 |s in it.|").(byte|
|000003f0| 2d 63 6f 64 65 20 22 c0 | c1 21 ac 82 c2 11 c3 c4 |-code ".|.!......|
|00000400| 4d 87 22 20 5b 62 6f 75 | 6e 64 70 20 71 75 65 72 |M." [bou|ndp quer|
|00000410| 79 2d 72 65 70 6c 61 63 | 65 2d 68 69 73 74 6f 72 |y-replac|e-histor|
|00000420| 79 20 6e 69 6c 20 71 75 | 65 72 79 2d 72 65 70 6c |y nil qu|ery-repl|
|00000430| 61 63 65 2d 72 65 61 64 | 2d 61 72 67 73 20 23 5b |ace-read|-args #[|
|00000440| 28 73 74 72 69 6e 67 29 | 20 22 c0 89 19 1a c3 c4 |(string)| "......|
|00000450| c5 c6 0e 07 21 5c 22 c0 | 89 89 c8 25 12 c3 c4 c9 |....!\".|...%....|
|00000460| c6 0e 07 21 5c 6e 23 c0 | 89 89 c8 25 11 5c 6e 09 |...!\n#.|...%.\n.|
|00000470| 0e 5c 6e 45 2a 87 22 20 | 5b 6e 69 6c 20 74 6f 20 |.\nE*." |[nil to |
|00000480| 66 72 6f 6d 20 72 65 61 | 64 2d 66 72 6f 6d 2d 6d |from rea|d-from-m|
|00000490| 69 6e 69 62 75 66 66 65 | 72 20 66 6f 72 6d 61 74 |inibuffe|r format|
|000004a0| 20 22 25 73 3a 20 22 20 | 67 65 74 74 65 78 74 20 | "%s: " |gettext |
|000004b0| 73 74 72 69 6e 67 20 71 | 75 65 72 79 2d 72 65 70 |string q|uery-rep|
|000004c0| 6c 61 63 65 2d 68 69 73 | 74 6f 72 79 20 22 25 73 |lace-his|tory "%s|
|000004d0| 20 25 73 20 77 69 74 68 | 3a 20 22 20 63 75 72 72 | %s with|: " curr|
|000004e0| 65 6e 74 2d 70 72 65 66 | 69 78 2d 61 72 67 5d 20 |ent-pref|ix-arg] |
|000004f0| 36 5d 5d 20 32 29 0a 28 | 66 73 65 74 20 27 71 75 |6]] 2).(|fset 'qu|
|00000500| 65 72 79 2d 72 65 70 6c | 61 63 65 20 23 5b 28 66 |ery-repl|ace #[(f|
|00000510| 72 6f 6d 2d 73 74 72 69 | 6e 67 20 74 6f 2d 73 74 |rom-stri|ng to-st|
|00000520| 72 69 6e 67 20 26 6f 70 | 74 69 6f 6e 61 6c 20 61 |ring &op|tional a|
|00000530| 72 67 29 20 22 c0 09 5c | 6e c3 c4 0d 25 88 0e 06 |rg) "..\|n...%...|
|00000540| ae 83 c7 c8 21 87 22 20 | 5b 70 65 72 66 6f 72 6d |....!." |[perform|
|00000550| 2d 72 65 70 6c 61 63 65 | 20 66 72 6f 6d 2d 73 74 |-replace| from-st|
|00000560| 72 69 6e 67 20 74 6f 2d | 73 74 72 69 6e 67 20 74 |ring to-|string t|
|00000570| 20 6e 69 6c 20 61 72 67 | 20 75 6e 72 65 61 64 2d | nil arg| unread-|
|00000580| 63 6f 6d 6d 61 6e 64 2d | 65 76 65 6e 74 20 6d 65 |command-|event me|
|00000590| 73 73 61 67 65 20 22 44 | 6f 6e 65 22 5d 20 36 20 |ssage "D|one"] 6 |
|000005a0| 22 5c 0a 52 65 70 6c 61 | 63 65 20 73 6f 6d 65 20 |"\.Repla|ce some |
|000005b0| 6f 63 63 75 72 72 65 6e | 63 65 73 20 6f 66 20 46 |occurren|ces of F|
|000005c0| 52 4f 4d 2d 53 54 52 49 | 4e 47 20 77 69 74 68 20 |ROM-STRI|NG with |
|000005d0| 54 4f 2d 53 54 52 49 4e | 47 2e 0a 41 73 20 65 61 |TO-STRIN|G..As ea|
|000005e0| 63 68 20 6d 61 74 63 68 | 20 69 73 20 66 6f 75 6e |ch match| is foun|
|000005f0| 64 2c 20 74 68 65 20 75 | 73 65 72 20 6d 75 73 74 |d, the u|ser must|
|00000600| 20 74 79 70 65 20 61 20 | 63 68 61 72 61 63 74 65 | type a |characte|
|00000610| 72 20 73 61 79 69 6e 67 | 0a 77 68 61 74 20 74 6f |r saying|.what to|
|00000620| 20 64 6f 20 77 69 74 68 | 20 69 74 2e 20 20 46 6f | do with| it. Fo|
|00000630| 72 20 64 69 72 65 63 74 | 69 6f 6e 73 2c 20 74 79 |r direct|ions, ty|
|00000640| 70 65 20 5c 5c 5b 68 65 | 6c 70 2d 63 6f 6d 6d 61 |pe \\[he|lp-comma|
|00000650| 6e 64 5d 20 61 74 20 74 | 68 61 74 20 74 69 6d 65 |nd] at t|hat time|
|00000660| 2e 0a 0a 50 72 65 73 65 | 72 76 65 73 20 63 61 73 |...Prese|rves cas|
|00000670| 65 20 69 6e 20 65 61 63 | 68 20 72 65 70 6c 61 63 |e in eac|h replac|
|00000680| 65 6d 65 6e 74 20 69 66 | 20 60 63 61 73 65 2d 72 |ement if| `case-r|
|00000690| 65 70 6c 61 63 65 27 20 | 61 6e 64 20 60 63 61 73 |eplace' |and `cas|
|000006a0| 65 2d 66 6f 6c 64 2d 73 | 65 61 72 63 68 27 0a 61 |e-fold-s|earch'.a|
|000006b0| 72 65 20 6e 6f 6e 2d 6e | 69 6c 20 61 6e 64 20 46 |re non-n|il and F|
|000006c0| 52 4f 4d 2d 53 54 52 49 | 4e 47 20 68 61 73 20 6e |ROM-STRI|NG has n|
|000006d0| 6f 20 75 70 70 65 72 63 | 61 73 65 20 6c 65 74 74 |o upperc|ase lett|
|000006e0| 65 72 73 2e 0a 54 68 69 | 72 64 20 61 72 67 20 44 |ers..Thi|rd arg D|
|000006f0| 45 4c 49 4d 49 54 45 44 | 20 28 70 72 65 66 69 78 |ELIMITED| (prefix|
|00000700| 20 61 72 67 20 69 66 20 | 69 6e 74 65 72 61 63 74 | arg if |interact|
|00000710| 69 76 65 29 2c 20 69 66 | 20 6e 6f 6e 2d 6e 69 6c |ive), if| non-nil|
|00000720| 2c 20 6d 65 61 6e 73 20 | 72 65 70 6c 61 63 65 0a |, means |replace.|
|00000730| 6f 6e 6c 79 20 6d 61 74 | 63 68 65 73 20 73 75 72 |only mat|ches sur|
|00000740| 72 6f 75 6e 64 65 64 20 | 62 79 20 77 6f 72 64 20 |rounded |by word |
|00000750| 62 6f 75 6e 64 61 72 69 | 65 73 2e 0a 0a 54 6f 20 |boundari|es...To |
|00000760| 63 75 73 74 6f 6d 69 7a | 65 20 70 6f 73 73 69 62 |customiz|e possib|
|00000770| 6c 65 20 72 65 73 70 6f | 6e 73 65 73 2c 20 63 68 |le respo|nses, ch|
|00000780| 61 6e 67 65 20 74 68 65 | 20 5c 22 62 69 6e 64 69 |ange the| \"bindi|
|00000790| 6e 67 73 5c 22 20 69 6e | 20 60 71 75 65 72 79 2d |ngs\" in| `query-|
|000007a0| 72 65 70 6c 61 63 65 2d | 6d 61 70 27 2e 22 20 28 |replace-|map'." (|
|000007b0| 71 75 65 72 79 2d 72 65 | 70 6c 61 63 65 2d 72 65 |query-re|place-re|
|000007c0| 61 64 2d 61 72 67 73 20 | 22 51 75 65 72 79 20 72 |ad-args |"Query r|
|000007d0| 65 70 6c 61 63 65 22 29 | 5d 29 0a 28 66 73 65 74 |eplace")|]).(fset|
|000007e0| 20 27 71 75 65 72 79 2d | 72 65 70 6c 61 63 65 2d | 'query-|replace-|
|000007f0| 72 65 67 65 78 70 20 23 | 5b 28 72 65 67 65 78 70 |regexp #|[(regexp|
|00000800| 20 74 6f 2d 73 74 72 69 | 6e 67 20 26 6f 70 74 69 | to-stri|ng &opti|
|00000810| 6f 6e 61 6c 20 61 72 67 | 29 20 22 c0 09 5c 6e c3 |onal arg|) "..\n.|
|00000820| 89 0c 25 88 0d ae 83 c6 | c7 21 87 22 20 5b 70 65 |..%.....|.!." [pe|
|00000830| 72 66 6f 72 6d 2d 72 65 | 70 6c 61 63 65 20 72 65 |rform-re|place re|
|00000840| 67 65 78 70 20 74 6f 2d | 73 74 72 69 6e 67 20 74 |gexp to-|string t|
|00000850| 20 61 72 67 20 75 6e 72 | 65 61 64 2d 63 6f 6d 6d | arg unr|ead-comm|
|00000860| 61 6e 64 2d 65 76 65 6e | 74 20 6d 65 73 73 61 67 |and-even|t messag|
|00000870| 65 20 22 44 6f 6e 65 22 | 5d 20 36 20 22 5c 0a 52 |e "Done"|] 6 "\.R|
|00000880| 65 70 6c 61 63 65 20 73 | 6f 6d 65 20 74 68 69 6e |eplace s|ome thin|
|00000890| 67 73 20 61 66 74 65 72 | 20 70 6f 69 6e 74 20 6d |gs after| point m|
|000008a0| 61 74 63 68 69 6e 67 20 | 52 45 47 45 58 50 20 77 |atching |REGEXP w|
|000008b0| 69 74 68 20 54 4f 2d 53 | 54 52 49 4e 47 2e 0a 41 |ith TO-S|TRING..A|
|000008c0| 73 20 65 61 63 68 20 6d | 61 74 63 68 20 69 73 20 |s each m|atch is |
|000008d0| 66 6f 75 6e 64 2c 20 74 | 68 65 20 75 73 65 72 20 |found, t|he user |
|000008e0| 6d 75 73 74 20 74 79 70 | 65 20 61 20 63 68 61 72 |must typ|e a char|
|000008f0| 61 63 74 65 72 20 73 61 | 79 69 6e 67 0a 77 68 61 |acter sa|ying.wha|
|00000900| 74 20 74 6f 20 64 6f 20 | 77 69 74 68 20 69 74 2e |t to do |with it.|
|00000910| 20 20 46 6f 72 20 64 69 | 72 65 63 74 69 6f 6e 73 | For di|rections|
|00000920| 2c 20 74 79 70 65 20 5c | 5c 5b 68 65 6c 70 2d 63 |, type \|\[help-c|
|00000930| 6f 6d 6d 61 6e 64 5d 20 | 61 74 20 74 68 61 74 20 |ommand] |at that |
|00000940| 74 69 6d 65 2e 0a 0a 50 | 72 65 73 65 72 76 65 73 |time...P|reserves|
|00000950| 20 63 61 73 65 20 69 6e | 20 65 61 63 68 20 72 65 | case in| each re|
|00000960| 70 6c 61 63 65 6d 65 6e | 74 20 69 66 20 60 63 61 |placemen|t if `ca|
|00000970| 73 65 2d 72 65 70 6c 61 | 63 65 27 20 61 6e 64 20 |se-repla|ce' and |
|00000980| 60 63 61 73 65 2d 66 6f | 6c 64 2d 73 65 61 72 63 |`case-fo|ld-searc|
|00000990| 68 27 0a 61 72 65 20 6e | 6f 6e 2d 6e 69 6c 20 61 |h'.are n|on-nil a|
|000009a0| 6e 64 20 52 45 47 45 58 | 50 20 68 61 73 20 6e 6f |nd REGEX|P has no|
|000009b0| 20 75 70 70 65 72 63 61 | 73 65 20 6c 65 74 74 65 | upperca|se lette|
|000009c0| 72 73 2e 0a 54 68 69 72 | 64 20 61 72 67 20 44 45 |rs..Thir|d arg DE|
|000009d0| 4c 49 4d 49 54 45 44 20 | 28 70 72 65 66 69 78 20 |LIMITED |(prefix |
|000009e0| 61 72 67 20 69 66 20 69 | 6e 74 65 72 61 63 74 69 |arg if i|nteracti|
|000009f0| 76 65 29 2c 20 69 66 20 | 6e 6f 6e 2d 6e 69 6c 2c |ve), if |non-nil,|
|00000a00| 20 6d 65 61 6e 73 20 72 | 65 70 6c 61 63 65 0a 6f | means r|eplace.o|
|00000a10| 6e 6c 79 20 6d 61 74 63 | 68 65 73 20 73 75 72 72 |nly matc|hes surr|
|00000a20| 6f 75 6e 64 65 64 20 62 | 79 20 77 6f 72 64 20 62 |ounded b|y word b|
|00000a30| 6f 75 6e 64 61 72 69 65 | 73 2e 0a 49 6e 20 54 4f |oundarie|s..In TO|
|00000a40| 2d 53 54 52 49 4e 47 2c | 20 60 5c 5c 26 27 20 73 |-STRING,| `\\&' s|
|00000a50| 74 61 6e 64 73 20 66 6f | 72 20 77 68 61 74 65 76 |tands fo|r whatev|
|00000a60| 65 72 20 6d 61 74 63 68 | 65 64 20 74 68 65 20 77 |er match|ed the w|
|00000a70| 68 6f 6c 65 20 6f 66 20 | 52 45 47 45 58 50 2c 0a |hole of |REGEXP,.|
|00000a80| 61 6e 64 20 60 5c 5c 3d | 5c 5c 4e 27 20 28 77 68 |and `\\=|\\N' (wh|
|00000a90| 65 72 65 20 4e 20 69 73 | 20 61 20 64 69 67 69 74 |ere N is| a digit|
|00000aa0| 29 20 73 74 61 6e 64 73 | 20 66 6f 72 0a 20 77 68 |) stands| for. wh|
|00000ab0| 61 74 65 76 65 72 20 77 | 68 61 74 20 6d 61 74 63 |atever w|hat matc|
|00000ac0| 68 65 64 20 74 68 65 20 | 4e 74 68 20 60 5c 5c 28 |hed the |Nth `\\(|
|00000ad0| 2e 2e 2e 5c 5c 29 27 20 | 69 6e 20 52 45 47 45 58 |...\\)' |in REGEX|
|00000ae0| 50 2e 22 20 28 71 75 65 | 72 79 2d 72 65 70 6c 61 |P." (que|ry-repla|
|00000af0| 63 65 2d 72 65 61 64 2d | 61 72 67 73 20 22 51 75 |ce-read-|args "Qu|
|00000b00| 65 72 79 20 72 65 70 6c | 61 63 65 20 72 65 67 65 |ery repl|ace rege|
|00000b10| 78 70 22 29 5d 29 0a 28 | 66 73 65 74 20 27 6d 61 |xp")]).(|fset 'ma|
|00000b20| 70 2d 71 75 65 72 79 2d | 72 65 70 6c 61 63 65 2d |p-query-|replace-|
|00000b30| 72 65 67 65 78 70 20 23 | 5b 28 72 65 67 65 78 70 |regexp #|[(regexp|
|00000b40| 20 74 6f 2d 73 74 72 69 | 6e 67 73 20 26 6f 70 74 | to-stri|ngs &opt|
|00000b50| 69 6f 6e 61 6c 20 61 72 | 67 29 20 22 c0 19 5c 6e |ional ar|g) "..\n|
|00000b60| 3c ab 84 5c 6e 11 aa af | 5c 6e 47 c3 55 ac a9 c4 |<..\n...|\nG.U...|
|00000b70| c5 5c 6e 5c 22 ab 98 c6 | 09 5c 6e c3 c4 c5 5c 6e |.\n\"...|.\n...\n|
|00000b80| 5c 22 4f 43 5c 22 11 5c | 6e c4 c5 5c 6e 5c 22 54 |\"OC\".\|n..\n\"T|
|00000b90| c0 4f 89 12 aa 5d c6 09 | 5c 6e 43 5c 22 11 c7 89 |.O...]..|\nC\"...|
|00000ba0| 12 aa 52 c8 0e 09 09 ca | 89 c0 0e 0b 26 06 88 29 |..R.....|....&..)|
|00000bb0| 0e 0c ae 83 cd ce 21 87 | 22 20 5b 6e 69 6c 20 72 |......!.|" [nil r|
|00000bc0| 65 70 6c 61 63 65 6d 65 | 6e 74 73 20 74 6f 2d 73 |eplaceme|nts to-s|
|00000bd0| 74 72 69 6e 67 73 20 30 | 20 73 74 72 69 6e 67 2d |trings 0| string-|
|00000be0| 6d 61 74 63 68 20 22 20 | 22 20 61 70 70 65 6e 64 |match " |" append|
|00000bf0| 20 22 22 20 70 65 72 66 | 6f 72 6d 2d 72 65 70 6c | "" perf|orm-repl|
|00000c00| 61 63 65 20 72 65 67 65 | 78 70 20 74 20 61 72 67 |ace rege|xp t arg|
|00000c10| 20 75 6e 72 65 61 64 2d | 63 6f 6d 6d 61 6e 64 2d | unread-|command-|
|00000c20| 65 76 65 6e 74 20 6d 65 | 73 73 61 67 65 20 22 44 |event me|ssage "D|
|00000c30| 6f 6e 65 22 5d 20 38 20 | 22 5c 0a 52 65 70 6c 61 |one"] 8 |"\.Repla|
|00000c40| 63 65 20 73 6f 6d 65 20 | 6d 61 74 63 68 65 73 20 |ce some |matches |
|00000c50| 66 6f 72 20 52 45 47 45 | 58 50 20 77 69 74 68 20 |for REGE|XP with |
|00000c60| 76 61 72 69 6f 75 73 20 | 73 74 72 69 6e 67 73 2c |various |strings,|
|00000c70| 20 69 6e 20 72 6f 74 61 | 74 69 6f 6e 2e 0a 54 68 | in rota|tion..Th|
|00000c80| 65 20 73 65 63 6f 6e 64 | 20 61 72 67 75 6d 65 6e |e second| argumen|
|00000c90| 74 20 54 4f 2d 53 54 52 | 49 4e 47 53 20 63 6f 6e |t TO-STR|INGS con|
|00000ca0| 74 61 69 6e 73 20 74 68 | 65 20 72 65 70 6c 61 63 |tains th|e replac|
|00000cb0| 65 6d 65 6e 74 20 73 74 | 72 69 6e 67 73 2c 20 73 |ement st|rings, s|
|00000cc0| 65 70 61 72 61 74 65 64 | 0a 62 79 20 73 70 61 63 |eparated|.by spac|
|00000cd0| 65 73 2e 20 20 54 68 69 | 73 20 63 6f 6d 6d 61 6e |es. Thi|s comman|
|00000ce0| 64 20 77 6f 72 6b 73 20 | 6c 69 6b 65 20 60 71 75 |d works |like `qu|
|00000cf0| 65 72 79 2d 72 65 70 6c | 61 63 65 2d 72 65 67 65 |ery-repl|ace-rege|
|00000d00| 78 70 27 20 65 78 63 65 | 70 74 0a 74 68 61 74 20 |xp' exce|pt.that |
|00000d10| 65 61 63 68 20 73 75 63 | 63 65 73 73 69 76 65 20 |each suc|cessive |
|00000d20| 72 65 70 6c 61 63 65 6d | 65 6e 74 20 75 73 65 73 |replacem|ent uses|
|00000d30| 20 74 68 65 20 6e 65 78 | 74 20 73 75 63 63 65 73 | the nex|t succes|
|00000d40| 73 69 76 65 20 72 65 70 | 6c 61 63 65 6d 65 6e 74 |sive rep|lacement|
|00000d50| 20 73 74 72 69 6e 67 2c | 0a 77 72 61 70 70 69 6e | string,|.wrappin|
|00000d60| 67 20 61 72 6f 75 6e 64 | 20 66 72 6f 6d 20 74 68 |g around| from th|
|00000d70| 65 20 6c 61 73 74 20 73 | 75 63 68 20 73 74 72 69 |e last s|uch stri|
|00000d80| 6e 67 20 74 6f 20 74 68 | 65 20 66 69 72 73 74 2e |ng to th|e first.|
|00000d90| 0a 0a 4e 6f 6e 2d 69 6e | 74 65 72 61 63 74 69 76 |..Non-in|teractiv|
|00000da0| 65 6c 79 2c 20 54 4f 2d | 53 54 52 49 4e 47 53 20 |ely, TO-|STRINGS |
|00000db0| 6d 61 79 20 62 65 20 61 | 20 6c 69 73 74 20 6f 66 |may be a| list of|
|00000dc0| 20 72 65 70 6c 61 63 65 | 6d 65 6e 74 20 73 74 72 | replace|ment str|
|00000dd0| 69 6e 67 73 2e 0a 0a 41 | 20 70 72 65 66 69 78 20 |ings...A| prefix |
|00000de0| 61 72 67 75 6d 65 6e 74 | 20 4e 20 73 61 79 73 20 |argument| N says |
|00000df0| 74 6f 20 75 73 65 20 65 | 61 63 68 20 72 65 70 6c |to use e|ach repl|
|00000e00| 61 63 65 6d 65 6e 74 20 | 73 74 72 69 6e 67 20 4e |acement |string N|
|00000e10| 20 74 69 6d 65 73 0a 62 | 65 66 6f 72 65 20 72 6f | times.b|efore ro|
|00000e20| 74 61 74 69 6e 67 20 74 | 6f 20 74 68 65 20 6e 65 |tating t|o the ne|
|00000e30| 78 74 2e 22 20 28 62 79 | 74 65 2d 63 6f 64 65 20 |xt." (by|te-code |
|00000e40| 22 c0 89 19 1a c3 c4 c0 | 89 89 c5 25 12 c3 c6 c7 |".......|...%....|
|00000e50| 5c 6e 5c 22 c0 89 89 c5 | 25 11 5c 6e 09 0e 08 45 |\n\"....|%.\n...E|
|00000e60| 2a 87 22 20 5b 6e 69 6c | 20 74 6f 20 66 72 6f 6d |*." [nil| to from|
|00000e70| 20 72 65 61 64 2d 66 72 | 6f 6d 2d 6d 69 6e 69 62 | read-fr|om-minib|
|00000e80| 75 66 66 65 72 20 22 4d | 61 70 20 71 75 65 72 79 |uffer "M|ap query|
|00000e90| 20 72 65 70 6c 61 63 65 | 20 28 72 65 67 65 78 70 | replace| (regexp|
|00000ea0| 29 3a 20 22 20 71 75 65 | 72 79 2d 72 65 70 6c 61 |): " que|ry-repla|
|00000eb0| 63 65 2d 68 69 73 74 6f | 72 79 20 66 6f 72 6d 61 |ce-histo|ry forma|
|00000ec0| 74 20 22 51 75 65 72 79 | 20 72 65 70 6c 61 63 65 |t "Query| replace|
|00000ed0| 20 25 73 20 77 69 74 68 | 20 28 73 70 61 63 65 2d | %s with| (space-|
|00000ee0| 73 65 70 61 72 61 74 65 | 64 20 73 74 72 69 6e 67 |separate|d string|
|00000ef0| 73 29 3a 20 22 20 63 75 | 72 72 65 6e 74 2d 70 72 |s): " cu|rrent-pr|
|00000f00| 65 66 69 78 2d 61 72 67 | 5d 20 36 29 5d 29 0a 28 |efix-arg|] 6)]).(|
|00000f10| 66 73 65 74 20 27 72 65 | 70 6c 61 63 65 2d 73 74 |fset 're|place-st|
|00000f20| 72 69 6e 67 20 23 5b 28 | 66 72 6f 6d 2d 73 74 72 |ring #[(|from-str|
|00000f30| 69 6e 67 20 74 6f 2d 73 | 74 72 69 6e 67 20 26 6f |ing to-s|tring &o|
|00000f40| 70 74 69 6f 6e 61 6c 20 | 64 65 6c 69 6d 69 74 65 |ptional |delimite|
|00000f50| 64 29 20 22 c0 09 5c 6e | c3 89 0c 25 88 0d ae 83 |d) "..\n|...%....|
|00000f60| c6 c7 21 87 22 20 5b 70 | 65 72 66 6f 72 6d 2d 72 |..!." [p|erform-r|
|00000f70| 65 70 6c 61 63 65 20 66 | 72 6f 6d 2d 73 74 72 69 |eplace f|rom-stri|
|00000f80| 6e 67 20 74 6f 2d 73 74 | 72 69 6e 67 20 6e 69 6c |ng to-st|ring nil|
|00000f90| 20 64 65 6c 69 6d 69 74 | 65 64 20 75 6e 72 65 61 | delimit|ed unrea|
|00000fa0| 64 2d 63 6f 6d 6d 61 6e | 64 2d 65 76 65 6e 74 20 |d-comman|d-event |
|00000fb0| 6d 65 73 73 61 67 65 20 | 22 44 6f 6e 65 22 5d 20 |message |"Done"] |
|00000fc0| 36 20 22 5c 0a 52 65 70 | 6c 61 63 65 20 6f 63 63 |6 "\.Rep|lace occ|
|00000fd0| 75 72 72 65 6e 63 65 73 | 20 6f 66 20 46 52 4f 4d |urrences| of FROM|
|00000fe0| 2d 53 54 52 49 4e 47 20 | 77 69 74 68 20 54 4f 2d |-STRING |with TO-|
|00000ff0| 53 54 52 49 4e 47 2e 0a | 50 72 65 73 65 72 76 65 |STRING..|Preserve|
|00001000| 20 63 61 73 65 20 69 6e | 20 65 61 63 68 20 6d 61 | case in| each ma|
|00001010| 74 63 68 20 69 66 20 60 | 63 61 73 65 2d 72 65 70 |tch if `|case-rep|
|00001020| 6c 61 63 65 27 20 61 6e | 64 20 60 63 61 73 65 2d |lace' an|d `case-|
|00001030| 66 6f 6c 64 2d 73 65 61 | 72 63 68 27 0a 61 72 65 |fold-sea|rch'.are|
|00001040| 20 6e 6f 6e 2d 6e 69 6c | 20 61 6e 64 20 46 52 4f | non-nil| and FRO|
|00001050| 4d 2d 53 54 52 49 4e 47 | 20 68 61 73 20 6e 6f 20 |M-STRING| has no |
|00001060| 75 70 70 65 72 63 61 73 | 65 20 6c 65 74 74 65 72 |uppercas|e letter|
|00001070| 73 2e 0a 54 68 69 72 64 | 20 61 72 67 20 44 45 4c |s..Third| arg DEL|
|00001080| 49 4d 49 54 45 44 20 28 | 70 72 65 66 69 78 20 61 |IMITED (|prefix a|
|00001090| 72 67 20 69 66 20 69 6e | 74 65 72 61 63 74 69 76 |rg if in|teractiv|
|000010a0| 65 29 2c 20 69 66 20 6e | 6f 6e 2d 6e 69 6c 2c 20 |e), if n|on-nil, |
|000010b0| 6d 65 61 6e 73 20 72 65 | 70 6c 61 63 65 0a 6f 6e |means re|place.on|
|000010c0| 6c 79 20 6d 61 74 63 68 | 65 73 20 73 75 72 72 6f |ly match|es surro|
|000010d0| 75 6e 64 65 64 20 62 79 | 20 77 6f 72 64 20 62 6f |unded by| word bo|
|000010e0| 75 6e 64 61 72 69 65 73 | 2e 0a 0a 54 68 69 73 20 |undaries|...This |
|000010f0| 66 75 6e 63 74 69 6f 6e | 20 69 73 20 75 73 75 61 |function| is usua|
|00001100| 6c 6c 79 20 74 68 65 20 | 77 72 6f 6e 67 20 74 68 |lly the |wrong th|
|00001110| 69 6e 67 20 74 6f 20 75 | 73 65 20 69 6e 20 61 20 |ing to u|se in a |
|00001120| 4c 69 73 70 20 70 72 6f | 67 72 61 6d 2e 0a 57 68 |Lisp pro|gram..Wh|
|00001130| 61 74 20 79 6f 75 20 70 | 72 6f 62 61 62 6c 79 20 |at you p|robably |
|00001140| 77 61 6e 74 20 69 73 20 | 61 20 6c 6f 6f 70 20 6c |want is |a loop l|
|00001150| 69 6b 65 20 74 68 69 73 | 3a 0a 20 20 28 77 68 69 |ike this|:. (whi|
|00001160| 6c 65 20 28 73 65 61 72 | 63 68 2d 66 6f 72 77 61 |le (sear|ch-forwa|
|00001170| 72 64 20 46 52 4f 4d 2d | 53 54 52 49 4e 47 20 6e |rd FROM-|STRING n|
|00001180| 69 6c 20 74 29 0a 20 20 | 20 20 28 72 65 70 6c 61 |il t). | (repla|
|00001190| 63 65 2d 6d 61 74 63 68 | 20 54 4f 2d 53 54 52 49 |ce-match| TO-STRI|
|000011a0| 4e 47 20 6e 69 6c 20 74 | 29 29 0a 77 68 69 63 68 |NG nil t|)).which|
|000011b0| 20 77 69 6c 6c 20 72 75 | 6e 20 66 61 73 74 65 72 | will ru|n faster|
|000011c0| 20 61 6e 64 20 77 69 6c | 6c 20 6e 6f 74 20 73 65 | and wil|l not se|
|000011d0| 74 20 74 68 65 20 6d 61 | 72 6b 20 6f 72 20 70 72 |t the ma|rk or pr|
|000011e0| 69 6e 74 20 61 6e 79 74 | 68 69 6e 67 2e 22 20 28 |int anyt|hing." (|
|000011f0| 71 75 65 72 79 2d 72 65 | 70 6c 61 63 65 2d 72 65 |query-re|place-re|
|00001200| 61 64 2d 61 72 67 73 20 | 22 52 65 70 6c 61 63 65 |ad-args |"Replace|
|00001210| 20 73 74 72 69 6e 67 22 | 29 5d 29 0a 28 66 73 65 | string"|)]).(fse|
|00001220| 74 20 27 72 65 70 6c 61 | 63 65 2d 72 65 67 65 78 |t 'repla|ce-regex|
|00001230| 70 20 23 5b 28 72 65 67 | 65 78 70 20 74 6f 2d 73 |p #[(reg|exp to-s|
|00001240| 74 72 69 6e 67 20 26 6f | 70 74 69 6f 6e 61 6c 20 |tring &o|ptional |
|00001250| 64 65 6c 69 6d 69 74 65 | 64 29 20 22 c0 09 5c 6e |delimite|d) "..\n|
|00001260| c3 c4 0d 25 88 0e 06 ae | 83 c7 c8 21 87 22 20 5b |...%....|...!." [|
|00001270| 70 65 72 66 6f 72 6d 2d | 72 65 70 6c 61 63 65 20 |perform-|replace |
|00001280| 72 65 67 65 78 70 20 74 | 6f 2d 73 74 72 69 6e 67 |regexp t|o-string|
|00001290| 20 6e 69 6c 20 74 20 64 | 65 6c 69 6d 69 74 65 64 | nil t d|elimited|
|000012a0| 20 75 6e 72 65 61 64 2d | 63 6f 6d 6d 61 6e 64 2d | unread-|command-|
|000012b0| 65 76 65 6e 74 20 6d 65 | 73 73 61 67 65 20 22 44 |event me|ssage "D|
|000012c0| 6f 6e 65 22 5d 20 36 20 | 22 5c 0a 52 65 70 6c 61 |one"] 6 |"\.Repla|
|000012d0| 63 65 20 74 68 69 6e 67 | 73 20 61 66 74 65 72 20 |ce thing|s after |
|000012e0| 70 6f 69 6e 74 20 6d 61 | 74 63 68 69 6e 67 20 52 |point ma|tching R|
|000012f0| 45 47 45 58 50 20 77 69 | 74 68 20 54 4f 2d 53 54 |EGEXP wi|th TO-ST|
|00001300| 52 49 4e 47 2e 0a 50 72 | 65 73 65 72 76 65 20 63 |RING..Pr|eserve c|
|00001310| 61 73 65 20 69 6e 20 65 | 61 63 68 20 6d 61 74 63 |ase in e|ach matc|
|00001320| 68 20 69 66 20 60 63 61 | 73 65 2d 72 65 70 6c 61 |h if `ca|se-repla|
|00001330| 63 65 27 20 61 6e 64 20 | 60 63 61 73 65 2d 66 6f |ce' and |`case-fo|
|00001340| 6c 64 2d 73 65 61 72 63 | 68 27 0a 61 72 65 20 6e |ld-searc|h'.are n|
|00001350| 6f 6e 2d 6e 69 6c 20 61 | 6e 64 20 52 45 47 45 58 |on-nil a|nd REGEX|
|00001360| 50 20 68 61 73 20 6e 6f | 20 75 70 70 65 72 63 61 |P has no| upperca|
|00001370| 73 65 20 6c 65 74 74 65 | 72 73 2e 0a 54 68 69 72 |se lette|rs..Thir|
|00001380| 64 20 61 72 67 20 44 45 | 4c 49 4d 49 54 45 44 20 |d arg DE|LIMITED |
|00001390| 28 70 72 65 66 69 78 20 | 61 72 67 20 69 66 20 69 |(prefix |arg if i|
|000013a0| 6e 74 65 72 61 63 74 69 | 76 65 29 2c 20 69 66 20 |nteracti|ve), if |
|000013b0| 6e 6f 6e 2d 6e 69 6c 2c | 20 6d 65 61 6e 73 20 72 |non-nil,| means r|
|000013c0| 65 70 6c 61 63 65 0a 6f | 6e 6c 79 20 6d 61 74 63 |eplace.o|nly matc|
|000013d0| 68 65 73 20 73 75 72 72 | 6f 75 6e 64 65 64 20 62 |hes surr|ounded b|
|000013e0| 79 20 77 6f 72 64 20 62 | 6f 75 6e 64 61 72 69 65 |y word b|oundarie|
|000013f0| 73 2e 0a 49 6e 20 54 4f | 2d 53 54 52 49 4e 47 2c |s..In TO|-STRING,|
|00001400| 20 60 5c 5c 26 27 20 73 | 74 61 6e 64 73 20 66 6f | `\\&' s|tands fo|
|00001410| 72 20 77 68 61 74 65 76 | 65 72 20 6d 61 74 63 68 |r whatev|er match|
|00001420| 65 64 20 74 68 65 20 77 | 68 6f 6c 65 20 6f 66 20 |ed the w|hole of |
|00001430| 52 45 47 45 58 50 2c 0a | 61 6e 64 20 60 5c 5c 3d |REGEXP,.|and `\\=|
|00001440| 5c 5c 4e 27 20 28 77 68 | 65 72 65 20 4e 20 69 73 |\\N' (wh|ere N is|
|00001450| 20 61 20 64 69 67 69 74 | 29 20 73 74 61 6e 64 73 | a digit|) stands|
|00001460| 20 66 6f 72 0a 20 77 68 | 61 74 65 76 65 72 20 77 | for. wh|atever w|
|00001470| 68 61 74 20 6d 61 74 63 | 68 65 64 20 74 68 65 20 |hat matc|hed the |
|00001480| 4e 74 68 20 60 5c 5c 28 | 2e 2e 2e 5c 5c 29 27 20 |Nth `\\(|...\\)' |
|00001490| 69 6e 20 52 45 47 45 58 | 50 2e 0a 0a 54 68 69 73 |in REGEX|P...This|
|000014a0| 20 66 75 6e 63 74 69 6f | 6e 20 69 73 20 75 73 75 | functio|n is usu|
|000014b0| 61 6c 6c 79 20 74 68 65 | 20 77 72 6f 6e 67 20 74 |ally the| wrong t|
|000014c0| 68 69 6e 67 20 74 6f 20 | 75 73 65 20 69 6e 20 61 |hing to |use in a|
|000014d0| 20 4c 69 73 70 20 70 72 | 6f 67 72 61 6d 2e 0a 57 | Lisp pr|ogram..W|
|000014e0| 68 61 74 20 79 6f 75 20 | 70 72 6f 62 61 62 6c 79 |hat you |probably|
|000014f0| 20 77 61 6e 74 20 69 73 | 20 61 20 6c 6f 6f 70 20 | want is| a loop |
|00001500| 6c 69 6b 65 20 74 68 69 | 73 3a 0a 20 20 28 77 68 |like thi|s:. (wh|
|00001510| 69 6c 65 20 28 72 65 2d | 73 65 61 72 63 68 2d 66 |ile (re-|search-f|
|00001520| 6f 72 77 61 72 64 20 52 | 45 47 45 58 50 20 6e 69 |orward R|EGEXP ni|
|00001530| 6c 20 74 29 0a 20 20 20 | 20 28 72 65 70 6c 61 63 |l t). | (replac|
|00001540| 65 2d 6d 61 74 63 68 20 | 54 4f 2d 53 54 52 49 4e |e-match |TO-STRIN|
|00001550| 47 20 6e 69 6c 20 6e 69 | 6c 29 29 0a 77 68 69 63 |G nil ni|l)).whic|
|00001560| 68 20 77 69 6c 6c 20 72 | 75 6e 20 66 61 73 74 65 |h will r|un faste|
|00001570| 72 20 61 6e 64 20 77 69 | 6c 6c 20 6e 6f 74 20 73 |r and wi|ll not s|
|00001580| 65 74 20 74 68 65 20 6d | 61 72 6b 20 6f 72 20 70 |et the m|ark or p|
|00001590| 72 69 6e 74 20 61 6e 79 | 74 68 69 6e 67 2e 22 20 |rint any|thing." |
|000015a0| 28 71 75 65 72 79 2d 72 | 65 70 6c 61 63 65 2d 72 |(query-r|eplace-r|
|000015b0| 65 61 64 2d 61 72 67 73 | 20 22 52 65 70 6c 61 63 |ead-args| "Replac|
|000015c0| 65 20 72 65 67 65 78 70 | 22 29 5d 29 0a 28 64 65 |e regexp|")]).(de|
|000015d0| 66 76 61 72 20 72 65 67 | 65 78 70 2d 68 69 73 74 |fvar reg|exp-hist|
|000015e0| 6f 72 79 20 6e 69 6c 20 | 22 5c 0a 48 69 73 74 6f |ory nil |"\.Histo|
|000015f0| 72 79 20 6c 69 73 74 20 | 66 6f 72 20 73 6f 6d 65 |ry list |for some|
|00001600| 20 63 6f 6d 6d 61 6e 64 | 73 20 74 68 61 74 20 72 | command|s that r|
|00001610| 65 61 64 20 72 65 67 75 | 6c 61 72 20 65 78 70 72 |ead regu|lar expr|
|00001620| 65 73 73 69 6f 6e 73 2e | 22 29 0a 28 64 65 66 69 |essions.|").(defi|
|00001630| 6e 65 2d 66 75 6e 63 74 | 69 6f 6e 20 27 6b 65 65 |ne-funct|ion 'kee|
|00001640| 70 2d 6c 69 6e 65 73 20 | 27 64 65 6c 65 74 65 2d |p-lines |'delete-|
|00001650| 6e 6f 6e 2d 6d 61 74 63 | 68 69 6e 67 2d 6c 69 6e |non-matc|hing-lin|
|00001660| 65 73 29 0a 28 66 73 65 | 74 20 27 64 65 6c 65 74 |es).(fse|t 'delet|
|00001670| 65 2d 6e 6f 6e 2d 6d 61 | 74 63 68 69 6e 67 2d 6c |e-non-ma|tching-l|
|00001680| 69 6e 65 73 20 23 5b 28 | 72 65 67 65 78 70 29 20 |ines #[(|regexp) |
|00001690| 22 8a 6e ac 83 c0 79 88 | 60 19 6d 3f ad bb c2 0b |".n...y.|`.m?....|
|000016a0| c4 c5 23 ac 86 09 64 7c | 88 aa 98 8a c6 94 62 88 |..#...d||......b.|
|000016b0| c6 79 88 60 29 1e 07 09 | 0e 07 57 ab 85 09 0e 07 |.y.`)...|..W.....|
|000016c0| 7c 88 29 8a c0 79 88 60 | 29 11 6d ac 4d c6 94 c6 ||.)..y.`|).m.M...|
|000016d0| 95 55 ab 46 c0 75 88 aa | 41 2a 87 22 20 5b 31 20 |.U.F.u..|A*." [1 |
|000016e0| 73 74 61 72 74 20 72 65 | 2d 73 65 61 72 63 68 2d |start re|-search-|
|000016f0| 66 6f 72 77 61 72 64 20 | 72 65 67 65 78 70 20 6e |forward |regexp n|
|00001700| 69 6c 20 6d 6f 76 65 20 | 30 20 65 6e 64 5d 20 34 |il move |0 end] 4|
|00001710| 20 22 5c 0a 44 65 6c 65 | 74 65 20 61 6c 6c 20 6c | "\.Dele|te all l|
|00001720| 69 6e 65 73 20 65 78 63 | 65 70 74 20 74 68 6f 73 |ines exc|ept thos|
|00001730| 65 20 63 6f 6e 74 61 69 | 6e 69 6e 67 20 6d 61 74 |e contai|ning mat|
|00001740| 63 68 65 73 20 66 6f 72 | 20 52 45 47 45 58 50 2e |ches for| REGEXP.|
|00001750| 0a 41 20 6d 61 74 63 68 | 20 73 70 6c 69 74 20 61 |.A match| split a|
|00001760| 63 72 6f 73 73 20 6c 69 | 6e 65 73 20 70 72 65 73 |cross li|nes pres|
|00001770| 65 72 76 65 73 20 61 6c | 6c 20 74 68 65 20 6c 69 |erves al|l the li|
|00001780| 6e 65 73 20 69 74 20 6c | 69 65 73 20 69 6e 2e 0a |nes it l|ies in..|
|00001790| 41 70 70 6c 69 65 73 20 | 74 6f 20 61 6c 6c 20 6c |Applies |to all l|
|000017a0| 69 6e 65 73 20 61 66 74 | 65 72 20 70 6f 69 6e 74 |ines aft|er point|
|000017b0| 2e 22 20 28 62 79 74 65 | 2d 63 6f 64 65 20 22 c0 |." (byte|-code ".|
|000017c0| c1 c2 89 89 c3 25 43 87 | 22 20 5b 72 65 61 64 2d |.....%C.|" [read-|
|000017d0| 66 72 6f 6d 2d 6d 69 6e | 69 62 75 66 66 65 72 20 |from-min|ibuffer |
|000017e0| 22 4b 65 65 70 20 6c 69 | 6e 65 73 20 28 63 6f 6e |"Keep li|nes (con|
|000017f0| 74 61 69 6e 69 6e 67 20 | 6d 61 74 63 68 20 66 6f |taining |match fo|
|00001800| 72 20 72 65 67 65 78 70 | 29 3a 20 22 20 6e 69 6c |r regexp|): " nil|
|00001810| 20 72 65 67 65 78 70 2d | 68 69 73 74 6f 72 79 5d | regexp-|history]|
|00001820| 20 36 29 5d 29 0a 28 64 | 65 66 69 6e 65 2d 66 75 | 6)]).(d|efine-fu|
|00001830| 6e 63 74 69 6f 6e 20 27 | 66 6c 75 73 68 2d 6c 69 |nction '|flush-li|
|00001840| 6e 65 73 20 27 64 65 6c | 65 74 65 2d 6d 61 74 63 |nes 'del|ete-matc|
|00001850| 68 69 6e 67 2d 6c 69 6e | 65 73 29 0a 28 66 73 65 |hing-lin|es).(fse|
|00001860| 74 20 27 64 65 6c 65 74 | 65 2d 6d 61 74 63 68 69 |t 'delet|e-matchi|
|00001870| 6e 67 2d 6c 69 6e 65 73 | 20 23 5b 28 72 65 67 65 |ng-lines| #[(rege|
|00001880| 78 70 29 20 22 8a 6d 3f | ad 99 c0 09 c2 c3 23 ad |xp) ".m?|......#.|
|00001890| 92 8a c4 94 62 88 c4 79 | 88 60 29 c5 79 88 60 7c |....b..y|.`).y.`||
|000018a0| 88 aa 63 29 87 22 20 5b | 72 65 2d 73 65 61 72 63 |..c)." [|re-searc|
|000018b0| 68 2d 66 6f 72 77 61 72 | 64 20 72 65 67 65 78 70 |h-forwar|d regexp|
|000018c0| 20 6e 69 6c 20 74 20 30 | 20 31 5d 20 34 20 22 5c | nil t 0| 1] 4 "\|
|000018d0| 0a 44 65 6c 65 74 65 20 | 6c 69 6e 65 73 20 63 6f |.Delete |lines co|
|000018e0| 6e 74 61 69 6e 69 6e 67 | 20 6d 61 74 63 68 65 73 |ntaining| matches|
|000018f0| 20 66 6f 72 20 52 45 47 | 45 58 50 2e 0a 49 66 20 | for REG|EXP..If |
|00001900| 61 20 6d 61 74 63 68 20 | 69 73 20 73 70 6c 69 74 |a match |is split|
|00001910| 20 61 63 72 6f 73 73 20 | 6c 69 6e 65 73 2c 20 61 | across |lines, a|
|00001920| 6c 6c 20 74 68 65 20 6c | 69 6e 65 73 20 69 74 20 |ll the l|ines it |
|00001930| 6c 69 65 73 20 69 6e 20 | 61 72 65 20 64 65 6c 65 |lies in |are dele|
|00001940| 74 65 64 2e 0a 41 70 70 | 6c 69 65 73 20 74 6f 20 |ted..App|lies to |
|00001950| 6c 69 6e 65 73 20 61 66 | 74 65 72 20 70 6f 69 6e |lines af|ter poin|
|00001960| 74 2e 22 20 28 62 79 74 | 65 2d 63 6f 64 65 20 22 |t." (byt|e-code "|
|00001970| c0 c1 c2 89 89 c3 25 43 | 87 22 20 5b 72 65 61 64 |......%C|." [read|
|00001980| 2d 66 72 6f 6d 2d 6d 69 | 6e 69 62 75 66 66 65 72 |-from-mi|nibuffer|
|00001990| 20 22 46 6c 75 73 68 20 | 6c 69 6e 65 73 20 28 63 | "Flush |lines (c|
|000019a0| 6f 6e 74 61 69 6e 69 6e | 67 20 6d 61 74 63 68 20 |ontainin|g match |
|000019b0| 66 6f 72 20 72 65 67 65 | 78 70 29 3a 20 22 20 6e |for rege|xp): " n|
|000019c0| 69 6c 20 72 65 67 65 78 | 70 2d 68 69 73 74 6f 72 |il regex|p-histor|
|000019d0| 79 5d 20 36 29 5d 29 0a | 28 64 65 66 69 6e 65 2d |y] 6)]).|(define-|
|000019e0| 66 75 6e 63 74 69 6f 6e | 20 27 68 6f 77 2d 6d 61 |function| 'how-ma|
|000019f0| 6e 79 20 27 63 6f 75 6e | 74 2d 6d 61 74 63 68 65 |ny 'coun|t-matche|
|00001a00| 73 29 0a 28 66 73 65 74 | 20 27 63 6f 75 6e 74 2d |s).(fset| 'count-|
|00001a10| 6d 61 74 63 68 65 73 20 | 23 5b 28 72 65 67 65 78 |matches |#[(regex|
|00001a20| 70 29 20 22 c0 c1 1a 1b | 8a 6d ac 98 60 12 c4 0d |p) "....|.m..`...|
|00001a30| c1 c6 23 ab 8f 5c 6e 60 | 55 ab 85 c7 75 88 aa 6a |..#..\n`|U...u..j|
|00001a40| 0b 54 13 aa 65 c8 c9 0b | 5c 22 2b 87 22 20 5b 30 |.T..e...|\"+." [0|
|00001a50| 20 6e 69 6c 20 6f 70 6f | 69 6e 74 20 63 6f 75 6e | nil opo|int coun|
|00001a60| 74 20 72 65 2d 73 65 61 | 72 63 68 2d 66 6f 72 77 |t re-sea|rch-forw|
|00001a70| 61 72 64 20 72 65 67 65 | 78 70 20 74 20 31 20 6d |ard rege|xp t 1 m|
|00001a80| 65 73 73 61 67 65 20 22 | 25 64 20 6f 63 63 75 72 |essage "|%d occur|
|00001a90| 72 65 6e 63 65 73 22 5d | 20 34 20 22 5c 0a 50 72 |rences"]| 4 "\.Pr|
|00001aa0| 69 6e 74 20 6e 75 6d 62 | 65 72 20 6f 66 20 6d 61 |int numb|er of ma|
|00001ab0| 74 63 68 65 73 20 66 6f | 72 20 52 45 47 45 58 50 |tches fo|r REGEXP|
|00001ac0| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 70 6f 69 6e 74 | followi|ng point|
|00001ad0| 2e 22 20 28 62 79 74 65 | 2d 63 6f 64 65 20 22 c0 |." (byte|-code ".|
|00001ae0| c1 c2 89 89 c3 25 43 87 | 22 20 5b 72 65 61 64 2d |.....%C.|" [read-|
|00001af0| 66 72 6f 6d 2d 6d 69 6e | 69 62 75 66 66 65 72 20 |from-min|ibuffer |
|00001b00| 22 48 6f 77 20 6d 61 6e | 79 20 6d 61 74 63 68 65 |"How man|y matche|
|00001b10| 73 20 66 6f 72 20 28 72 | 65 67 65 78 70 29 3a 20 |s for (r|egexp): |
|00001b20| 22 20 6e 69 6c 20 72 65 | 67 65 78 70 2d 68 69 73 |" nil re|gexp-his|
|00001b30| 74 6f 72 79 5d 20 36 29 | 5d 29 0a 28 62 79 74 65 |tory] 6)|]).(byte|
|00001b40| 2d 63 6f 64 65 20 22 c0 | c1 21 ac 82 c2 11 09 ac |-code ".|.!......|
|00001b50| 94 c3 20 11 c4 09 c1 5c | 22 88 c5 09 c6 c7 23 88 |.. ....\|".....#.|
|00001b60| c5 09 c8 c9 23 88 c0 ca | 21 ac 83 c2 16 5c 6e c0 |....#...|!....\n.|
|00001b70| cb 21 ac 83 c2 16 0b c0 | cc 21 ac 83 c2 16 0c c2 |.!......|.!......|
|00001b80| 87 22 20 5b 62 6f 75 6e | 64 70 20 6f 63 63 75 72 |." [boun|dp occur|
|00001b90| 2d 6d 6f 64 65 2d 6d 61 | 70 20 6e 69 6c 20 6d 61 |-mode-ma|p nil ma|
|00001ba0| 6b 65 2d 73 70 61 72 73 | 65 2d 6b 65 79 6d 61 70 |ke-spars|e-keymap|
|00001bb0| 20 73 65 74 2d 6b 65 79 | 6d 61 70 2d 6e 61 6d 65 | set-key|map-name|
|00001bc0| 20 64 65 66 69 6e 65 2d | 6b 65 79 20 22 03 03 22 | define-|key ".."|
|00001bd0| 20 6f 63 63 75 72 2d 6d | 6f 64 65 2d 67 6f 74 6f | occur-m|ode-goto|
|00001be0| 2d 6f 63 63 75 72 72 65 | 6e 63 65 20 62 75 74 74 |-occurre|nce butt|
|00001bf0| 6f 6e 32 20 6f 63 63 75 | 72 2d 6d 6f 64 65 2d 6d |on2 occu|r-mode-m|
|00001c00| 6f 75 73 65 2d 67 6f 74 | 6f 20 6f 63 63 75 72 2d |ouse-got|o occur-|
|00001c10| 62 75 66 66 65 72 20 6f | 63 63 75 72 2d 6e 6c 69 |buffer o|ccur-nli|
|00001c20| 6e 65 73 20 6f 63 63 75 | 72 2d 70 6f 73 2d 6c 69 |nes occu|r-pos-li|
|00001c30| 73 74 5d 20 34 29 0a 28 | 66 73 65 74 20 27 6f 63 |st] 4).(|fset 'oc|
|00001c40| 63 75 72 2d 6d 6f 64 65 | 20 23 5b 6e 69 6c 20 22 |cur-mode| #[nil "|
|00001c50| c0 20 88 c1 5c 6e 21 88 | c3 14 c5 c6 21 16 07 c8 |. ..\n!.|....!...|
|00001c60| c9 21 88 c8 ca 21 88 c8 | cb 21 88 cc cd 21 88 ce |.!...!..|.!...!..|
|00001c70| 16 0f d0 d1 21 87 22 20 | 5b 6b 69 6c 6c 2d 61 6c |....!." |[kill-al|
|00001c80| 6c 2d 6c 6f 63 61 6c 2d | 76 61 72 69 61 62 6c 65 |l-local-|variable|
|00001c90| 73 20 75 73 65 2d 6c 6f | 63 61 6c 2d 6d 61 70 20 |s use-lo|cal-map |
|00001ca0| 6f 63 63 75 72 2d 6d 6f | 64 65 2d 6d 61 70 20 6f |occur-mo|de-map o|
|00001cb0| 63 63 75 72 2d 6d 6f 64 | 65 20 6d 61 6a 6f 72 2d |ccur-mod|e major-|
|00001cc0| 6d 6f 64 65 20 67 65 74 | 74 65 78 74 20 22 4f 63 |mode get|text "Oc|
|00001cd0| 63 75 72 22 20 6d 6f 64 | 65 2d 6e 61 6d 65 20 6d |cur" mod|e-name m|
|00001ce0| 61 6b 65 2d 6c 6f 63 61 | 6c 2d 76 61 72 69 61 62 |ake-loca|l-variab|
|00001cf0| 6c 65 20 6f 63 63 75 72 | 2d 62 75 66 66 65 72 20 |le occur|-buffer |
|00001d00| 6f 63 63 75 72 2d 6e 6c | 69 6e 65 73 20 6f 63 63 |occur-nl|ines occ|
|00001d10| 75 72 2d 70 6f 73 2d 6c | 69 73 74 20 72 65 71 75 |ur-pos-l|ist requ|
|00001d20| 69 72 65 20 6d 6f 64 65 | 2d 6d 6f 74 69 6f 6e 20 |ire mode|-motion |
|00001d30| 6d 6f 64 65 2d 6d 6f 74 | 69 6f 6e 2d 68 69 67 68 |mode-mot|ion-high|
|00001d40| 6c 69 67 68 74 2d 6c 69 | 6e 65 20 6d 6f 64 65 2d |light-li|ne mode-|
|00001d50| 6d 6f 74 69 6f 6e 2d 68 | 6f 6f 6b 20 72 75 6e 2d |motion-h|ook run-|
|00001d60| 68 6f 6f 6b 73 20 6f 63 | 63 75 72 2d 6d 6f 64 65 |hooks oc|cur-mode|
|00001d70| 2d 68 6f 6f 6b 5d 20 32 | 20 22 5c 0a 4d 61 6a 6f |-hook] 2| "\.Majo|
|00001d80| 72 20 6d 6f 64 65 20 66 | 6f 72 20 6f 75 74 70 75 |r mode f|or outpu|
|00001d90| 74 20 66 72 6f 6d 20 5c | 5c 5b 6f 63 63 75 72 5d |t from \|\[occur]|
|00001da0| 2e 0a 4d 6f 76 65 20 70 | 6f 69 6e 74 20 74 6f 20 |..Move p|oint to |
|00001db0| 6f 6e 65 20 6f 66 20 74 | 68 65 20 6f 63 63 75 72 |one of t|he occur|
|00001dc0| 72 65 6e 63 65 73 20 69 | 6e 20 74 68 69 73 20 62 |rences i|n this b|
|00001dd0| 75 66 66 65 72 2c 0a 74 | 68 65 6e 20 75 73 65 20 |uffer,.t|hen use |
|00001de0| 5c 5c 5b 6f 63 63 75 72 | 2d 6d 6f 64 65 2d 67 6f |\\[occur|-mode-go|
|00001df0| 74 6f 2d 6f 63 63 75 72 | 72 65 6e 63 65 5d 20 74 |to-occur|rence] t|
|00001e00| 6f 20 67 6f 20 74 6f 20 | 74 68 65 20 73 61 6d 65 |o go to |the same|
|00001e10| 20 6f 63 63 75 72 72 65 | 6e 63 65 0a 4f 72 20 63 | occurre|nce.Or c|
|00001e20| 6c 69 63 6b 20 5c 5c 3c | 6f 63 63 75 72 2d 6d 6f |lick \\<|occur-mo|
|00001e30| 64 65 2d 6d 61 70 3e 5c | 5c 5b 6f 63 63 75 72 2d |de-map>\|\[occur-|
|00001e40| 6d 6f 64 65 2d 6d 6f 75 | 73 65 2d 67 6f 74 6f 5d |mode-mou|se-goto]|
|00001e50| 20 6f 6e 20 61 6e 20 6f | 63 63 75 72 72 65 6e 63 | on an o|ccurrenc|
|00001e60| 65 20 6c 69 6e 65 2e 0a | 69 6e 20 74 68 65 20 62 |e line..|in the b|
|00001e70| 75 66 66 65 72 20 74 68 | 61 74 20 74 68 65 20 6f |uffer th|at the o|
|00001e80| 63 63 75 72 72 65 6e 63 | 65 73 20 77 65 72 65 20 |ccurrenc|es were |
|00001e90| 66 6f 75 6e 64 20 69 6e | 2e 0a 5c 5c 7b 6f 63 63 |found in|..\\{occ|
|00001ea0| 75 72 2d 6d 6f 64 65 2d | 6d 61 70 7d 22 5d 29 0a |ur-mode-|map}"]).|
|00001eb0| 28 66 73 65 74 20 27 6f | 63 63 75 72 2d 6d 6f 64 |(fset 'o|ccur-mod|
|00001ec0| 65 2d 6d 6f 75 73 65 2d | 67 6f 74 6f 20 23 5b 28 |e-mouse-|goto #[(|
|00001ed0| 65 29 20 22 c0 20 c1 20 | 1a 1b c4 8e c5 0e 06 21 |e) ". . |.......!|
|00001ee0| 88 c7 20 2b 87 22 20 5b | 73 65 6c 65 63 74 65 64 |.. +." [|selected|
|00001ef0| 2d 77 69 6e 64 6f 77 20 | 73 65 6c 65 63 74 65 64 |-window |selected|
|00001f00| 2d 66 72 61 6d 65 20 66 | 72 61 6d 65 2d 73 61 76 |-frame f|rame-sav|
|00001f10| 65 20 77 69 6e 64 6f 77 | 2d 73 61 76 65 20 28 28 |e window|-save ((|
|00001f20| 62 79 74 65 2d 63 6f 64 | 65 20 22 c0 09 21 88 c2 |byte-cod|e "..!..|
|00001f30| 0b 21 87 22 20 5b 73 65 | 6c 65 63 74 2d 66 72 61 |.!." [se|lect-fra|
|00001f40| 6d 65 20 66 72 61 6d 65 | 2d 73 61 76 65 20 73 65 |me frame|-save se|
|00001f50| 6c 65 63 74 2d 77 69 6e | 64 6f 77 20 77 69 6e 64 |lect-win|dow wind|
|00001f60| 6f 77 2d 73 61 76 65 5d | 20 32 29 29 20 6d 6f 75 |ow-save]| 2)) mou|
|00001f70| 73 65 2d 73 65 74 2d 70 | 6f 69 6e 74 20 65 20 6f |se-set-p|oint e o|
|00001f80| 63 63 75 72 2d 6d 6f 64 | 65 2d 67 6f 74 6f 2d 6f |ccur-mod|e-goto-o|
|00001f90| 63 63 75 72 72 65 6e 63 | 65 5d 20 32 20 22 5c 0a |ccurrenc|e] 2 "\.|
|00001fa0| 67 6f 20 74 6f 20 6f 63 | 63 75 72 65 6e 63 65 20 |go to oc|curence |
|00001fb0| 68 69 67 68 6c 69 67 68 | 74 65 64 20 62 79 20 6d |highligh|ted by m|
|00001fc0| 6f 75 73 65 2e 20 20 54 | 68 69 73 20 66 75 6e 63 |ouse. T|his func|
|00001fd0| 74 69 6f 6e 20 69 73 20 | 6f 6e 6c 79 20 72 65 61 |tion is |only rea|
|00001fe0| 73 6f 6e 61 62 6c 65 20 | 77 68 65 6e 20 62 6f 75 |sonable |when bou|
|00001ff0| 6e 64 0a 74 6f 20 61 20 | 6d 6f 75 73 65 20 6b 65 |nd.to a |mouse ke|
|00002000| 79 20 69 6e 20 74 68 65 | 20 6f 63 63 75 72 20 62 |y in the| occur b|
|00002010| 75 66 66 65 72 22 20 22 | 65 22 5d 29 0a 28 66 73 |uffer" "|e"]).(fs|
|00002020| 65 74 20 27 6f 63 63 75 | 72 2d 6d 6f 64 65 2d 67 |et 'occu|r-mode-g|
|00002030| 6f 74 6f 2d 6f 63 63 75 | 72 72 65 6e 63 65 20 23 |oto-occu|rrence #|
|00002040| 5b 6e 69 6c 20 22 08 ab | 85 c1 08 21 ac 88 c2 10 |[nil "..|...!....|
|00002050| c2 13 c4 c5 21 88 c6 65 | 8a c7 79 88 60 29 5c 22 |....!..e|..y.`)\"|
|00002060| 1e 08 8a c7 79 88 0e 08 | 53 0e 09 c7 57 ab 86 ca |....y...|S...W...|
|00002070| 0e 09 5a aa 8f 0e 09 c7 | 56 ab 88 0e 09 89 5c 5c |..Z.....|V.....\\|
|00002080| ca 5c 5c aa 81 cb a5 29 | 89 1e 0c 0b 38 1e 0d ce |.\\....)|....8...|
|00002090| 08 cf 5c 22 1e 10 08 1e | 11 0e 08 cb 57 ab 84 c4 |..\"....|....W...|
|000020a0| d2 21 88 0e 0d ac 84 c4 | d2 21 88 0e 10 ab 93 d3 |.!......|.!......|
|000020b0| 0e 10 21 ab 8d d4 d5 0e | 10 21 21 ab 85 0e 11 71 |..!.....|.!!....q|
|000020c0| ac 8d d6 0e 11 21 ab 87 | ce 0e 11 cf 5c 22 16 10 |.....!..|....\"..|
|000020d0| 0e 0d 62 88 d7 0e 10 0e | 0d 5c 22 2d 87 22 20 5b |..b.....|.\"-." [|
|000020e0| 6f 63 63 75 72 2d 62 75 | 66 66 65 72 20 62 75 66 |occur-bu|ffer buf|
|000020f0| 66 65 72 2d 6e 61 6d 65 | 20 6e 69 6c 20 6f 63 63 |fer-name| nil occ|
|00002100| 75 72 2d 70 6f 73 2d 6c | 69 73 74 20 65 72 72 6f |ur-pos-l|ist erro|
|00002110| 72 20 22 42 75 66 66 65 | 72 20 69 6e 20 77 68 69 |r "Buffe|r in whi|
|00002120| 63 68 20 6f 63 63 75 72 | 72 65 6e 63 65 73 20 77 |ch occur|rences w|
|00002130| 65 72 65 20 66 6f 75 6e | 64 20 69 73 20 64 65 6c |ere foun|d is del|
|00002140| 65 74 65 64 22 20 63 6f | 75 6e 74 2d 6c 69 6e 65 |eted" co|unt-line|
|00002150| 73 20 30 20 6c 69 6e 65 | 2d 63 6f 75 6e 74 20 6f |s 0 line|-count o|
|00002160| 63 63 75 72 2d 6e 6c 69 | 6e 65 73 20 32 20 31 20 |ccur-nli|nes 2 1 |
|00002170| 6f 63 63 75 72 2d 6e 75 | 6d 62 65 72 20 70 6f 73 |occur-nu|mber pos|
|00002180| 20 67 65 74 2d 62 75 66 | 66 65 72 2d 77 69 6e 64 | get-buf|fer-wind|
|00002190| 6f 77 20 74 20 77 69 6e | 64 6f 77 20 6f 63 63 75 |ow t win|dow occu|
|000021a0| 72 2d 73 6f 75 72 63 65 | 2d 62 75 66 66 65 72 20 |r-source|-buffer |
|000021b0| 22 4e 6f 20 6f 63 63 75 | 72 72 65 6e 63 65 20 6f |"No occu|rrence o|
|000021c0| 6e 20 74 68 69 73 20 6c | 69 6e 65 22 20 77 69 6e |n this l|ine" win|
|000021d0| 64 6f 77 2d 6c 69 76 65 | 2d 70 20 66 72 61 6d 65 |dow-live|-p frame|
|000021e0| 2d 76 69 73 69 62 6c 65 | 2d 70 20 77 69 6e 64 6f |-visible|-p windo|
|000021f0| 77 2d 66 72 61 6d 65 20 | 70 6f 70 2d 74 6f 2d 62 |w-frame |pop-to-b|
|00002200| 75 66 66 65 72 20 73 65 | 74 2d 77 69 6e 64 6f 77 |uffer se|t-window|
|00002210| 2d 70 6f 69 6e 74 5d 20 | 34 20 22 5c 0a 47 6f 20 |-point] |4 "\.Go |
|00002220| 74 6f 20 74 68 65 20 6f | 63 63 75 72 72 65 6e 63 |to the o|ccurrenc|
|00002230| 65 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 6c 69 |e the cu|rrent li|
|00002240| 6e 65 20 64 65 73 63 72 | 69 62 65 73 2e 22 20 6e |ne descr|ibes." n|
|00002250| 69 6c 5d 29 0a 28 64 65 | 66 76 61 72 20 6c 69 73 |il]).(de|fvar lis|
|00002260| 74 2d 6d 61 74 63 68 69 | 6e 67 2d 6c 69 6e 65 73 |t-matchi|ng-lines|
|00002270| 2d 64 65 66 61 75 6c 74 | 2d 63 6f 6e 74 65 78 74 |-default|-context|
|00002280| 2d 6c 69 6e 65 73 20 30 | 20 22 5c 0a 2a 44 65 66 |-lines 0| "\.*Def|
|00002290| 61 75 6c 74 20 6e 75 6d | 62 65 72 20 6f 66 20 63 |ault num|ber of c|
|000022a0| 6f 6e 74 65 78 74 20 6c | 69 6e 65 73 20 74 6f 20 |ontext l|ines to |
|000022b0| 69 6e 63 6c 75 64 65 20 | 61 72 6f 75 6e 64 20 61 |include |around a|
|000022c0| 20 60 6c 69 73 74 2d 6d | 61 74 63 68 69 6e 67 2d | `list-m|atching-|
|000022d0| 6c 69 6e 65 73 27 0a 6d | 61 74 63 68 2e 20 20 41 |lines'.m|atch. A|
|000022e0| 20 6e 65 67 61 74 69 76 | 65 20 6e 75 6d 62 65 72 | negativ|e number|
|000022f0| 20 6d 65 61 6e 73 20 74 | 6f 20 69 6e 63 6c 75 64 | means t|o includ|
|00002300| 65 20 74 68 61 74 20 6d | 61 6e 79 20 6c 69 6e 65 |e that m|any line|
|00002310| 73 20 62 65 66 6f 72 65 | 20 74 68 65 20 6d 61 74 |s before| the mat|
|00002320| 63 68 2e 0a 41 20 70 6f | 73 69 74 69 76 65 20 6e |ch..A po|sitive n|
|00002330| 75 6d 62 65 72 20 6d 65 | 61 6e 73 20 74 6f 20 69 |umber me|ans to i|
|00002340| 6e 63 6c 75 64 65 20 74 | 68 61 74 20 6d 61 6e 79 |nclude t|hat many|
|00002350| 20 6c 69 6e 65 73 20 62 | 6f 74 68 20 62 65 66 6f | lines b|oth befo|
|00002360| 72 65 20 61 6e 64 20 61 | 66 74 65 72 2e 22 29 0a |re and a|fter.").|
|00002370| 28 64 65 66 76 61 72 20 | 6c 69 73 74 2d 6d 61 74 |(defvar |list-mat|
|00002380| 63 68 69 6e 67 2d 6c 69 | 6e 65 73 2d 77 68 6f 6c |ching-li|nes-whol|
|00002390| 65 2d 62 75 66 66 65 72 | 20 74 20 22 5c 0a 49 66 |e-buffer| t "\.If|
|000023a0| 20 74 2c 20 6f 63 63 75 | 72 20 6f 70 65 72 61 74 | t, occu|r operat|
|000023b0| 65 73 20 6f 6e 20 77 68 | 6f 6c 65 20 62 75 66 66 |es on wh|ole buff|
|000023c0| 65 72 2c 20 6f 74 68 65 | 72 77 69 73 65 20 6f 63 |er, othe|rwise oc|
|000023d0| 63 75 72 20 73 74 61 72 | 74 73 20 66 72 6f 6d 20 |cur star|ts from |
|000023e0| 70 6f 69 6e 74 2e 0a 64 | 65 66 61 75 6c 74 20 69 |point..d|efault i|
|000023f0| 73 20 6e 69 6c 2e 22 29 | 0a 28 64 65 66 69 6e 65 |s nil.")|.(define|
|00002400| 2d 66 75 6e 63 74 69 6f | 6e 20 27 6f 63 63 75 72 |-functio|n 'occur|
|00002410| 20 27 6c 69 73 74 2d 6d | 61 74 63 68 69 6e 67 2d | 'list-m|atching-|
|00002420| 6c 69 6e 65 73 29 0a 28 | 66 73 65 74 20 27 6c 69 |lines).(|fset 'li|
|00002430| 73 74 2d 6d 61 74 63 68 | 69 6e 67 2d 6c 69 6e 65 |st-match|ing-line|
|00002440| 73 20 23 5b 28 72 65 67 | 65 78 70 20 26 6f 70 74 |s #[(reg|exp &opt|
|00002450| 69 6f 6e 61 6c 20 6e 6c | 69 6e 65 73 29 20 22 08 |ional nl|ines) ".|
|00002460| c1 9a ab 84 c2 c3 21 88 | 0c ab 85 c5 0c 21 aa 82 |......!.|.....!..|
|00002470| 0e 06 14 c7 70 c8 65 c9 | 20 1e 5c 6e 1e 0b 1e 0c |....p.e.| .\n....|
|00002480| 1e 0d 1e 0e 0e 0f ac 8f | 8a d0 79 88 d1 65 60 5c |........|..y..e`\|
|00002490| 22 54 16 0c 60 16 0b 29 | d2 90 8a 0e 13 71 88 d4 |"T..`..)|.....q..|
|000024a0| d5 08 d6 0e 0d 21 23 63 | 88 d7 20 88 0e 0d 16 18 |.....!#c|.. .....|
|000024b0| 0c 16 19 da 16 1b 29 0e | 0d 0e 13 3d ab 83 64 62 |......).|...=..db|
|000024c0| 88 8a 0e 0f ab 83 dc 20 | 88 dd d4 de 08 5c 22 21 |....... |.....\"!|
|000024d0| 88 0e 0b 64 55 84 86 01 | df 08 da c7 23 83 86 01 |...dU...|....#...|
|000024e0| d0 94 62 88 d0 79 88 e0 | 20 1e 21 e2 8e 0e 0c d1 |..b..y..| .!.....|
|000024f0| 0e 0b 60 5c 22 5c 5c 16 | 0c 2a 60 16 0b d0 95 62 |..`\"\\.|.*`....b|
|00002500| 88 8a d0 94 62 88 0c d0 | 57 ab 83 0c aa 82 0c 5b |....b...|W......[|
|00002510| 79 88 60 29 1e 23 8a d0 | 95 62 88 0c d0 56 ab 86 |y.`).#..|.b...V..|
|00002520| 0c 54 79 88 aa 83 c8 79 | 88 60 29 1e 24 d4 e5 0e |.Ty....y|.`).$...|
|00002530| 0c 5c 22 1e 26 e7 0e 26 | 47 e8 5c 22 1e 29 da 1e |.\".&..&|G.\".)..|
|00002540| 2a 8a c9 20 89 16 2a 60 | da 93 88 0e 13 71 88 0e |*.. ..*`|.....q..|
|00002550| 2a 0e 1b 42 16 1b 0e 0e | ac 88 eb 0c 21 ac 83 ec |*..B....|....!...|
|00002560| 63 88 da 16 0e ed 0e 0d | 0e 23 0e 24 23 88 ee 0e |c.......|.#.$#...|
|00002570| 24 0e 23 5a 21 88 0c d0 | 57 ab 84 0c 5b aa 81 0c |$.#Z!...|W...[...|
|00002580| 89 16 2a d0 56 ab 91 0e | 29 ef b1 02 88 c8 79 88 |..*.V...|).....y.|
|00002590| 0e 2a 53 89 16 2a aa 6b | 0e 0c 1e 30 0e 5c 6e 60 |.*S..*.k|...0.\n`|
|000025a0| d0 95 d0 94 5a 5c 5c da | 93 88 60 0e 5c 6e 57 ab |....Z\\.|..`.\nW.|
|000025b0| 9e 0e 26 ac 87 d4 e5 0e | 30 5c 22 16 26 0e 26 ef |..&.....|0\".&.&.|
|000025c0| b1 02 88 da 16 26 c8 79 | 88 0e 30 54 16 30 aa 5c |.....&.y|..0T.0.\|
|000025d0| 5c 29 0e 2a 0c 57 ab 91 | 0e 29 ef b1 02 88 c8 79 |\).*.W..|.).....y|
|000025e0| 88 0e 2a 54 89 16 2a aa | 6b 29 c8 79 88 2d 82 6f |..*T..*.|k).y.-.o|
|000025f0| 00 0e 13 71 88 0e 1b 9f | 16 1b 74 ad 86 dd f1 0e |...q....|..t.....|
|00002600| 1b 47 5c 22 29 91 2d 87 | 22 20 5b 72 65 67 65 78 |.G\").-.|" [regex|
|00002610| 70 20 22 22 20 65 72 72 | 6f 72 20 22 4d 75 73 74 |p "" err|or "Must|
|00002620| 20 70 61 73 73 20 6e 6f | 6e 2d 65 6d 70 74 79 20 | pass no|n-empty |
|00002630| 72 65 67 65 78 70 20 74 | 6f 20 60 6c 69 73 74 2d |regexp t|o `list-|
|00002640| 6d 61 74 63 68 69 6e 67 | 2d 6c 69 6e 65 73 27 22 |matching|-lines'"|
|00002650| 20 6e 6c 69 6e 65 73 20 | 70 72 65 66 69 78 2d 6e | nlines |prefix-n|
|00002660| 75 6d 65 72 69 63 2d 76 | 61 6c 75 65 20 6c 69 73 |umeric-v|alue lis|
|00002670| 74 2d 6d 61 74 63 68 69 | 6e 67 2d 6c 69 6e 65 73 |t-matchi|ng-lines|
|00002680| 2d 64 65 66 61 75 6c 74 | 2d 63 6f 6e 74 65 78 74 |-default|-context|
|00002690| 2d 6c 69 6e 65 73 20 74 | 20 31 20 6d 61 6b 65 2d |-lines t| 1 make-|
|000026a0| 6d 61 72 6b 65 72 20 66 | 69 6e 61 6c 2d 63 6f 6e |marker f|inal-con|
|000026b0| 74 65 78 74 2d 73 74 61 | 72 74 20 70 72 65 76 70 |text-sta|rt prevp|
|000026c0| 6f 73 20 6c 69 6e 65 6e | 75 6d 20 62 75 66 66 65 |os linen|um buffe|
|000026d0| 72 20 66 69 72 73 74 20 | 6c 69 73 74 2d 6d 61 74 |r first |list-mat|
|000026e0| 63 68 69 6e 67 2d 6c 69 | 6e 65 73 2d 77 68 6f 6c |ching-li|nes-whol|
|000026f0| 65 2d 62 75 66 66 65 72 | 20 30 20 63 6f 75 6e 74 |e-buffer| 0 count|
|00002700| 2d 6c 69 6e 65 73 20 22 | 2a 4f 63 63 75 72 2a 22 |-lines "|*Occur*"|
|00002710| 20 73 74 61 6e 64 61 72 | 64 2d 6f 75 74 70 75 74 | standar|d-output|
|00002720| 20 66 6f 72 6d 61 74 20 | 22 4c 69 6e 65 73 20 6d | format |"Lines m|
|00002730| 61 74 63 68 69 6e 67 20 | 25 73 20 69 6e 20 62 75 |atching |%s in bu|
|00002740| 66 66 65 72 20 25 73 2e | 5c 6e 22 20 62 75 66 66 |ffer %s.|\n" buff|
|00002750| 65 72 2d 6e 61 6d 65 20 | 6f 63 63 75 72 2d 6d 6f |er-name |occur-mo|
|00002760| 64 65 20 6f 63 63 75 72 | 2d 62 75 66 66 65 72 20 |de occur|-buffer |
|00002770| 6f 63 63 75 72 2d 6e 6c | 69 6e 65 73 20 6e 69 6c |occur-nl|ines nil|
|00002780| 20 6f 63 63 75 72 2d 70 | 6f 73 2d 6c 69 73 74 20 | occur-p|os-list |
|00002790| 62 65 67 69 6e 6e 69 6e | 67 2d 6f 66 2d 62 75 66 |beginnin|g-of-buf|
|000027a0| 66 65 72 20 6d 65 73 73 | 61 67 65 20 22 53 65 61 |fer mess|age "Sea|
|000027b0| 72 63 68 69 6e 67 20 66 | 6f 72 20 25 73 20 2e 2e |rching f|or %s ..|
|000027c0| 2e 22 20 72 65 2d 73 65 | 61 72 63 68 2d 66 6f 72 |." re-se|arch-for|
|000027d0| 77 61 72 64 20 6d 61 74 | 63 68 2d 64 61 74 61 20 |ward mat|ch-data |
|000027e0| 5f 6d 61 74 63 68 5f 64 | 61 74 61 5f 20 28 28 73 |_match_d|ata_ ((s|
|000027f0| 74 6f 72 65 2d 6d 61 74 | 63 68 2d 64 61 74 61 20 |tore-mat|ch-data |
|00002800| 5f 6d 61 74 63 68 5f 64 | 61 74 61 5f 29 29 20 73 |_match_d|ata_)) s|
|00002810| 74 61 72 74 20 65 6e 64 | 20 22 25 33 64 22 20 74 |tart end| "%3d" t|
|00002820| 61 67 20 6d 61 6b 65 2d | 73 74 72 69 6e 67 20 33 |ag make-|string 3|
|00002830| 32 20 65 6d 70 74 79 20 | 74 65 6d 20 7a 65 72 6f |2 empty |tem zero|
|00002840| 70 20 22 2d 2d 2d 2d 2d | 2d 2d 2d 5c 6e 22 20 69 |p "-----|---\n" i|
|00002850| 6e 73 65 72 74 2d 62 75 | 66 66 65 72 2d 73 75 62 |nsert-bu|ffer-sub|
|00002860| 73 74 72 69 6e 67 20 62 | 61 63 6b 77 61 72 64 2d |string b|ackward-|
|00002870| 63 68 61 72 20 35 38 20 | 74 68 69 73 2d 6c 69 6e |char 58 |this-lin|
|00002880| 65 6e 75 6d 20 22 25 64 | 20 6d 61 74 63 68 69 6e |enum "%d| matchin|
|00002890| 67 20 6c 69 6e 65 73 2e | 22 5d 20 37 20 22 5c 0a |g lines.|"] 7 "\.|
|000028a0| 53 68 6f 77 20 61 6c 6c | 20 6c 69 6e 65 73 20 69 |Show all| lines i|
|000028b0| 6e 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 62 75 |n the cu|rrent bu|
|000028c0| 66 66 65 72 20 63 6f 6e | 74 61 69 6e 69 6e 67 20 |ffer con|taining |
|000028d0| 61 20 6d 61 74 63 68 20 | 66 6f 72 20 52 45 47 45 |a match |for REGE|
|000028e0| 58 50 2e 0a 0a 49 66 20 | 61 20 6d 61 74 63 68 20 |XP...If |a match |
|000028f0| 73 70 72 65 61 64 73 20 | 61 63 72 6f 73 73 20 6d |spreads |across m|
|00002900| 75 6c 74 69 70 6c 65 20 | 6c 69 6e 65 73 2c 20 61 |ultiple |lines, a|
|00002910| 6c 6c 20 74 68 6f 73 65 | 20 6c 69 6e 65 73 20 61 |ll those| lines a|
|00002920| 72 65 20 73 68 6f 77 6e | 2e 0a 0a 49 66 20 76 61 |re shown|...If va|
|00002930| 72 69 61 62 6c 65 20 60 | 6c 69 73 74 2d 6d 61 74 |riable `|list-mat|
|00002940| 63 68 69 6e 67 2d 6c 69 | 6e 65 73 2d 77 68 6f 6c |ching-li|nes-whol|
|00002950| 65 2d 62 75 66 66 65 72 | 27 20 69 73 20 6e 6f 6e |e-buffer|' is non|
|00002960| 2d 6e 69 6c 2c 20 74 68 | 65 20 65 6e 74 69 72 65 |-nil, th|e entire|
|00002970| 20 62 75 66 66 65 72 20 | 69 73 0a 73 65 61 72 63 | buffer |is.searc|
|00002980| 68 65 64 2c 20 6f 74 68 | 65 72 77 69 73 65 20 73 |hed, oth|erwise s|
|00002990| 65 61 72 63 68 20 62 65 | 67 69 6e 73 20 61 74 20 |earch be|gins at |
|000029a0| 70 6f 69 6e 74 2e 0a 0a | 45 61 63 68 20 6c 69 6e |point...|Each lin|
|000029b0| 65 20 69 73 20 64 69 73 | 70 6c 61 79 65 64 20 77 |e is dis|played w|
|000029c0| 69 74 68 20 4e 4c 49 4e | 45 53 20 6c 69 6e 65 73 |ith NLIN|ES lines|
|000029d0| 20 62 65 66 6f 72 65 20 | 61 6e 64 20 61 66 74 65 | before |and afte|
|000029e0| 72 2c 0a 6f 72 20 2d 4e | 4c 49 4e 45 53 20 62 65 |r,.or -N|LINES be|
|000029f0| 66 6f 72 65 20 69 66 20 | 4e 4c 49 4e 45 53 20 69 |fore if |NLINES i|
|00002a00| 73 20 6e 65 67 61 74 69 | 76 65 2e 0a 4e 4c 49 4e |s negati|ve..NLIN|
|00002a10| 45 53 20 64 65 66 61 75 | 6c 74 73 20 74 6f 20 60 |ES defau|lts to `|
|00002a20| 6c 69 73 74 2d 6d 61 74 | 63 68 69 6e 67 2d 6c 69 |list-mat|ching-li|
|00002a30| 6e 65 73 2d 64 65 66 61 | 75 6c 74 2d 63 6f 6e 74 |nes-defa|ult-cont|
|00002a40| 65 78 74 2d 6c 69 6e 65 | 73 27 2e 0a 49 6e 74 65 |ext-line|s'..Inte|
|00002a50| 72 61 63 74 69 76 65 6c | 79 20 69 74 20 69 73 20 |ractivel|y it is |
|00002a60| 74 68 65 20 70 72 65 66 | 69 78 20 61 72 67 2e 0a |the pref|ix arg..|
|00002a70| 0a 54 68 65 20 6c 69 6e | 65 73 20 61 72 65 20 73 |.The lin|es are s|
|00002a80| 68 6f 77 6e 20 69 6e 20 | 61 20 62 75 66 66 65 72 |hown in |a buffer|
|00002a90| 20 6e 61 6d 65 64 20 60 | 2a 4f 63 63 75 72 2a 27 | named `|*Occur*'|
|00002aa0| 2e 0a 49 74 20 73 65 72 | 76 65 73 20 61 73 20 61 |..It ser|ves as a|
|00002ab0| 20 6d 65 6e 75 20 74 6f | 20 66 69 6e 64 20 61 6e | menu to| find an|
|00002ac0| 79 20 6f 66 20 74 68 65 | 20 6f 63 63 75 72 72 65 |y of the| occurre|
|00002ad0| 6e 63 65 73 20 69 6e 20 | 74 68 69 73 20 62 75 66 |nces in |this buf|
|00002ae0| 66 65 72 2e 0a 5c 5c 5b | 64 65 73 63 72 69 62 65 |fer..\\[|describe|
|00002af0| 2d 6d 6f 64 65 5d 20 69 | 6e 20 74 68 61 74 20 62 |-mode] i|n that b|
|00002b00| 75 66 66 65 72 20 77 69 | 6c 6c 20 65 78 70 6c 61 |uffer wi|ll expla|
|00002b10| 69 6e 20 68 6f 77 2e 22 | 20 28 62 79 74 65 2d 63 |in how."| (byte-c|
|00002b20| 6f 64 65 20 22 c0 20 ae | 85 09 ad 82 09 40 1a c3 |ode ". .|.....@..|
|00002b30| 1c 5c 6e ab 8c c5 c6 c7 | 5c 6e 5c 22 c8 89 89 c1 |.\n.....|\n\"....|
|00002b40| 25 aa 87 c5 c9 c8 89 89 | c1 25 89 1e 5c 6e cb 9a |%.......|.%..\n..|
|00002b50| ab 8a 5c 6e ab 87 5c 6e | 16 5c 6e 09 5c 6e a0 88 |..\n..\n|.\n.\n..|
|00002b60| 09 cc 09 40 09 41 5c 22 | a1 88 0e 5c 6e 2b 0e 0d |...@.A\"|...\n+..|
|00002b70| 44 87 22 20 5b 73 79 6d | 62 6f 6c 2d 6e 65 61 72 |D." [sym|bol-near|
|00002b80| 2d 70 6f 69 6e 74 20 72 | 65 67 65 78 70 2d 68 69 |-point r|egexp-hi|
|00002b90| 73 74 6f 72 79 20 64 65 | 66 61 75 6c 74 20 30 20 |story de|fault 0 |
|00002ba0| 6d 69 6e 69 62 75 66 66 | 65 72 2d 68 69 73 74 6f |minibuff|er-histo|
|00002bb0| 72 79 2d 6d 69 6e 69 6d | 75 6d 2d 73 74 72 69 6e |ry-minim|um-strin|
|00002bc0| 67 2d 6c 65 6e 67 74 68 | 20 72 65 61 64 2d 66 72 |g-length| read-fr|
|00002bd0| 6f 6d 2d 6d 69 6e 69 62 | 75 66 66 65 72 20 66 6f |om-minib|uffer fo|
|00002be0| 72 6d 61 74 20 22 4c 69 | 73 74 20 6c 69 6e 65 73 |rmat "Li|st lines|
|00002bf0| 20 6d 61 74 63 68 69 6e | 67 20 72 65 67 65 78 70 | matchin|g regexp|
|00002c00| 20 28 64 65 66 61 75 6c | 74 20 60 25 73 27 29 3a | (defaul|t `%s'):|
|00002c10| 20 22 20 6e 69 6c 20 22 | 4c 69 73 74 20 6c 69 6e | " nil "|List lin|
|00002c20| 65 73 20 6d 61 74 63 68 | 69 6e 67 20 72 65 67 65 |es match|ing rege|
|00002c30| 78 70 3a 20 22 20 69 6e | 70 75 74 20 22 22 20 64 |xp: " in|put "" d|
|00002c40| 65 6c 65 74 65 20 63 75 | 72 72 65 6e 74 2d 70 72 |elete cu|rrent-pr|
|00002c50| 65 66 69 78 2d 61 72 67 | 5d 20 37 29 5d 29 0a 28 |efix-arg|] 7)]).(|
|00002c60| 64 65 66 76 61 72 20 71 | 75 65 72 79 2d 72 65 70 |defvar q|uery-rep|
|00002c70| 6c 61 63 65 2d 68 65 6c | 70 20 28 70 75 72 65 63 |lace-hel|p (purec|
|00002c80| 6f 70 79 20 22 54 79 70 | 65 20 53 70 61 63 65 20 |opy "Typ|e Space |
|00002c90| 6f 72 20 60 79 27 20 74 | 6f 20 72 65 70 6c 61 63 |or `y' t|o replac|
|00002ca0| 65 20 6f 6e 65 20 6d 61 | 74 63 68 2c 20 44 65 6c |e one ma|tch, Del|
|00002cb0| 65 74 65 20 6f 72 20 60 | 6e 27 20 74 6f 20 73 6b |ete or `|n' to sk|
|00002cc0| 69 70 20 74 6f 20 6e 65 | 78 74 2c 5c 6e 52 45 54 |ip to ne|xt,\nRET|
|00002cd0| 20 6f 72 20 60 71 27 20 | 74 6f 20 65 78 69 74 2c | or `q' |to exit,|
|00002ce0| 20 50 65 72 69 6f 64 20 | 74 6f 20 72 65 70 6c 61 | Period |to repla|
|00002cf0| 63 65 20 6f 6e 65 20 6d | 61 74 63 68 20 61 6e 64 |ce one m|atch and|
|00002d00| 20 65 78 69 74 2c 5c 6e | 43 6f 6d 6d 61 20 74 6f | exit,\n|Comma to|
|00002d10| 20 72 65 70 6c 61 63 65 | 20 62 75 74 20 6e 6f 74 | replace| but not|
|00002d20| 20 6d 6f 76 65 20 70 6f | 69 6e 74 20 69 6d 6d 65 | move po|int imme|
|00002d30| 64 69 61 74 65 6c 79 2c | 5c 6e 43 2d 72 20 74 6f |diately,|\nC-r to|
|00002d40| 20 65 6e 74 65 72 20 72 | 65 63 75 72 73 69 76 65 | enter r|ecursive|
|00002d50| 20 65 64 69 74 20 28 5c | 5c 5b 65 78 69 74 2d 72 | edit (\|\[exit-r|
|00002d60| 65 63 75 72 73 69 76 65 | 2d 65 64 69 74 5d 20 74 |ecursive|-edit] t|
|00002d70| 6f 20 67 65 74 20 6f 75 | 74 20 61 67 61 69 6e 29 |o get ou|t again)|
|00002d80| 2c 5c 6e 43 2d 77 20 74 | 6f 20 64 65 6c 65 74 65 |,\nC-w t|o delete|
|00002d90| 20 6d 61 74 63 68 20 61 | 6e 64 20 72 65 63 75 72 | match a|nd recur|
|00002da0| 73 69 76 65 20 65 64 69 | 74 2c 5c 6e 43 2d 6c 20 |sive edi|t,\nC-l |
|00002db0| 74 6f 20 63 6c 65 61 72 | 20 74 68 65 20 66 72 61 |to clear| the fra|
|00002dc0| 6d 65 2c 20 72 65 64 69 | 73 70 6c 61 79 2c 20 61 |me, redi|splay, a|
|00002dd0| 6e 64 20 6f 66 66 65 72 | 20 73 61 6d 65 20 72 65 |nd offer| same re|
|00002de0| 70 6c 61 63 65 6d 65 6e | 74 20 61 67 61 69 6e 2c |placemen|t again,|
|00002df0| 5c 6e 21 20 74 6f 20 72 | 65 70 6c 61 63 65 20 61 |\n! to r|eplace a|
|00002e00| 6c 6c 20 72 65 6d 61 69 | 6e 69 6e 67 20 6d 61 74 |ll remai|ning mat|
|00002e10| 63 68 65 73 20 77 69 74 | 68 20 6e 6f 20 6d 6f 72 |ches wit|h no mor|
|00002e20| 65 20 71 75 65 73 74 69 | 6f 6e 73 2c 5c 6e 5e 20 |e questi|ons,\n^ |
|00002e30| 74 6f 20 6d 6f 76 65 20 | 70 6f 69 6e 74 20 62 61 |to move |point ba|
|00002e40| 63 6b 20 74 6f 20 70 72 | 65 76 69 6f 75 73 20 6d |ck to pr|evious m|
|00002e50| 61 74 63 68 2e 22 29 20 | 22 5c 0a 48 65 6c 70 20 |atch.") |"\.Help |
|00002e60| 6d 65 73 73 61 67 65 20 | 77 68 69 6c 65 20 69 6e |message |while in|
|00002e70| 20 71 75 65 72 79 2d 72 | 65 70 6c 61 63 65 22 29 | query-r|eplace")|
|00002e80| 0a 28 64 65 66 76 61 72 | 20 71 75 65 72 79 2d 72 |.(defvar| query-r|
|00002e90| 65 70 6c 61 63 65 2d 6d | 61 70 20 6e 69 6c 20 22 |eplace-m|ap nil "|
|00002ea0| 5c 0a 4b 65 79 6d 61 70 | 20 74 68 61 74 20 64 65 |\.Keymap| that de|
|00002eb0| 66 69 6e 65 73 20 74 68 | 65 20 72 65 73 70 6f 6e |fines th|e respon|
|00002ec0| 73 65 73 20 74 6f 20 71 | 75 65 73 74 69 6f 6e 73 |ses to q|uestions|
|00002ed0| 20 69 6e 20 60 71 75 65 | 72 79 2d 72 65 70 6c 61 | in `que|ry-repla|
|00002ee0| 63 65 27 2e 0a 54 68 65 | 20 5c 22 62 69 6e 64 69 |ce'..The| \"bindi|
|00002ef0| 6e 67 73 5c 22 20 69 6e | 20 74 68 69 73 20 6d 61 |ngs\" in| this ma|
|00002f00| 70 20 61 72 65 20 6e 6f | 74 20 63 6f 6d 6d 61 6e |p are no|t comman|
|00002f10| 64 73 3b 20 74 68 65 79 | 20 61 72 65 20 61 6e 73 |ds; they| are ans|
|00002f20| 77 65 72 73 2e 0a 54 68 | 65 20 76 61 6c 69 64 20 |wers..Th|e valid |
|00002f30| 61 6e 73 77 65 72 73 20 | 69 6e 63 6c 75 64 65 20 |answers |include |
|00002f40| 60 61 63 74 27 2c 20 60 | 73 6b 69 70 27 2c 20 60 |`act', `|skip', `|
|00002f50| 61 63 74 2d 61 6e 64 2d | 73 68 6f 77 27 2c 0a 60 |act-and-|show',.`|
|00002f60| 65 78 69 74 27 2c 20 60 | 61 63 74 2d 61 6e 64 2d |exit', `|act-and-|
|00002f70| 65 78 69 74 27 2c 20 60 | 65 64 69 74 27 2c 20 60 |exit', `|edit', `|
|00002f80| 64 65 6c 65 74 65 2d 61 | 6e 64 2d 65 64 69 74 27 |delete-a|nd-edit'|
|00002f90| 2c 20 60 72 65 63 65 6e | 74 65 72 27 2c 0a 60 61 |, `recen|ter',.`a|
|00002fa0| 75 74 6f 6d 61 74 69 63 | 27 2c 20 60 62 61 63 6b |utomatic|', `back|
|00002fb0| 75 70 27 2c 20 61 6e 64 | 20 60 68 65 6c 70 27 2e |up', and| `help'.|
|00002fc0| 22 29 0a 28 62 79 74 65 | 2d 63 6f 64 65 20 22 08 |").(byte|-code ".|
|00002fd0| 84 87 00 c1 20 1a c3 5c | 6e c0 5c 22 88 c4 5c 6e |.... ..\|n.\"..\n|
|00002fe0| c5 c6 23 88 c4 5c 6e c7 | c8 23 88 c4 5c 6e c9 c8 |..#..\n.|.#..\n..|
|00002ff0| 23 88 c4 5c 6e ca c8 23 | 88 c4 5c 6e cb c6 23 88 |#..\n..#|..\n..#.|
|00003000| c4 5c 6e cc c8 23 88 c4 | 5c 6e cd ce 23 88 c4 5c |.\n..#..|\n..#..\|
|00003010| 6e cf d0 23 88 c4 5c 6e | d1 d0 23 88 c4 5c 6e d2 |n..#..\n|..#..\n.|
|00003020| d0 23 88 c4 5c 6e d3 d4 | 23 88 c4 5c 6e d5 d6 23 |.#..\n..|#..\n..#|
|00003030| 88 c4 5c 6e d7 d8 23 88 | c4 5c 6e d9 da 23 88 c4 |..\n..#.|.\n..#..|
|00003040| 5c 6e db dc 23 88 c4 5c | 6e dd de 23 88 c4 5c 6e |\n..#..\|n..#..\n|
|00003050| df e0 23 88 c4 5c 6e e1 | e0 23 88 c4 5c 6e e2 e3 |..#..\n.|.#..\n..|
|00003060| 23 88 c4 5c 6e e4 e3 23 | 88 5c 6e 10 29 e5 e6 e7 |#..\n..#|.\n.)...|
|00003070| 5c 22 88 e8 e9 4d 87 22 | 20 5b 71 75 65 72 79 2d |\"...M."| [query-|
|00003080| 72 65 70 6c 61 63 65 2d | 6d 61 70 20 6d 61 6b 65 |replace-|map make|
|00003090| 2d 73 70 61 72 73 65 2d | 6b 65 79 6d 61 70 20 6d |-sparse-|keymap m|
|000030a0| 61 70 20 73 65 74 2d 6b | 65 79 6d 61 70 2d 6e 61 |ap set-k|eymap-na|
|000030b0| 6d 65 20 64 65 66 69 6e | 65 2d 6b 65 79 20 22 20 |me defin|e-key " |
|000030c0| 22 20 61 63 74 20 22 7f | 22 20 73 6b 69 70 20 5b |" act ".|" skip [|
|000030d0| 64 65 6c 65 74 65 5d 20 | 5b 62 61 63 6b 73 70 61 |delete] |[backspa|
|000030e0| 63 65 5d 20 22 79 22 20 | 22 6e 22 20 22 2c 22 20 |ce] "y" |"n" "," |
|000030f0| 61 63 74 2d 61 6e 64 2d | 73 68 6f 77 20 5b 65 73 |act-and-|show [es|
|00003100| 63 61 70 65 5d 20 65 78 | 69 74 20 22 71 22 20 5b |cape] ex|it "q" [|
|00003110| 72 65 74 75 72 6e 5d 20 | 22 2e 22 20 61 63 74 2d |return] |"." act-|
|00003120| 61 6e 64 2d 65 78 69 74 | 20 22 12 22 20 65 64 69 |and-exit| "." edi|
|00003130| 74 20 22 17 22 20 64 65 | 6c 65 74 65 2d 61 6e 64 |t "." de|lete-and|
|00003140| 2d 65 64 69 74 20 22 0c | 22 20 72 65 63 65 6e 74 |-edit ".|" recent|
|00003150| 65 72 20 22 21 22 20 61 | 75 74 6f 6d 61 74 69 63 |er "!" a|utomatic|
|00003160| 20 22 5e 22 20 62 61 63 | 6b 75 70 20 5b 28 63 6f | "^" bac|kup [(co|
|00003170| 6e 74 72 6f 6c 20 68 29 | 5d 20 68 65 6c 70 20 22 |ntrol h)|] help "|
|00003180| 3f 22 20 22 07 22 20 71 | 75 69 74 20 22 1d 22 20 |?" "." q|uit "." |
|00003190| 61 75 74 6f 6c 6f 61 64 | 20 69 73 65 61 72 63 68 |autoload| isearch|
|000031a0| 2d 68 69 67 68 6c 69 67 | 68 74 20 22 69 73 65 61 |-highlig|ht "isea|
|000031b0| 72 63 68 22 20 70 65 72 | 66 6f 72 6d 2d 72 65 70 |rch" per|form-rep|
|000031c0| 6c 61 63 65 2d 6e 65 78 | 74 2d 65 76 65 6e 74 20 |lace-nex|t-event |
|000031d0| 23 5b 28 65 76 65 6e 74 | 29 20 22 08 ab 95 c1 1a |#[(event|) ".....|
|000031e0| c3 8e c0 c4 94 c4 95 5c | 22 88 c5 0e 06 21 88 c7 |.......\|"....!..|
|000031f0| 89 12 2a 87 c5 0e 06 21 | 87 22 20 5b 69 73 65 61 |..*....!|." [isea|
|00003200| 72 63 68 2d 68 69 67 68 | 6c 69 67 68 74 20 74 20 |rch-high|light t |
|00003210| 61 62 6f 72 74 65 64 20 | 28 28 69 73 65 61 72 63 |aborted |((isearc|
|00003220| 68 2d 64 65 68 69 67 68 | 6c 69 67 68 74 20 61 62 |h-dehigh|light ab|
|00003230| 6f 72 74 65 64 29 29 20 | 30 20 6e 65 78 74 2d 63 |orted)) |0 next-c|
|00003240| 6f 6d 6d 61 6e 64 2d 65 | 76 65 6e 74 20 65 76 65 |ommand-e|vent eve|
|00003250| 6e 74 20 6e 69 6c 5d 20 | 33 5d 5d 20 34 29 0a 28 |nt nil] |3]] 4).(|
|00003260| 66 73 65 74 20 27 70 65 | 72 66 6f 72 6d 2d 72 65 |fset 'pe|rform-re|
|00003270| 70 6c 61 63 65 20 23 5b | 28 66 72 6f 6d 2d 73 74 |place #[|(from-st|
|00003280| 72 69 6e 67 20 72 65 70 | 6c 61 63 65 6d 65 6e 74 |ring rep|lacement|
|00003290| 73 20 71 75 65 72 79 2d | 66 6c 61 67 20 72 65 67 |s query-|flag reg|
|000032a0| 65 78 70 2d 66 6c 61 67 | 20 64 65 6c 69 6d 69 74 |exp-flag| delimit|
|000032b0| 65 64 2d 66 6c 61 67 20 | 26 6f 70 74 69 6f 6e 61 |ed-flag |&optiona|
|000032c0| 6c 20 72 65 70 65 61 74 | 2d 63 6f 75 6e 74 20 6d |l repeat|-count m|
|000032d0| 61 70 29 20 22 08 ac 82 | 09 10 c2 20 0b ad 87 0c |ap) "...|... ....|
|000032e0| ad 84 0d 89 97 98 3f 0e | 06 3f 0e 06 ab 83 c7 aa |......?.|.?......|
|000032f0| 81 c8 0d c9 89 ca cb c9 | ca 89 c9 cb 0e 0c ad 83 |........|........|
|00003300| cd ce 21 1e 0f 1e 10 1e | 11 1e 12 1e 13 1e 14 1e |..!.....|........|
|00003310| 15 1e 16 1e 17 1e 18 1e | 19 1e 1a 1e 1b 1e 1c 1e |........|........|
|00003320| 1d 0e 1e 3b ab 86 0e 1e | 16 17 aa 87 0e 1f ac 83 |...;....|........|
|00003330| e0 16 1f 0e 21 ab 92 c7 | 16 1a e2 0e 06 ab 83 0d |....!...|........|
|00003340| aa 83 e3 0d 21 e2 51 16 | 19 e4 20 88 e5 20 88 0e |....!.Q.|.. .. ..|
|00003350| 15 83 b5 02 6d 84 b5 02 | 0e 1a 0e 19 c9 cb 23 83 |....m...|......#.|
|00003360| b5 02 0e 11 60 3d ac 8f | 0e 06 ab 9b 0e 11 ca 94 |....`=..|........|
|00003370| 3d ab 94 0e 10 ac 90 6d | 84 b5 02 e0 75 88 0e 1a |=......m|....u...|
|00003380| 0e 19 c9 cb 23 aa 81 cb | 83 b5 02 e6 20 16 18 0e |....#...|.... ...|
|00003390| 06 ab 8b e7 0e 19 21 16 | 10 e8 0e 18 21 88 0e 1e |......!.|....!...|
|000033a0| 3c ab 9e 0e 13 0e 12 55 | ab 97 0e 13 0e 1f 5c 5c |<......U|......\\|
|000033b0| 16 13 0e 16 0e 1e 38 16 | 17 0e 16 54 0e 1e 47 a6 |......8.|...T..G.|
|000033c0| 16 16 0e 0c ac 96 e8 0e | 18 21 88 e9 0e 17 0e 1c |........|.!......|
|000033d0| 0e 1b 23 88 0e 12 54 16 | 12 82 af 02 e5 20 88 ea |..#...T.|..... ..|
|000033e0| c9 89 89 1e 2b 1e 2c 1e | 2d 1e 2e 0e 2d 84 91 02 |....+.,.|-...-...|
|000033f0| cf 0e 0f 0d 0e 17 23 88 | ef 0e 1d 21 88 f0 08 f1 |......#.|...!....|
|00003400| 0e 1d 21 5c 22 16 2b e8 | 0e 18 21 88 0e 2b f2 3d |..!\".+.|..!..+.=|
|00003410| ab 9d f3 f4 21 90 f5 f6 | f7 0e 06 ab 83 f8 aa 81 |....!...|........|
|00003420| f9 0d 0e 17 24 cd 0e 3a | 21 50 21 91 88 aa 3d 0e |....$..:|!P!...=.|
|00003430| 2b fb 3d ab 89 c9 16 15 | cb 89 16 2d aa 30 0e 2b |+.=.....|...-.0.+|
|00003440| fc 3d ab b8 0e 14 ab a1 | 0e 14 40 89 1e 3d 40 62 |.=......|..@..=@b|
|00003450| 88 0e 3d 41 cb 3d 89 16 | 2c ac 86 e8 0e 3d 41 21 |..=A.=..|,....=A!|
|00003460| 88 0e 14 41 16 14 29 aa | 03 cf fe 21 88 ff 81 40 |...A..).|...!...@|
|00003470| 00 21 88 81 41 00 e0 21 | 88 82 15 01 0e 2b 81 42 |.!..A..!|.....+.B|
|00003480| 00 3d ab 96 0e 2c ac 89 | e9 0e 17 0e 1c 0e 1b 23 |.=...,..|.......#|
|00003490| 88 cb 16 2d cb 16 2c 82 | 15 01 0e 2b 81 43 00 3d |...-..,.|...+.C.=|
|000034a0| ab 99 0e 2c ac 89 e9 0e | 17 0e 1c 0e 1b 23 88 c9 |...,....|.....#..|
|000034b0| 16 15 cb 16 2d cb 16 2c | 82 15 01 0e 2b 81 44 00 |....-..,|....+.D.|
|000034c0| 3d ab 94 0e 2c 84 15 01 | e9 0e 17 0e 1c 0e 1b 23 |=...,...|.......#|
|000034d0| 88 cb 16 2c 82 15 01 0e | 2b 81 45 00 3d ab 99 0e |...,....|+.E.=...|
|000034e0| 2c ac 89 e9 0e 17 0e 1c | 0e 1b 23 88 cb 16 2d c9 |,.......|..#...-.|
|000034f0| 16 0c cb 16 2c 82 15 01 | 0e 2b 81 46 00 3d ab 87 |....,...|.+.F.=..|
|00003500| cb 89 16 2d 82 17 01 0e | 2b 81 47 00 3d ab 89 81 |...-....|+.G.=...|
|00003510| 47 00 c9 21 88 82 15 01 | 0e 2b 81 48 00 3d ab 9a |G..!....|.+.H.=..|
|00003520| e8 e6 20 8a 81 49 00 20 | 88 29 21 88 0e 06 83 15 |.. ..I. |.)!.....|
|00003530| 01 e7 0e 19 21 16 10 82 | 15 01 0e 2b 81 4a 00 3d |....!...|...+.J.=|
|00003540| ab 98 ca 94 ca 95 7c 88 | e8 e6 20 8a 81 49 00 20 |......|.|.. ..I. |
|00003550| 88 29 21 88 cb 16 2c 82 | 15 01 c9 16 15 0e 1d 16 |.)!...,.|........|
|00003560| 4b cb 89 16 2d 83 1a 01 | 60 0e 2c ae 89 81 4c 00 |K...-...|`.,...L.|
|00003570| 81 4d 00 e6 20 5c 22 42 | 0e 14 42 16 14 0e 2c ab |.M.. \"B|..B...,.|
|00003580| 85 0e 12 54 16 12 2c 60 | 16 11 82 7a 00 0e 15 ad |...T..,`|...z....|
|00003590| 82 0e 14 2e 0f 87 22 20 | 5b 6d 61 70 20 71 75 65 |......" |[map que|
|000035a0| 72 79 2d 72 65 70 6c 61 | 63 65 2d 6d 61 70 20 61 |ry-repla|ce-map a|
|000035b0| 6c 6c 6f 63 61 74 65 2d | 65 76 65 6e 74 20 63 61 |llocate-|event ca|
|000035c0| 73 65 2d 66 6f 6c 64 2d | 73 65 61 72 63 68 20 63 |se-fold-|search c|
|000035d0| 61 73 65 2d 72 65 70 6c | 61 63 65 20 66 72 6f 6d |ase-repl|ace from|
|000035e0| 2d 73 74 72 69 6e 67 20 | 72 65 67 65 78 70 2d 66 |-string |regexp-f|
|000035f0| 6c 61 67 20 72 65 2d 73 | 65 61 72 63 68 2d 66 6f |lag re-s|earch-fo|
|00003600| 72 77 61 72 64 20 73 65 | 61 72 63 68 2d 66 6f 72 |rward se|arch-for|
|00003610| 77 61 72 64 20 6e 69 6c | 20 30 20 74 20 71 75 65 |ward nil| 0 t que|
|00003620| 72 79 2d 66 6c 61 67 20 | 73 75 62 73 74 69 74 75 |ry-flag |substitu|
|00003630| 74 65 2d 63 6f 6d 6d 61 | 6e 64 2d 6b 65 79 73 20 |te-comma|nd-keys |
|00003640| 22 51 75 65 72 79 20 72 | 65 70 6c 61 63 69 6e 67 |"Query r|eplacing|
|00003650| 20 25 73 20 77 69 74 68 | 20 25 73 3a 20 28 5c 5c | %s with| %s: (\\|
|00003660| 3c 71 75 65 72 79 2d 72 | 65 70 6c 61 63 65 2d 6d |<query-r|eplace-m|
|00003670| 61 70 3e 5c 5c 5b 68 65 | 6c 70 5d 20 66 6f 72 20 |ap>\\[he|lp] for |
|00003680| 68 65 6c 70 29 20 22 20 | 6d 65 73 73 61 67 65 20 |help) " |message |
|00003690| 6d 61 74 63 68 2d 61 67 | 61 69 6e 20 6c 61 73 74 |match-ag|ain last|
|000036a0| 72 65 70 6c 20 72 65 70 | 6c 61 63 65 2d 63 6f 75 |repl rep|lace-cou|
|000036b0| 6e 74 20 6e 65 78 74 2d | 72 6f 74 61 74 65 2d 63 |nt next-|rotate-c|
|000036c0| 6f 75 6e 74 20 73 74 61 | 63 6b 20 6b 65 65 70 2d |ount sta|ck keep-|
|000036d0| 67 6f 69 6e 67 20 72 65 | 70 6c 61 63 65 6d 65 6e |going re|placemen|
|000036e0| 74 2d 69 6e 64 65 78 20 | 6e 65 78 74 2d 72 65 70 |t-index |next-rep|
|000036f0| 6c 61 63 65 6d 65 6e 74 | 20 72 65 61 6c 2d 6d 61 |lacement| real-ma|
|00003700| 74 63 68 2d 64 61 74 61 | 20 73 65 61 72 63 68 2d |tch-data| search-|
|00003710| 73 74 72 69 6e 67 20 73 | 65 61 72 63 68 2d 66 75 |string s|earch-fu|
|00003720| 6e 63 74 69 6f 6e 20 6c | 69 74 65 72 61 6c 20 6e |nction l|iteral n|
|00003730| 6f 63 61 73 69 66 79 20 | 65 76 65 6e 74 20 72 65 |ocasify |event re|
|00003740| 70 6c 61 63 65 6d 65 6e | 74 73 20 72 65 70 65 61 |placemen|ts repea|
|00003750| 74 2d 63 6f 75 6e 74 20 | 31 20 64 65 6c 69 6d 69 |t-count |1 delimi|
|00003760| 74 65 64 2d 66 6c 61 67 | 20 22 5c 5c 62 22 20 72 |ted-flag| "\\b" r|
|00003770| 65 67 65 78 70 2d 71 75 | 6f 74 65 20 70 75 73 68 |egexp-qu|ote push|
|00003780| 2d 6d 61 72 6b 20 75 6e | 64 6f 2d 62 6f 75 6e 64 |-mark un|do-bound|
|00003790| 61 72 79 20 6d 61 74 63 | 68 2d 64 61 74 61 20 6c |ary matc|h-data l|
|000037a0| 6f 6f 6b 69 6e 67 2d 61 | 74 20 73 74 6f 72 65 2d |ooking-a|t store-|
|000037b0| 6d 61 74 63 68 2d 64 61 | 74 61 20 72 65 70 6c 61 |match-da|ta repla|
|000037c0| 63 65 2d 6d 61 74 63 68 | 20 28 63 6f 6e 63 61 74 |ce-match| (concat|
|000037d0| 20 28 66 6f 72 6d 61 74 | 20 22 51 75 65 72 79 20 | (format| "Query |
|000037e0| 72 65 70 6c 61 63 69 6e | 67 20 25 73 25 73 20 77 |replacin|g %s%s w|
|000037f0| 69 74 68 20 25 73 2e 5c | 6e 5c 6e 22 20 28 69 66 |ith %s.\|n\n" (if|
|00003800| 20 72 65 67 65 78 70 2d | 66 6c 61 67 20 28 67 65 | regexp-|flag (ge|
|00003810| 74 74 65 78 74 20 22 72 | 65 67 65 78 70 20 22 29 |ttext "r|egexp ")|
|00003820| 20 22 22 29 20 66 72 6f | 6d 2d 73 74 72 69 6e 67 | "") fro|m-string|
|00003830| 20 6e 65 78 74 2d 72 65 | 70 6c 61 63 65 6d 65 6e | next-re|placemen|
|00003840| 74 29 20 28 73 75 62 73 | 74 69 74 75 74 65 2d 63 |t) (subs|titute-c|
|00003850| 6f 6d 6d 61 6e 64 2d 6b | 65 79 73 20 71 75 65 72 |ommand-k|eys quer|
|00003860| 79 2d 72 65 70 6c 61 63 | 65 2d 68 65 6c 70 29 29 |y-replac|e-help))|
|00003870| 20 64 65 66 20 72 65 70 | 6c 61 63 65 64 20 64 6f | def rep|laced do|
|00003880| 6e 65 20 68 65 6c 70 2d | 66 6f 72 6d 20 70 65 72 |ne help-|form per|
|00003890| 66 6f 72 6d 2d 72 65 70 | 6c 61 63 65 2d 6e 65 78 |form-rep|lace-nex|
|000038a0| 74 2d 65 76 65 6e 74 20 | 6c 6f 6f 6b 75 70 2d 6b |t-event |lookup-k|
|000038b0| 65 79 20 76 65 63 74 6f | 72 20 68 65 6c 70 20 67 |ey vecto|r help g|
|000038c0| 65 74 74 65 78 74 20 22 | 2a 48 65 6c 70 2a 22 20 |ettext "|*Help*" |
|000038d0| 70 72 69 6e 63 20 66 6f | 72 6d 61 74 20 22 51 75 |princ fo|rmat "Qu|
|000038e0| 65 72 79 20 72 65 70 6c | 61 63 69 6e 67 20 25 73 |ery repl|acing %s|
|000038f0| 25 73 20 77 69 74 68 20 | 25 73 2e 5c 6e 5c 6e 22 |%s with |%s.\n\n"|
|00003900| 20 22 72 65 67 65 78 70 | 20 22 20 22 22 20 71 75 | "regexp| " "" qu|
|00003910| 65 72 79 2d 72 65 70 6c | 61 63 65 2d 68 65 6c 70 |ery-repl|ace-help|
|00003920| 20 65 78 69 74 20 62 61 | 63 6b 75 70 20 65 6c 74 | exit ba|ckup elt|
|00003930| 20 22 4e 6f 20 70 72 65 | 76 69 6f 75 73 20 6d 61 | "No pre|vious ma|
|00003940| 74 63 68 22 20 64 69 6e | 67 20 6e 6f 2d 74 65 72 |tch" din|g no-ter|
|00003950| 6d 69 6e 61 74 65 20 73 | 69 74 2d 66 6f 72 20 61 |minate s|it-for a|
|00003960| 63 74 20 61 63 74 2d 61 | 6e 64 2d 65 78 69 74 20 |ct act-a|nd-exit |
|00003970| 61 63 74 2d 61 6e 64 2d | 73 68 6f 77 20 61 75 74 |act-and-|show aut|
|00003980| 6f 6d 61 74 69 63 20 73 | 6b 69 70 20 72 65 63 65 |omatic s|kip rece|
|00003990| 6e 74 65 72 20 65 64 69 | 74 20 72 65 63 75 72 73 |nter edi|t recurs|
|000039a0| 69 76 65 2d 65 64 69 74 | 20 64 65 6c 65 74 65 2d |ive-edit| delete-|
|000039b0| 61 6e 64 2d 65 64 69 74 | 20 75 6e 72 65 61 64 2d |and-edit| unread-|
|000039c0| 63 6f 6d 6d 61 6e 64 2d | 65 76 65 6e 74 20 6d 61 |command-|event ma|
|000039d0| 70 63 61 72 20 23 5b 28 | 65 6c 74 29 20 22 c0 09 |pcar #[(|elt) "..|
|000039e0| 21 ab 89 c2 09 21 09 c3 | 89 93 88 87 09 87 22 20 |!....!..|......" |
|000039f0| 5b 6d 61 72 6b 65 72 70 | 20 65 6c 74 20 6d 61 72 |[markerp| elt mar|
|00003a00| 6b 65 72 2d 70 6f 73 69 | 74 69 6f 6e 20 6e 69 6c |ker-posi|tion nil|
|00003a10| 5d 20 34 5d 5d 20 31 37 | 20 22 5c 0a 53 75 62 72 |] 4]] 17| "\.Subr|
|00003a20| 6f 75 74 69 6e 65 20 6f | 66 20 60 71 75 65 72 79 |outine o|f `query|
|00003a30| 2d 72 65 70 6c 61 63 65 | 27 2e 20 20 49 74 73 20 |-replace|'. Its |
|00003a40| 63 6f 6d 70 6c 65 78 69 | 74 79 20 68 61 6e 64 6c |complexi|ty handl|
|00003a50| 65 73 20 69 6e 74 65 72 | 61 63 74 69 76 65 20 71 |es inter|active q|
|00003a60| 75 65 72 69 65 73 2e 0a | 44 6f 6e 27 74 20 75 73 |ueries..|Don't us|
|00003a70| 65 20 74 68 69 73 20 69 | 6e 20 79 6f 75 72 20 6f |e this i|n your o|
|00003a80| 77 6e 20 70 72 6f 67 72 | 61 6d 20 75 6e 6c 65 73 |wn progr|am unles|
|00003a90| 73 20 79 6f 75 20 77 61 | 6e 74 20 74 6f 20 71 75 |s you wa|nt to qu|
|00003aa0| 65 72 79 20 61 6e 64 20 | 73 65 74 20 74 68 65 20 |ery and |set the |
|00003ab0| 6d 61 72 6b 0a 6a 75 73 | 74 20 61 73 20 60 71 75 |mark.jus|t as `qu|
|00003ac0| 65 72 79 2d 72 65 70 6c | 61 63 65 27 20 64 6f 65 |ery-repl|ace' doe|
|00003ad0| 73 2e 20 20 49 6e 73 74 | 65 61 64 2c 20 77 72 69 |s. Inst|ead, wri|
|00003ae0| 74 65 20 61 20 73 69 6d | 70 6c 65 20 6c 6f 6f 70 |te a sim|ple loop|
|00003af0| 20 6c 69 6b 65 20 74 68 | 69 73 3a 0a 20 20 28 77 | like th|is:. (w|
|00003b00| 68 69 6c 65 20 28 72 65 | 2d 73 65 61 72 63 68 2d |hile (re|-search-|
|00003b10| 66 6f 72 77 61 72 64 20 | 5c 22 66 6f 6f 5b 20 09 |forward |\"foo[ .|
|00003b20| 5d 2b 62 61 72 5c 22 20 | 6e 69 6c 20 74 29 0a 20 |]+bar\" |nil t). |
|00003b30| 20 20 20 28 72 65 70 6c | 61 63 65 2d 6d 61 74 63 | (repl|ace-matc|
|00003b40| 68 20 5c 22 66 6f 6f 62 | 61 72 5c 22 20 6e 69 6c |h \"foob|ar\" nil|
|00003b50| 20 6e 69 6c 29 29 0a 77 | 68 69 63 68 20 77 69 6c | nil)).w|hich wil|
|00003b60| 6c 20 72 75 6e 20 66 61 | 73 74 65 72 20 61 6e 64 |l run fa|ster and|
|00003b70| 20 70 72 6f 62 61 62 6c | 79 20 64 6f 20 65 78 61 | probabl|y do exa|
|00003b80| 63 74 6c 79 20 77 68 61 | 74 20 79 6f 75 20 77 61 |ctly wha|t you wa|
|00003b90| 6e 74 2e 22 5d 29 0a 28 | 66 73 65 74 20 27 6d 61 |nt."]).(|fset 'ma|
|00003ba0| 74 63 68 2d 73 74 72 69 | 6e 67 20 27 28 6d 61 63 |tch-stri|ng '(mac|
|00003bb0| 72 6f 20 2e 20 23 5b 28 | 6e 20 26 6f 70 74 69 6f |ro . #[(|n &optio|
|00003bc0| 6e 61 6c 20 73 74 72 69 | 6e 67 29 20 22 c0 c1 5c |nal stri|ng) "..\|
|00003bd0| 6e 44 0b ab 8b c4 0b c1 | 5c 6e 44 c5 5c 6e 44 46 |nD......|\nD.\nDF|
|00003be0| aa 88 c6 c1 5c 6e 44 c5 | 5c 6e 44 45 45 87 22 20 |....\nD.|\nDEE." |
|00003bf0| 5b 61 6e 64 20 6d 61 74 | 63 68 2d 62 65 67 69 6e |[and mat|ch-begin|
|00003c00| 6e 69 6e 67 20 6e 20 73 | 74 72 69 6e 67 20 73 75 |ning n s|tring su|
|00003c10| 62 73 74 72 69 6e 67 20 | 6d 61 74 63 68 2d 65 6e |bstring |match-en|
|00003c20| 64 20 62 75 66 66 65 72 | 2d 73 75 62 73 74 72 69 |d buffer|-substri|
|00003c30| 6e 67 5d 20 37 20 22 5c | 0a 52 65 74 75 72 6e 73 |ng] 7 "\|.Returns|
|00003c40| 20 74 68 65 20 4e 74 68 | 20 73 75 62 65 78 70 72 | the Nth| subexpr|
|00003c50| 65 73 73 69 6f 6e 20 6d | 61 74 63 68 65 64 20 62 |ession m|atched b|
|00003c60| 79 20 74 68 65 20 6c 61 | 73 74 20 72 65 67 75 6c |y the la|st regul|
|00003c70| 61 72 20 65 78 70 72 65 | 73 73 69 6f 6e 0a 73 65 |ar expre|ssion.se|
|00003c80| 61 72 63 68 2e 20 20 54 | 68 65 20 73 65 63 6f 6e |arch. T|he secon|
|00003c90| 64 20 61 72 67 75 6d 65 | 6e 74 2c 20 53 54 52 49 |d argume|nt, STRI|
|00003ca0| 4e 47 2c 20 6d 75 73 74 | 20 62 65 20 73 70 65 63 |NG, must| be spec|
|00003cb0| 69 66 69 65 64 20 69 66 | 20 74 68 65 20 6c 61 73 |ified if| the las|
|00003cc0| 74 0a 72 65 67 75 6c 61 | 72 20 65 78 70 72 65 73 |t.regula|r expres|
|00003cd0| 73 69 6f 6e 20 73 65 61 | 72 63 68 20 77 61 73 20 |sion sea|rch was |
|00003ce0| 64 6f 6e 65 20 77 69 74 | 68 20 60 73 74 72 69 6e |done wit|h `strin|
|00003cf0| 67 2d 6d 61 74 63 68 27 | 2e 22 5d 29 29 0a 28 66 |g-match'|."])).(f|
|00003d00| 73 65 74 20 27 73 61 76 | 65 2d 6d 61 74 63 68 2d |set 'sav|e-match-|
|00003d10| 64 61 74 61 20 27 28 6d | 61 63 72 6f 20 2e 20 23 |data '(m|acro . #|
|00003d20| 5b 28 26 72 65 73 74 20 | 66 6f 72 6d 73 29 20 22 |[(&rest |forms) "|
|00003d30| c0 c1 c2 c3 0c 42 c5 45 | 45 87 22 20 5b 6c 65 74 |.....B.E|E." [let|
|00003d40| 20 28 28 5f 6d 61 74 63 | 68 5f 64 61 74 61 5f 20 | ((_matc|h_data_ |
|00003d50| 28 6d 61 74 63 68 2d 64 | 61 74 61 29 29 29 20 75 |(match-d|ata))) u|
|00003d60| 6e 77 69 6e 64 2d 70 72 | 6f 74 65 63 74 20 70 72 |nwind-pr|otect pr|
|00003d70| 6f 67 6e 20 66 6f 72 6d | 73 20 28 73 74 6f 72 65 |ogn form|s (store|
|00003d80| 2d 6d 61 74 63 68 2d 64 | 61 74 61 20 5f 6d 61 74 |-match-d|ata _mat|
|00003d90| 63 68 5f 64 61 74 61 5f | 29 5d 20 35 20 22 5c 0a |ch_data_|)] 5 "\.|
|00003da0| 45 78 65 63 75 74 65 20 | 46 4f 52 4d 53 2c 20 72 |Execute |FORMS, r|
|00003db0| 65 73 74 6f 72 69 6e 67 | 20 74 68 65 20 67 6c 6f |estoring| the glo|
|00003dc0| 62 61 6c 20 76 61 6c 75 | 65 20 6f 66 20 74 68 65 |bal valu|e of the|
|00003dd0| 20 6d 61 74 63 68 20 64 | 61 74 61 2e 22 5d 29 29 | match d|ata."]))|
|00003de0| 0a | |. | |
+--------+-------------------------+-------------------------+--------+--------+