;ELC   
;;; Compiled by rms@psilocin.ai.mit.edu on Mon Aug 10 08:07:39 1998
;;; from file /gd/gnu/emacs/lisp/replace.el
;;; in Emacs version 20.2.98.3
;;; with bytecomp version 2.48
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`replace.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


#@68 *Non-nil means query-replace should preserve case in replacements.
(custom-declare-variable 'case-replace 't '(#$ . -602) :type 'boolean :group 'matching)
(byte-code "\302\300!\204 \303\300	B\303\207" [query-replace-history current-load-list boundp nil] 2)
#@98 Non-nil means `query-replace' uses the last search string.
That becomes the "string to replace".
(defvar query-replace-interactive nil (#$ . 868))
#@218 History list to use for the FROM argument of query-replace commands.
The value of this variable should be a symbol; that symbol
is used as a variable to hold a history list for the strings
or patterns to be replaced.
(custom-declare-variable 'query-replace-from-history-variable ''query-replace-history '(#$ . 1022) :group 'matching :type 'symbol :version "20.3")
#@209 History list to use for the TO argument of query-replace commands.
The value of this variable should be a symbol; that symbol
is used as a variable to hold a history list for replacement
strings or patterns.
(custom-declare-variable 'query-replace-to-history-variable ''query-replace-history '(#$ . 1393) :group 'matching :type 'symbol :version "20.3")
(defalias 'query-replace-read-args #[(string regexp-flag) "\306\211\n\203 \203 \f\202 @\202& \307\310\311\f\"\306\211\211\306\312&\307\310\313\f	#\306\211\211	\312&	E*\207" [to from query-replace-interactive regexp-flag regexp-search-ring search-ring nil read-from-minibuffer format "%s: " t "%s %s with: " string query-replace-from-history-variable query-replace-to-history-variable current-prefix-arg] 8])
#@947 Replace some occurrences of FROM-STRING with TO-STRING.
As each match is found, the user must type a character saying
what to do with it.  For directions, type \[help-command] at that time.

In Transient Mark mode, if the mark is active, operate on the contents
of the region.  Otherwise, operate from point to the end of the buffer.

If `query-replace-interactive' is non-nil, the last incremental search
string is used as FROM-STRING--you don't have to specify it with the
minibuffer.

Preserves case in each replacement if `case-replace' and `case-fold-search'
are non-nil and FROM-STRING has no uppercase letters.
(Preserving case means that if the string matched is all caps, or capitalized,
then its replacement is upcased or capitalized.)

Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace
only matches surrounded by word boundaries.

To customize possible responses, change the "bindings" in `query-replace-map'.
(defalias 'query-replace #[(from-string to-string &optional arg) "\303	\304\305\n%\207" [from-string to-string arg perform-replace t nil] 6 (#$ . 2182) (query-replace-read-args "Query replace" nil)])
(define-key esc-map "%" 'query-replace)
#@899 Replace some things after point matching REGEXP with TO-STRING.
As each match is found, the user must type a character saying
what to do with it.  For directions, type \[help-command] at that time.

In Transient Mark mode, if the mark is active, operate on the contents
of the region.  Otherwise, operate from point to the end of the buffer.

If `query-replace-interactive' is non-nil, the last incremental search
regexp is used as REGEXP--you don't have to specify it with the
minibuffer.

Preserves case in each replacement if `case-replace' and `case-fold-search'
are non-nil and REGEXP has no uppercase letters.
Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace
only matches surrounded by word boundaries.
In TO-STRING, `\&' stands for whatever matched the whole of REGEXP,
and `\=\N' (where N is a digit) stands for
 whatever what matched the Nth `\(...\)' in REGEXP.
(defalias 'query-replace-regexp #[(regexp to-string &optional arg) "\303	\304\211\n%\207" [regexp to-string arg perform-replace t] 6 (#$ . 3376) (query-replace-read-args "Query replace regexp" t)])
(define-key esc-map [67108901] 'query-replace-regexp)
#@798 Replace some matches for REGEXP with various strings, in rotation.
The second argument TO-STRINGS contains the replacement strings, separated
by spaces.  This command works like `query-replace-regexp' except
that each successive replacement uses the next successive replacement string,
wrapping around from the last such string to the first.

In Transient Mark mode, if the mark is active, operate on the contents
of the region.  Otherwise, operate from point to the end of the buffer.

Non-interactively, TO-STRINGS may be a list of replacement strings.

If `query-replace-interactive' is non-nil, the last incremental search
regexp is used as REGEXP--you don't have to specify it with the minibuffer.

A prefix argument N says to use each replacement string N times
before rotating to the next.
(defalias 'map-query-replace-regexp #[(regexp to-strings &optional arg) "\304	<\203\f 	\202? 	G\305U\204? \306\307	\"\2033 \310	\305\306\307	\"OC\"	\306\307	\"T\304O\211\202 \310	C\"\311\211\202 \312\n\313\211\304&)\207" [replacements to-strings regexp arg nil 0 string-match " " append "" perform-replace t] 8 (#$ . 4534) (let (from to) (setq from (if query-replace-interactive (car regexp-search-ring) (read-from-minibuffer "Map query replace (regexp): " nil nil nil 'query-replace-history nil t))) (setq to (read-from-minibuffer (format "Query replace %s with (space-separated strings): " from) nil nil nil 'query-replace-history from t)) (list from to current-prefix-arg))])
#@1084 Replace occurrences of FROM-STRING with TO-STRING.
Preserve case in each match if `case-replace' and `case-fold-search'
are non-nil and FROM-STRING has no uppercase letters.
(Preserving case means that if the string matched is all caps, or capitalized,
then its replacement is upcased or capitalized.)

In Transient Mark mode, if the mark is active, operate on the contents
of the region.  Otherwise, operate from point to the end of the buffer.

Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace
only matches surrounded by word boundaries.

If `query-replace-interactive' is non-nil, the last incremental search
string is used as FROM-STRING--you don't have to specify it with the
minibuffer.

This function is usually the wrong thing to use in a Lisp program.
What you probably want is a loop like this:
  (while (search-forward FROM-STRING nil t)
    (replace-match TO-STRING nil t))
which will run faster and will not set the mark or print anything.
(You may need a more complex loop if FROM-STRING can match the null string
and TO-STRING is also null.)
(defalias 'replace-string #[(from-string to-string &optional delimited) "\303	\304\211\n%\207" [from-string to-string delimited perform-replace nil] 6 (#$ . 6031) (query-replace-read-args "Replace string" nil)])
#@1012 Replace things after point matching REGEXP with TO-STRING.
Preserve case in each match if `case-replace' and `case-fold-search'
are non-nil and REGEXP has no uppercase letters.
Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace
only matches surrounded by word boundaries.
In TO-STRING, `\&' stands for whatever matched the whole of REGEXP,
and `\=\N' (where N is a digit) stands for
 whatever what matched the Nth `\(...\)' in REGEXP.

In Transient Mark mode, if the mark is active, operate on the contents
of the region.  Otherwise, operate from point to the end of the buffer.

If `query-replace-interactive' is non-nil, the last incremental search
regexp is used as REGEXP--you don't have to specify it with the minibuffer.

This function is usually the wrong thing to use in a Lisp program.
What you probably want is a loop like this:
  (while (re-search-forward REGEXP nil t)
    (replace-match TO-STRING nil nil))
which will run faster and will not set the mark or print anything.
(defalias 'replace-regexp #[(regexp to-string &optional delimited) "\303	\304\305\n%\207" [regexp to-string delimited perform-replace nil t] 6 (#$ . 7335) (query-replace-read-args "Replace regexp" t)])
#@63 History list for some commands that read regular expressions.
(defvar regexp-history nil (#$ . 8555))
(defalias 'delete-non-matching-lines 'keep-lines)
#@159 Delete all lines except those containing matches for REGEXP.
A match split across lines preserves all the lines it lies in.
Applies to all lines after point.
(defalias 'keep-lines #[(regexp) "\212n\204 \303y\210`m?\205M \304	\305\306#\204 d|\210\2024 \212\307\224b\210\307y\210`)\nW\2033 \n|\210)\212\303y\210`)m\204\n \307\224\307\225U\203\n \303u\210\202\n *\207" [start regexp end 1 re-search-forward nil move 0] 4 (#$ . 8714) (list (read-from-minibuffer "Keep lines (containing match for regexp): " nil nil nil 'regexp-history nil t))])
(defalias 'delete-matching-lines 'flush-lines)
#@147 Delete lines containing matches for REGEXP.
If a match is split across lines, all the lines it lies in are deleted.
Applies to lines after point.
(defalias 'flush-lines #[(regexp) "\212m?\205! \301\302\303#\205! \212\304\224b\210\304y\210`)\305y\210`|\210\202 )\207" [regexp re-search-forward nil t 0 1] 4 (#$ . 9317) (list (read-from-minibuffer "Flush lines (containing match for regexp): " nil nil nil 'regexp-history nil t))])
(defalias 'count-matches 'how-many)
#@53 Print number of matches for REGEXP following point.
(defalias 'how-many #[(regexp) "\303\304\212m\204% `\305\n\304\306#\203% `U\203 \307u\210\202 	T\202 \310\311	\"+\207" [opoint count regexp 0 nil re-search-forward t 1 message "%d occurrences"] 4 (#$ . 9791) (list (read-from-minibuffer "How many matches for (regexp): " nil nil nil 'regexp-history nil t))])
(byte-code "\302\300!\204 \303\300	B\2047 \304 \305\306\307#\210\305\310\311#\210\305\312\311#\210\305\313\314#\210\305\315\316#\210\305\317\320#\210\303\207" [occur-mode-map current-load-list boundp nil make-sparse-keymap define-key [mouse-2] occur-mode-mouse-goto "" occur-mode-goto-occurrence "" "\356" occur-next "\360" occur-prev "g" revert-buffer] 4)
#@32 Name of buffer for last occur.
(defvar occur-buffer nil (#$ . 10536))
#@58 Number of lines of context to show around matching line.
(defvar occur-nlines nil (#$ . 10612))
#@64 Arguments that were given to `occur' when it made this buffer.
(defvar occur-command-arguments nil (#$ . 10714))
(put 'occur-mode 'mode-class 'special)
#@279 Major mode for output from \[occur].
\<occur-mode-map>Move point to one of the items in this buffer, then use
\[occur-mode-goto-occurrence] to go to the occurrence that the item refers to.
Alternatively, click \[occur-mode-mouse-goto] on an item to go to it.

\{occur-mode-map}
(defalias 'occur-mode #[nil "\304 \210\305!\210\306\307\310\303!\210\311\310\312!\210\310\313!\210\310\314!\210\315\316!\207" [occur-mode-map major-mode mode-name revert-buffer-function kill-all-local-variables use-local-map occur-mode "Occur" make-local-variable occur-revert-function occur-buffer occur-nlines occur-command-arguments run-hooks occur-mode-hook] 2 (#$ . 10873)])
(defalias 'occur-revert-function #[(ignore1 ignore2) "\212\nq\210\303\304	\"*\207" [occur-command-arguments args occur-buffer apply occur] 3])
#@62 In Occur mode, go to the occurrence whose line you click on.
(defalias 'occur-mode-mouse-goto #[(event) "\305\211\212\306\n\307\n8:\203 \307\202 \310\n8)\211@)!q\210\212\n\307\n8:\203, \307\202- \310\n8)\211A@:\203? A@@\202B A@)b\210\311 \f*\312	!\210\313!b*\207" [pos buffer event position occur-buffer nil window-buffer 2 1 occur-mode-find-occurrence pop-to-buffer marker-position] 4 (#$ . 11686) "e"])
(defalias 'occur-mode-find-occurrence #[nil "\203\n \302!\204 \303\304\305!\210\306`\307\"\211\204 \304\310!\202  	)\207" [occur-buffer pos buffer-name nil error "Buffer in which occurrences were found is deleted" get-text-property occur "No occurrence on this line"] 4])
#@50 Go to the occurrence the current line describes.
(defalias 'occur-mode-goto-occurrence #[nil "\302 \303	!\210\304!b)\207" [pos occur-buffer occur-mode-find-occurrence pop-to-buffer marker-position] 2 (#$ . 12388) nil])
#@63 Move to the Nth (default 1) next match in the *Occur* buffer.
(defalias 'occur-next #[(&optional n) "\204 \302\303\304V\2052 \305`\306\"\203 \302u\210\307`\306\"\211\203' 	b\210\202+ \310\311!\210S\211\202	 )\207" [n r 1 nil 0 get-text-property occur-point next-single-property-change error "no more matches"] 4 (#$ . 12615) "p"])
#@67 Move to the Nth (default 1) previous match in the *Occur* buffer.
(defalias 'occur-prev #[(&optional n) "\204 \302\303\304V\2055 \305`\306\"\211\203 \307u\210\310`\306\"\211\203* 	Sb\210\202. \311\312!\210S\211\202	 )\207" [n r 1 nil 0 get-text-property occur-point -1 previous-single-property-change error "no earlier matches"] 4 (#$ . 12961) "p"])
#@227 *Default number of context lines to include around a `list-matching-lines'
match.  A negative number means to include that many lines before the match.
A positive number means to include that many lines both before and after.
(custom-declare-variable 'list-matching-lines-default-context-lines '0 '(#$ . -13328) :type 'integer :group 'matching)
(defalias 'list-matching-lines 'occur)
#@140 *Face used by M-x list-matching-lines to show the text that matches.
If the value is nil, don't highlight the matching portions specially.
(defvar list-matching-lines-face 'bold (#$ . -13719))
#@633 Show all lines in the current buffer containing a match for REGEXP.

If a match spreads across multiple lines, all those lines are shown.

Each line is displayed with NLINES lines before and after, or -NLINES
before if NLINES is negative.
NLINES defaults to `list-matching-lines-default-context-lines'.
Interactively it is the prefix arg.

The lines are shown in a buffer named `*Occur*'.
It serves as a menu to find any of the occurrences in this buffer.
\<occur-mode-map>\[describe-mode] in that buffer will explain how.

If REGEXP contains upper case characters (excluding those preceded by `\'),
the matching is case-sensitive.
(defalias 'occur #[(regexp &optional nlines) "\203\n \306!\202 	\307\310p\n\311e\205 \312\f\307\"\313 /01234\212eb\210\314\f\315\307#\204= \316\317\f\"\202\241\310\224b\210\320\220\2125q\2101\321c\210\3076\322\f!\210)\323\3242!\325\326\261\210\327 \210278\fD9)25=\203{ db\210\212/dU\204t\314\f\315\307#\203t\310\224b\210\310y\210\330 :\331\2160\332/`\"\\0*`/\310\225b\210\212\310\224b\210\310W\203\271 \202\273 [y\210`);\212\310\225b\210\310V\203\323 Ty\210\202\326 \311y\210`)<\310\224;Z=\310\225\310\224Z>\333\3340\"?\335?G\336\"@\315A\315B\315C\313 D\313 E\212\313 \211C`\315\223\2105q\2103T34\204)\337!\204)\340c\210\3154D`\315\223\210`B\3412;<#\210;=\\<U\204Xr2q\210\342<!)\326=\204[\343c\210`<\310\225ZZ\2122q\210\212\310\225b\210\315\210n*\203y\311\202z\310\\\315\223\210E`\315\223\210F\203\240\344\345D!=\\\345D!=\\>\\\346F$\210\344\345D!=\\>\\\345D!=\\>\\\311\\\347\307$\210Bb\2100W\203\3150Z\202\316\211A\310V\203\350@\350\261\210\311y\210AS\211A\202\3210G`W\203?\204\376\333\334G\"??\350\261\210\311y\210\315?GTG\202\354m\204-`X\203-@\350\261\210\311y\210GTG\202)`dW\203LAW\203L@\350\261\210\311y\210ATA\202.\344\345D!\345E!S\351\352$\210\344\345D!\345E!\353C$\210db\210)\311y\210.\202| 5q\210eb\2103\311U\203\206\354\202\213\333\3553\"\211Hc\210t\203\232\316\356H\"\210)\307\211I)\221.\n\207" [nlines list-matching-lines-default-context-lines default-directory case-fold-search regexp final-context-start prefix-numeric-value t 0 1 isearch-no-upper-case-p make-marker re-search-forward nil message "No matches for `%s'" "*Occur*" " matching " prin1 " in buffer " buffer-name 46 10 occur-mode match-data ((set-match-data save-match-data-internal)) count-lines format "%5d" make-string 32 zerop "--------\n" insert-buffer-substring char-before "\n" put-text-property marker-position face occur-point 58 mouse-face highlight occur "1 line" "%d lines" "%s matched" prevpos linenum dir buffer occur-num-matches first standard-output print-escape-newlines occur-buffer occur-nlines occur-command-arguments save-match-data-internal start end match-beg match-len tag empty tem insertion-start occur-marker text-beg text-end list-matching-lines-face this-linenum message-string buffer-read-only] 11 (#$ . 13919) (list (let* ((default (car regexp-history)) (input (read-from-minibuffer (if default (format "List lines matching regexp (default `%s'): " default) "List lines matching regexp: ") nil nil nil 'regexp-history default t))) (and (equal input "") default (setq input default)) input) current-prefix-arg)])
#@37 Help message while in query-replace
(defconst query-replace-help "Type Space or `y' to replace one match, Delete or `n' to skip to next,\nRET or `q' to exit, Period to replace one match and exit,\nComma to replace but not move point immediately,\nC-r to enter recursive edit (\\[exit-recursive-edit] to get out again),\nC-w to delete match and recursive edit,\nC-l to clear the screen, redisplay, and offer same replacement again,\n! to replace all remaining matches with no more questions,\n^ to move point back to previous match." (#$ . 17235))
#@301 Keymap that defines the responses to questions in `query-replace'.
The "bindings" in this map are not commands; they are answers.
The valid answers include `act', `skip', `act-and-show',
`exit', `act-and-exit', `edit', `delete-and-edit', `recenter',
`automatic', `backup', `exit-prefix', and `help'.
(defvar query-replace-map (make-sparse-keymap) (#$ . 17789))
(byte-code "\301\302\303#\210\301\304\305#\210\301\306\305#\210\301\307\305#\210\301\310\303#\210\301\311\305#\210\301\312\303#\210\301\313\305#\210\301\314\315#\210\301\316\317#\210\301\320\317#\210\301\321\317#\210\301\322\323#\210\301\324\325#\210\301\326\327#\210\301\330\331#\210\301\332\333#\210\301\334\335#\210\301\336\337#\210\301\340\337#\210\301\341\337#\210\301\342\337#\210\301\343\344#\210\301\345\344#\210\301\346\347#\210\301\350\347#\207" [query-replace-map define-key " " act "" skip [delete] [backspace] "y" "n" "Y" "N" "," act-and-show "q" exit "" [return] "." act-and-exit "" edit "" delete-and-edit "\f" recenter "!" automatic "^" backup "" help [f1] [help] "?" "" quit "" "" exit-prefix [escape]] 4)
#@373 Subroutine of `query-replace'.  Its complexity handles interactive queries.
Don't use this in your own program unless you want to query and set the mark
just as `query-replace' does.  Instead, write a simple loop like this:
  (while (re-search-forward "foo[ 	]+bar" nil t)
    (replace-match "foobar" nil nil))
which will run faster and probably do exactly what you want.
(defalias 'perform-replace #[(from-string replacements query-flag regexp-flag delimited-flag &optional repeat-count map) "\204 	\n\203 \203 \306\307\310 !!\210\f\205\" \205\" @\211\227\230?A?A\203/ \311\2020 \312@\313\211\314\315\313\314\211\313\211\315\n\205C \316\317! BCDEFGHIJKLMNOP\203\201 Q\203\201 \320\321 !C\322 b\210P\203\201 \313Q\323\324!\210R;\203\216 RJ\202\226 S\204\226 \325ST\203\261 \311M\326A\203\251 @\202\255 \327@!\326QL\330 \210\331 \210\332\216H\203Am\204AB:\203\323 BA@b\210B\202\360 B\204\340 \325u\210m?\205\360 MLC\315#\205\360 \333\315K\"\211K\203AK@KA@U?\211D\205A?\206\334L!\205\333 BR<\203;FEU\203;FS\\FIR8JITRG\246I\n\204U\335K!\210\336JON#\210ETE\202\271 \331 \210\313\211\211\211UVWXX\204.\335K!\210\337\314\224\314\225\"\210\313Y\340 @J#\210)\341 V\335K!\210\342V!V\343V\"\211U\344=\203\307\345\220\346\347A\203\253\350\202\254\351@\352J\353\316Z!\260!\210\212[q\210\354 )\221\210\202dU\355=\203\330\313H\315\211X\202fU\356=\203G\203G@\211\\@b\210\\A\315=\211W\204\376\335\\A!\210GAG)\202d\340\357!\210\360\361!\210\362\325!\210\202dU\363=\2039W\2040\336JON#\210ETE\315X\315W\202dU\364=\203_W\204S\336JON#\210ETE\313H\315X\315W\202dU\365=\203W\204d\336JON#\210ETE\315W\202dU\366=\203\244W\204\231\336JON#\210ETE\315X\313\315W\202dU\367=\203\262\315\211X\202fU\370=\203\300\370\313!\210\202dU\371=\203\372\314\224b\210MLC\315#\210\333 K\212\372 \210)\335K!\210A\203dD\203d\334L!\205\365\333 B\202dU\373=\203\314\224\314\225|\210\335\333 \212\372 \210)!\210\315W\202d\374]\313H\375\376V!^\"^\315\211X\203i`W\2067\333\315!BGBG,\202\271 )^\204Z\340\377E\211\325U\203U\351\202X\201_ #\210H\205aG.\207" [map query-replace-map query-flag minibuffer-auto-raise case-fold-search case-replace raise-frame window-frame minibuffer-window re-search-forward search-forward nil 0 t substitute-command-keys "Query replacing %s with %s: (\\<query-replace-map>\\[help] for help) " copy-marker region-end region-beginning run-hooks deactivate-mark-hook 1 "\\b" regexp-quote push-mark undo-boundary ((replace-dehighlight)) match-data looking-at set-match-data replace-match replace-highlight message read-event vector lookup-key help "*Help*" princ "Query replacing " "regexp " "" " with " ".\n\n" help-mode exit backup "No previous match" ding no-terminate sit-for act act-and-exit act-and-show automatic skip recenter edit recursive-edit delete-and-edit mode-exited append listify-key-sequence "Replaced %d occurrence%s" from-string regexp-flag match-again limit nonempty-match replace-count next-rotate-count stack keep-going replacement-index next-replacement real-match-data search-string search-function literal nocasify transient-mark-mode mark-active replacements repeat-count delimited-flag def key replaced done message-log-max query-replace-help standard-output elt this-command unread-command-events "s"] 17 (#$ . 18914)])
#@61 *Non-nil means to highlight words during query replacement.
(custom-declare-variable 'query-replace-highlight 't '(#$ . -22377) :type 'boolean :group 'matching)
(byte-code "\302\300!\204 \303\300	B\303\207" [replace-overlay current-load-list boundp nil] 2)
(defalias 'replace-dehighlight #[nil "\205 \301!\210\302\211\207" [replace-overlay delete-overlay nil] 2])
(defalias 'replace-highlight #[(start end) "\205# 	\204 \304\n\"\305	\306\307\310!\203 \310\202 \311#\210\312	\np$\207" [query-replace-highlight replace-overlay start end make-overlay overlay-put face internal-find-face query-replace region move-overlay] 5])
