;ELC ;;; Compiled ;;; in Emacs version 27.1 ;;; with all optimizations. ;;; This file contains utf-8 non-ASCII characters, ;;; and so cannot be loaded into Emacs 22 or earlier. (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (string-lessp emacs-version "23") (error "`%s' was compiled for Emacs 23 or later" #$)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\302\303\304\305\306DD\307\310\311\312\313&\210\302\314\304\305\315DD\316\310\311\312\313\317\320& \210\302\321\304\305\322DD\323\310\311\312\313\317\324& \210\302\325\304\305\326DD\327\310\311\312\313\317\324& \207" [require text-mode custom-declare-variable case-replace funcall function #[0 "\300\207" [t] 1] "Non-nil means `query-replace' should preserve case in replacements." :type boolean :group matching replace-char-fold #[0 "\300\207" [nil] 1] "Non-nil means replacement commands should do character folding in matches.\nThis means, for instance, that \\=' will match a large variety of\nUnicode quotes.\nThis variable affects `query-replace' and `replace-string', but not\n`replace-regexp'." :version "25.1" replace-lax-whitespace #[0 "\300\207" [nil] 1] "Non-nil means `query-replace' matches a sequence of whitespace chars.\nWhen you enter a space or spaces in the strings to be replaced,\nit will match any sequence matched by the regexp `search-whitespace-regexp'." "24.3" replace-regexp-lax-whitespace #[0 "\300\207" [nil] 1] "Non-nil means `query-replace-regexp' matches a sequence of whitespace chars.\nWhen you enter a space or spaces in the regexps to be replaced,\nit will match any sequence matched by the regexp `search-whitespace-regexp'."] 10) #@133 Default history list for query-replace commands. See `query-replace-from-history-variable' and `query-replace-to-history-variable'. (defvar query-replace-history nil (#$ . 1704)) #@161 Default values of FROM-STRING and TO-STRING for `query-replace'. This is a list of cons cells (FROM-STRING . TO-STRING), or nil if there are no default values. (defvar query-replace-defaults nil (#$ . 1890)) #@98 Non-nil means `query-replace' uses the last search string. That becomes the "string to replace". (defvar query-replace-interactive nil (#$ . 2104)) (byte-code "\300\301\302\303#\210\304\305\306\307\310DD\311\312\313\314\315\316\317& \210\304\320\306\307\321DD\322\312\313\314\323\316\324& \210\304\325\306\307\326DD\327\312\313\314\323\316\324& \210\304\330\306\307\331DD\332\314\333\312\313\316\334& \210\304\335\306\307\336DD\337\314\333\312\313\316\340& \210\304\341\306\307\342DD\343\314\333\312\313&\210\304\344\306\307\345DD\346\314\333\312\347\312\313\316\334& \210\350\351\352\353\312\313\316\334&\207" [make-obsolete-variable query-replace-interactive "use `M-n' to pull the last incremental search string\nto the minibuffer that reads the string to replace, or invoke replacements\nfrom Isearch by using a key sequence like `C-s C-s M-%'." "24.3" custom-declare-variable query-replace-from-to-separator funcall function #[0 "\300\207" [#1=" → "] 1 #1#] "String that separates FROM and TO in the history of replacement pairs.\nWhen nil, the pair will not be added to the history (same behavior\nas in emacs 24.5)." :group matching :type (choice (const :tag "Disabled" nil) string) :version "25.1" query-replace-from-history-variable #[0 "\300\207" [query-replace-history] 1] "History list to use for the FROM argument of `query-replace' commands.\nThe value of this variable should be a symbol; that symbol\nis used as a variable to hold a history list for the strings\nor patterns to be replaced." symbol "20.3" query-replace-to-history-variable #[0 "\300\207" [query-replace-history] 1] "History list to use for the TO argument of `query-replace' commands.\nThe value of this variable should be a symbol; that symbol\nis used as a variable to hold a history list for replacement\nstrings or patterns." query-replace-skip-read-only #[0 "\300\207" [nil] 1] "Non-nil means `query-replace' and friends ignore read-only matches." boolean "22.1" query-replace-show-replacement #[0 "\300\207" [t] 1] "Non-nil means show substituted replacement text in the minibuffer.\nThis variable affects only `query-replace-regexp'." "23.1" query-replace-highlight #[0 "\300\207" [t] 1] "Non-nil means to highlight matches during query replacement." query-replace-lazy-highlight #[0 "\300\207" [t] 1] "Controls the lazy-highlighting during query replacements.\nWhen non-nil, all text in the buffer matching the current match\nis highlighted lazily using isearch lazy highlighting (see\n`lazy-highlight-initial-delay' and `lazy-highlight-interval')." lazy-highlight custom-declare-face query-replace ((t (:inherit isearch))) "Face for highlighting query replacement matches."] 12) #@91 Number of replacements done so far. See `replace-regexp' and `query-replace-regexp-eval'. (defvar replace-count 0 (#$ . 4785)) #@15 (fn STRING) (defalias 'query-replace-descr #[257 "\300!\262\211G\301\211W\203N\211H\211\302W\2030\303\211T\304\305\306\307\310\\\"\311\312#D$\210\202E\211\313U\203E\303\211T\304\305\314\311\312#D$\210\266\211T\262\202\266\207" [copy-sequence 0 32 add-text-properties display propertize format "^%c" 64 face escape-glyph 127 "^?"] 14 (#$ . 4918)]) #@76 Split string STRING at a substring with property `separator'. (fn STRING) (defalias 'query-replace--split-string #[257 "\211G\300\301\302\303%\211\204\202*\304\301#\305\306T\302\303\n%\206'#B\207" [text-property-any 0 separator t substring substring-no-properties text-property-not-all] 12 (#$ . 5295)]) #@277 Query and return the `from' argument of a query-replace operation. Prompt with PROMPT. REGEXP-FLAG non-nil means the response should be a regexp. The return value can also be a pair (FROM . TO) indicating that the user wants to replace FROM with TO. (fn PROMPT REGEXP-FLAG) (defalias 'query-replace-read-from #[514 "\203\211\203\f \202 \n@\207\306\f\205&\307\310\311\312\313\f#!!\203%\f\202&\314\211\2054\315\316\317\320\321\322&\323\205I\324\325\326\327\330\331!\332\"\333\334% \";J\",\322< \203d\211\203d\335\336,@#\202} \203y\335\337\340 @@!\340 @A!$\202}\335\341\"\212\342\306C\211\325\343\344\330\331\"\345\"\346$\240\210\325\343\347\330\331!\350\"\346$\216\351\352\242\"\210\203\260\353\306\354#\202\273\355\306\211\211\211\n@\322&)\266\202)\306G\343U\203\331 \203\331 @@\356 @A\"B\202>\357!\262:\203\353A\262@\262\360;\306\322$\210\203\361\362\"\203\363\346\"\211\364\230\203\365\366!\210\202\211\367\230\203\365\370!\210\371\372!\266\211\204&\202>\360=\306\322$\210\360\305B\306\322$\210\356\"B+\207" [query-replace-interactive regexp-search-ring search-ring history-add-new-input query-replace-from-to-separator query-replace-defaults nil char-displayable-p string-to-char replace-regexp-in-string " " "" " -> " propertize display face minibuffer-prompt separator t append mapcar make-byte-code 257 "\301@!\300\301A!Q\207" vconcat vector [query-replace-descr] 5 "\n\n(fn FROM-TO)" format "%s (default %s): " "%s (default %s -> %s): " query-replace-descr "%s: " #[0 "\301\300!\210\302\303\"\211\207" [text-property-default-nonsticky make-local-variable append ((separator . t) (face . t))] 3] 0 "\302\303\301\242\"\210\300 \207" [remove-hook minibuffer-setup-hook] 3 "\301\302\300\242\"\207" [remove-hook minibuffer-setup-hook] add-hook minibuffer-setup-hook read-regexp minibuffer-history read-from-minibuffer query-replace-compile-replacement query-replace--split-string add-to-history string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" match-string "\\n" message "Note: `\\n' here doesn't match a newline; to do that, type C-q C-j instead" "\\t" "Note: `\\t' here doesn't match a tab; to do that, just type TAB" sit-for 2 query-replace-from-history-variable minibuffer-allow-text-properties query-replace-to-history-variable] 15 (#$ . 5624)]) #@199 Maybe convert a regexp replacement TO to Lisp. REGEXP-FLAG non-nil means TO is a regexp. Returns a list suitable for `perform-replace' if necessary, the original string if not. (fn TO REGEXP-FLAG) (defalias 'query-replace-compile-replacement #[514 "\211\203\236\300\301\"\203\236\302\211\211\303\225\262\304\303\305Z#B\262SH\262\304\"\262\211\306\267\202w\307B\262\202w\310!\262\311@DB\262@9\204Z@\242\312=\203m\303H\313U\204m\300\314A#A=\203mAT\202oA\304\"\262\210\300\301\"\204\315\316B\"\237\262\317!\210\320A\203\232\321B\202\234@B\207\207" [string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" nil 0 substring 2 #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (35 47 44 55)) (number-to-string replace-count) read-from-string replace-quote quote 40 " " delete "" replace-match-string-symbols replace-eval-replacement concat] 10 (#$ . 7984)]) #@173 Query and return the `to' argument of a query-replace operation. Prompt with PROMPT. REGEXP-FLAG non-nil means the response should a regexp. (fn FROM PROMPT REGEXP-FLAG) (defalias 'query-replace-read-to #[771 "\302\212\303\304\305\306\307!#\303\211\211  \310&\311 \303\310$\210\311\312B\303\310$\210)\211\262)\"\207" [history-add-new-input query-replace-to-history-variable query-replace-compile-replacement nil read-from-minibuffer format "%s %s with: " query-replace-descr t add-to-history query-replace-defaults] 12 (#$ . 8935)]) #@45 (fn PROMPT REGEXP-FLAG &optional NOERROR) (defalias 'query-replace-read-args #[770 "\211\204\301 \210\302\"\211:\203\211A@\262\202\303#\203+\304=?\206<\305\306\307\"\310\"\205<\311\307\310#\205C\304=F\207" [current-prefix-arg barf-if-buffer-read-only query-replace-read-from query-replace-read-to - plist-member text-properties-at 0 isearch-regexp-function get-text-property] 11 (#$ . 9488)]) #@2351 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's accessible portion. In interactive use, the prefix arg (non-nil DELIMITED in non-interactive use), means replace only matches surrounded by word boundaries. A negative prefix arg means replace backward. Use \\[next-history-element] to pull the last incremental search string to the minibuffer that reads FROM-STRING, or invoke replacements from incremental search with a key sequence like `C-s C-s M-%' to use its current search string as the string to replace. Matching is independent of case if both `case-fold-search' and `search-upper-case' are non-nil and FROM-STRING has no uppercase letters; if `search-upper-case' is nil, then whether matching ignores case depends on `case-fold-search' regardless of whether there are uppercase letters in FROM-STRING. Replacement transfers the case pattern of the old text to the new text, if both `case-fold-search' and `case-replace' are non-nil and FROM-STRING has no uppercase letters. (Transferring the case pattern means that if the old text matched is all caps, or capitalized, then its replacement is respectively upcased or capitalized.) Ignore read-only matches if `query-replace-skip-read-only' is non-nil, ignore hidden matches if `search-invisible' is nil, and ignore more matches using `isearch-filter-predicate'. If `replace-lax-whitespace' is non-nil, a space or spaces in the string to be replaced will match a sequence of whitespace chars defined by the regexp in `search-whitespace-regexp'. If `replace-char-fold' is non-nil, matching uses character folding, i.e. it ignores diacritics and other differences between equivalent character strings. Fourth and fifth arg START and END specify the region to operate on. Arguments FROM-STRING, TO-STRING, DELIMITED, START, END, BACKWARD, and REGION-NONCONTIGUOUS-P are passed to `perform-replace' (which see). To customize possible responses, change the bindings in `query-replace-map'. (fn FROM-STRING TO-STRING &optional DELIMITED START END BACKWARD REGION-NONCONTIGUOUS-P) (defalias 'query-replace #[1794 "\300\301\302 \302\211    & \207" [perform-replace t nil] 19 (#$ . 9918) (byte-code "\301\302\203\303=\203\304\202\305\202\306\307 \203\310\202\306Q\311\"\211@A@\3128\307 \2051\313 \307 \2058\314 \3158\307 \205C\316 \257\207" [current-prefix-arg query-replace-read-args "Query replace" - " backward" " word" "" use-region-p " in region" nil 2 region-beginning region-end 3 region-noncontiguous-p] 8)]) (define-key esc-map "%" 'query-replace) #@3232 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's accessible portion. Use \\[next-history-element] to pull the last incremental search regexp to the minibuffer that reads REGEXP, or invoke replacements from incremental search with a key sequence like `C-M-s C-M-s C-M-%' to use its current search regexp as the regexp to replace. Matching is independent of case if both `case-fold-search' and `search-upper-case' are non-nil and REGEXP has no uppercase letters; if `search-upper-case' is nil, then whether matching ignores case depends on `case-fold-search' regardless of whether there are uppercase letters in REGEXP. Replacement transfers the case pattern of the old text to the new text, if both `case-fold-search' and `case-replace' are non-nil and REGEXP has no uppercase letters. (Transferring the case pattern means that if the old text matched is all caps, or capitalized, then its replacement is respectively upcased or capitalized.) Ignore read-only matches if `query-replace-skip-read-only' is non-nil, ignore hidden matches if `search-invisible' is nil, and ignore more matches using `isearch-filter-predicate'. If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp to be replaced will match a sequence of whitespace chars defined by the regexp in `search-whitespace-regexp'. This function is not affected by `replace-char-fold'. Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace only matches surrounded by word boundaries. A negative prefix arg means replace backward. Fourth and fifth arg START and END specify the region to operate on. In TO-STRING, `\&' stands for whatever matched the whole of REGEXP, and `\=\N' (where N is a digit) stands for whatever matched the Nth `\(...\)' (1-based) in REGEXP. The `\(...\)' groups are counted from 1. `\?' lets you edit the replacement text in the minibuffer at the given position for each replacement. In interactive calls, the replacement text can contain `\,' followed by a Lisp expression. Each replacement evaluates that expression to compute the replacement string. Inside of that expression, `\&' is a string denoting the whole match as a string, `\N' for a partial match, `\#&' and `\#N' for the whole or a partial match converted to a number with `string-to-number', and `\#' itself for the number of replacements done so far (starting with zero). If the replacement expression is a symbol, write a space after it to terminate it. One space there, if any, will be discarded. When using those Lisp features interactively in the replacement text, TO-STRING is actually made a list instead of a string. Use \[repeat-complex-command] after this command for details. Arguments REGEXP, TO-STRING, DELIMITED, START, END, BACKWARD, and REGION-NONCONTIGUOUS-P are passed to `perform-replace' (which see). (fn REGEXP TO-STRING &optional DELIMITED START END BACKWARD REGION-NONCONTIGUOUS-P) (defalias 'query-replace-regexp #[1794 "\300\301\211 \302\211    & \207" [perform-replace t nil] 19 (#$ . 12781) (byte-code "\301\302\203\303=\203\304\202\305\202\306\307\310 \203\311\202 \306R\312\"\211@A@\3138\310 \2052\314 \310 \2059\315 \3168\310 \205D\317 \257\207" [current-prefix-arg query-replace-read-args "Query replace" - " backward" " word" "" " regexp" use-region-p " in region" t 2 region-beginning region-end 3 region-noncontiguous-p] 8)]) (define-key esc-map [67108901] 'query-replace-regexp) #@2276 Replace some things after point matching REGEXP with the result of TO-EXPR. Interactive use of this function is deprecated in favor of the `\,' feature of `query-replace-regexp'. For non-interactive use, a loop using `search-forward-regexp' and `replace-match' is preferred. 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. TO-EXPR is a Lisp expression evaluated to compute each replacement. It may reference `replace-count' to get the number of replacements already made. If the result of TO-EXPR is not a string, it is converted to one using `prin1-to-string' with the NOESCAPE argument (which see). For convenience, when entering TO-EXPR interactively, you can use `\&' to stand for whatever matched the whole of REGEXP, and `\N' (where N is a digit) to stand for whatever matched the Nth `\(...\)' (1-based) in REGEXP. Use `\#&' or `\#N' if you want a number instead of a string. In interactive use, `\#' in itself stands for `replace-count'. 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's accessible portion. Use \\[next-history-element] to pull the last incremental search regexp to the minibuffer that reads REGEXP. Preserves case in each replacement if `case-replace' and `case-fold-search' are non-nil and REGEXP has no uppercase letters. Ignore read-only matches if `query-replace-skip-read-only' is non-nil, ignore hidden matches if `search-invisible' is nil, and ignore more matches using `isearch-filter-predicate'. If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp to be replaced will match a sequence of whitespace chars defined by the regexp in `search-whitespace-regexp'. This function is not affected by `replace-char-fold'. Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace only matches that are surrounded by word boundaries. Fourth and fifth arg START and END specify the region to operate on. Arguments REGEXP, DELIMITED, START, END, and REGION-NONCONTIGUOUS-P are passed to `perform-replace' (which see). (fn REGEXP TO-EXPR &optional DELIMITED START END REGION-NONCONTIGUOUS-P) (defalias 'query-replace-regexp-eval #[1538 "\300\301B\302\303\304\211\n\n\304 & \207" [perform-replace replace-eval-replacement t literal nil] 18 (#$ . 16559) (byte-code "\303 \210\304\305\306\307\")\310\311\312\313!\"\304\211\307 \307&C\314!\210@\n\315 \205*\316 \315 \2051\317 \315 \2058\320 \257\207" [query-replace-defaults query-replace-to-history-variable current-prefix-arg barf-if-buffer-read-only nil query-replace-read-from "Query replace regexp" t read-from-minibuffer format "Query replace regexp %s with eval: " query-replace-descr replace-match-string-symbols use-region-p region-beginning region-end region-noncontiguous-p] 9)]) (make-obsolete 'query-replace-regexp-eval "use the `\\,' feature of `query-replace-regexp'\nfor interactive calls, and `search-forward-regexp'/`replace-match'\nfor Lisp calls." "22.1") #@1097 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's accessible portion. Non-interactively, TO-STRINGS may be a list of replacement strings. Interactively, reads the regexp using `read-regexp'. Use \\[next-history-element] to pull the last incremental search regexp to the minibuffer that reads REGEXP. A prefix argument N says to use each replacement string N times before rotating to the next. Fourth and fifth arg START and END specify the region to operate on. Arguments REGEXP, START, END, and REGION-NONCONTIGUOUS-P are passed to `perform-replace' (which see). (fn REGEXP TO-STRINGS &optional N START END REGION-NONCONTIGUOUS-P) (defalias 'map-query-replace-regexp #[1538 "\300<\203\f\262\202HG\301U\204H\302\303\"\203:\304\305\301\302\303\f\"#C\"\262\305\302\303 \"T\"\262\202\f\304C\"\262\306\262\202\f\307\310\211\300\n\300  \300\f& \207" [nil 0 string-match " " append substring "" perform-replace t] 19 (#$ . 19693) (byte-code "\303\304\305#\306\307\310\311!\"\305\211\211 \312&\n\205\313\n!\314 \205%\315 \314 \205,\316 \314 \2053\317 \257\207" [query-replace-from-history-variable query-replace-to-history-variable current-prefix-arg read-regexp "Map query replace (regexp): " nil read-from-minibuffer format "Query replace %s with (space-separated strings): " query-replace-descr t prefix-numeric-value use-region-p region-beginning region-end region-noncontiguous-p] 9)]) #@1958 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.) Ignore read-only matches if `query-replace-skip-read-only' is non-nil, ignore hidden matches if `search-invisible' is nil, and ignore more matches using `isearch-filter-predicate'. If `replace-lax-whitespace' is non-nil, a space or spaces in the string to be replaced will match a sequence of whitespace chars defined by the regexp in `search-whitespace-regexp'. If `replace-char-fold' is non-nil, matching uses character folding, i.e. it ignores diacritics and other differences between equivalent character strings. Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace only matches surrounded by word boundaries. A negative prefix arg means replace backward. Operates on the region between START and END (if both are nil, from point to the end of the buffer). Interactively, if Transient Mark mode is enabled and the mark is active, operates on the contents of the region; otherwise from point to the end of the buffer's accessible portion. Arguments BACKWARD and REGION-NONCONTIGUOUS-P are passed to `perform-replace' (which see). Use \\[next-history-element] to pull the last incremental search string to the minibuffer that reads FROM-STRING. 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.) (fn FROM-STRING TO-STRING &optional DELIMITED START END BACKWARD REGION-NONCONTIGUOUS-P) (defalias 'replace-string #[1794 "\300\301\211 \301\211    & \207" [perform-replace nil] 19 (#$ . 21595) (byte-code "\301\302\203\303=\203\304\202\305\202\306\307\310 \203\311\202 \306R\312\"\211@A@\3138\310 \2052\314 \310 \2059\315 \3168\310 \205D\317 \257\207" [current-prefix-arg query-replace-read-args "Replace" - " backward" " word" "" " string" use-region-p " in region" nil 2 region-beginning region-end 3 region-noncontiguous-p] 8)]) (byte-code "\300\301\302\303#\300\207" [function-put replace-string interactive-only "use `search-forward' and `replace-match' instead."] 4) #@2702 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. Ignore read-only matches if `query-replace-skip-read-only' is non-nil, ignore hidden matches if `search-invisible' is nil, and ignore more matches using `isearch-filter-predicate'. If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp to be replaced will match a sequence of whitespace chars defined by the regexp in `search-whitespace-regexp'. This function is not affected by `replace-char-fold' 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's accessible portion. Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace only matches surrounded by word boundaries. A negative prefix arg means replace backward. Fourth and fifth arg START and END specify the region to operate on. Arguments BACKWARD and REGION-NONCONTIGUOUS-P are passed to `perform-replace' (which see). In TO-STRING, `\&' stands for whatever matched the whole of REGEXP, and `\=\N' (where N is a digit) stands for whatever matched the Nth `\(...\)' (1-based) in REGEXP. `\?' lets you edit the replacement text in the minibuffer at the given position for each replacement. In interactive calls, the replacement text may contain `\,' followed by a Lisp expression used as part of the replacement text. Inside of that expression, `\&' is a string denoting the whole match, `\N' a partial match, `\#&' and `\#N' the respective numeric values from `string-to-number', and `\#' itself for `replace-count', the number of replacements occurred so far, starting from zero. If your Lisp expression is an identifier and the next letter in the replacement string would be interpreted as part of it, you can wrap it with an expression like `\,(or \#)'. Incidentally, for this particular case you may also enter `\#' in the replacement text directly. When using those Lisp features interactively in the replacement text, TO-STRING is actually made a list instead of a string. Use \[repeat-complex-command] after this command for details. Use \\[next-history-element] to pull the last incremental search regexp to the minibuffer that reads REGEXP. 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. (fn REGEXP TO-STRING &optional DELIMITED START END BACKWARD REGION-NONCONTIGUOUS-P) (defalias 'replace-regexp #[1794 "\300\301\302 \301\211    & \207" [perform-replace nil t] 19 (#$ . 24174) (byte-code "\301\302\203\303=\203\304\202\305\202\306\307\310 \203\311\202 \306R\312\"\211@A@\3138\310 \2052\314 \310 \2059\315 \3168\310 \205D\317 \257\207" [current-prefix-arg query-replace-read-args "Replace" - " backward" " word" "" " regexp" use-region-p " in region" t 2 region-beginning region-end 3 region-noncontiguous-p] 8)]) (byte-code "\300\301\302\303#\300\207" [function-put replace-regexp interactive-only "use `re-search-forward' and `replace-match' instead."] 4) #@158 History list for some commands that read regular expressions. Maximum length of the history list is determined by the value of `history-length', which see. (defvar regexp-history nil (#$ . 27499)) #@49 History of regexp for occur's collect operation (defvar occur-collect-regexp-history '("\\1") (#$ . 27703)) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313& \207" [custom-declare-variable read-regexp-defaults-function funcall function #[0 "\300\207" [nil] 1] "Function that provides default regexp(s) for `read-regexp'.\nThis function should take no arguments and return one of: nil, a\nregexp, or a list of regexps. Interactively, `read-regexp' uses\nthe return value of this function for its DEFAULT argument.\n\nAs an example, set this variable to `find-tag-default-as-regexp'\nto default to the symbol at point.\n\nTo provide different default regexps for different commands,\nthe function that you set this to can check `this-command'." :type (choice (const :tag "No default regexp reading function" nil) (const :tag "Latest regexp history" regexp-history-last) (function-item :tag "Tag at point" find-tag-default) (function-item :tag "Tag at point as regexp" find-tag-default-as-regexp) (function-item :tag "Tag at point as symbol regexp" find-tag-default-as-symbol-regexp) (function :tag "Your choice of function")) :group matching :version "24.4"] 10) #@330 Return a list of standard suggestions for `read-regexp'. By default, the list includes the tag at point, the last isearch regexp, the last isearch string, and the last replacement regexp. `read-regexp' appends the list returned by this function to the end of values available via \\[next-history-element]. (defalias 'read-regexp-suggestions #[0 "\303 \304 @\305 @\206 \306!\nJ@\257\207" [regexp-search-ring search-ring query-replace-from-history-variable find-tag-default-as-regexp find-tag-default-as-symbol-regexp regexp-quote ""] 5 (#$ . 28886)]) #@1429 Read and return a regular expression as a string. Prompt with the string PROMPT. If PROMPT ends in ":" (followed by optional whitespace), use it as-is. Otherwise, add ": " to the end, possibly preceded by the default result (see below). The optional argument DEFAULTS can be either: nil, a string, a list of strings, or a symbol. We use DEFAULTS to construct the default return value in case of empty input. If DEFAULTS is a string, we use it as-is. If DEFAULTS is a list of strings, the first element is the default return value, but all the elements are accessible using the history command \\[next-history-element]. If DEFAULTS is a non-nil symbol, then if `read-regexp-defaults-function' is non-nil, we use that in place of DEFAULTS in the following: If DEFAULTS is the symbol `regexp-history-last', we use the first element of HISTORY (if specified) or `regexp-history'. If DEFAULTS is a function, we call it with no arguments and use what it returns, which should be either nil, a string, or a list of strings. We append the standard values from `read-regexp-suggestions' to DEFAULTS before using it. If the first element of DEFAULTS is non-nil (and if PROMPT does not end in ":", followed by optional whitespace), we add it to the prompt. The optional argument HISTORY is a symbol to use for the history list. If nil, uses `regexp-history'. (fn PROMPT &optional DEFAULTS HISTORY) (defalias 'read-regexp #[769 "\20309\2030\206\303=\203\211\206\304J@\2021\305\206#!\2051\206, \2021\211:\203;\211@\202<\211<\203E\202GC\306\307 \"\310\311\312\313\314\"\"!\312\315\316 \312\317\320#)\266\203\203n\202\212\203\205G\321V\203\205\322\323\n\324!#\202\212\322\325\n\"\312\211\211\n\206\223\304\317&\211\314\232\203\265\206\243\211\203\300\326\206\256\304\"\210\202\300\211\326\206\275\304\"\210)\207" [read-regexp-defaults-function history-add-new-input inhibit-changing-match-data regexp-history-last regexp-history functionp append read-regexp-suggestions delete-dups delq nil delete "" read-from-minibuffer ":[ ]*\\'" t string-match 0 format "%s (default %s): " query-replace-descr "%s: " add-to-history] 16 (#$ . 29470)]) (byte-code "\300\301\302\"\210\300\303\304\"\210\300\305\306\"\207" [defalias delete-non-matching-lines keep-lines delete-matching-lines flush-lines count-matches how-many] 3) #@119 Read arguments for `keep-lines' and friends. Prompt for a regexp with PROMPT. Value is a list, (REGEXP). (fn PROMPT) (defalias 'keep-lines-read-args #[257 "\300!\301\211\302F\207" [read-regexp nil t] 5 (#$ . 31888)]) #@1196 Delete all lines except those containing matches for REGEXP. A match split across lines preserves all the lines it lies in. When called from Lisp (and usually interactively as well, see below) applies to all lines starting after point. If REGEXP contains upper case characters (excluding those preceded by `\') and `search-upper-case' is non-nil, the matching is case-sensitive. Second and third arg RSTART and REND specify the region to operate on. This command operates on (the accessible part of) all lines whose accessible part is entirely contained in the region determined by RSTART and REND. (A newline ending a line counts as part of that line.) Interactively, in Transient Mark mode when the mark is active, operate on all lines whose accessible part is entirely contained in the region. Otherwise, the command applies to all lines starting after point. When calling this function from Lisp, you can pretend that it was called interactively by passing a non-nil INTERACTIVE argument. This function starts looking for the next match from the end of the previous match. Hence, it ignores matches that overlap a previously found match. (fn REGEXP &optional RSTART REND INTERACTIVE) (defalias 'keep-lines #[1025 "\203\"^b\210\212]b\210n\204m\204\302y\210\303 )\262\202O\211\203E\304 \203E\305 \262\306 b\210n\204>m\204>\302y\210\303 \262\202L`\262\307 \262b\210\212n\204W\310y\210`\203g \203g\311\312\"\202h`W\203\257\313\314#\204~\211|\210\202\223\212\302\224b\210\302y\210`)W\203\222|\210\210\212\310y\210`)\262`W\203i\302\224\302\225U\203i\310u\210\202i)\210)\315\211\223\210\315\207" [case-fold-search search-upper-case 0 point-marker use-region-p region-beginning region-end point-max-marker 1 isearch-no-upper-case-p t re-search-forward move nil] 9 (#$ . 32115) (byte-code "\300 \210\301\302!\207" [barf-if-buffer-read-only keep-lines-read-args "Keep lines containing match for regexp"] 2)]) #@1278 Delete lines containing matches for REGEXP. When called from Lisp (and usually when called interactively as well, see below), applies to the part of the buffer after point. The line point is in is deleted if and only if it contains a match for regexp starting after point. If REGEXP contains upper case characters (excluding those preceded by `\') and `search-upper-case' is non-nil, the matching is case-sensitive. Second and third arg RSTART and REND specify the region to operate on. Lines partially contained in this region are deleted if and only if they contain a match entirely contained in it. Interactively, in Transient Mark mode when the mark is active, operate on the contents of the region. Otherwise, operate from point to the end of (the accessible portion of) the buffer. When calling this function from Lisp, you can pretend that it was called interactively by passing a non-nil INTERACTIVE argument. If a match is split across lines, all the lines it lies in are deleted. They are deleted _before_ looking for the next match. Hence, a match starting on the same line at which another match ended is ignored. Return the number of deleted matching lines. When called interactively, also print the number. (fn REGEXP &optional RSTART REND INTERACTIVE) (defalias 'flush-lines #[1025 "\203^b\210\302]!\262\2023\211\203)\303 \203)\304 \262\302\305 !\262\2020`\262\306 \262b\210\307\203C \203C\310\311\"\202D\212`W\203k\312\311#\203k\212\307\224b\210\307y\210`)\313y\210`|\210\211T\262\202F)\314\211\223\210\203~\315\316\317\320#\"\210)\211\207" [case-fold-search search-upper-case copy-marker use-region-p region-beginning region-end point-max-marker 0 isearch-no-upper-case-p t re-search-forward 1 nil message ngettext "Deleted %d matching line" "Deleted %d matching lines"] 10 (#$ . 34081) (byte-code "\300 \210\301\302!\207" [barf-if-buffer-read-only keep-lines-read-args "Flush lines containing match for regexp"] 2)]) #@862 Print and return number of matches for REGEXP following point. When called from Lisp and INTERACTIVE is omitted or nil, just return the number, do not print it; if INTERACTIVE is t, the function behaves in all respects as if it had been called interactively. If REGEXP contains upper case characters (excluding those preceded by `\') and `search-upper-case' is non-nil, the matching is case-sensitive. Second and third arg RSTART and REND specify the region to operate on. Interactively, in Transient Mark mode when the mark is active, operate on the contents of the region. Otherwise, operate from point to the end of (the accessible portion of) the buffer. This function starts looking for the next match from the end of the previous match. Hence, it ignores matches that overlap a previously found match. (fn REGEXP &optional RSTART REND INTERACTIVE) (defalias 'how-many #[1025 "\212\203\203^b\210]\262\202<b\210d\262\202<\211\2033\302 \2033\303 \262\304 \262\2029`\262d\262b\210\305\306\203N \203N\307\310\"\202O`W\203u`\262\311\310#\203u\211`U\203n\312u\210\202PT\262\202P\203\202\313\314\315\316#\"\210)\266\202)\207" [case-fold-search search-upper-case use-region-p region-beginning region-end 0 nil isearch-no-upper-case-p t re-search-forward 1 message ngettext "%d occurrence" "%d occurrences"] 11 (#$ . 36069) (keep-lines-read-args "How many matches for regexp")]) #@31 Menu keymap for `occur-mode'. (defvar occur-menu-map (byte-code "\301 \302\303\304#\210\302\305#\210\302\306\307#\210\302\310\311#\210\302\312\313#\210\302\314\315#\210\302\316\317#\210\302\320\321#\210\302\322#\210\302\323\324#\210\302\325\326#\210\302\327\330#\210\302\331\332#\210\302\333\334#\210\211\207" [menu-bar-separator make-sparse-keymap bindings--define-key [next-error-follow-minor-mode] (menu-item "Auto Occurrence Display" next-error-follow-minor-mode :help "Display another occurrence when moving the cursor" :button (:toggle and (boundp 'next-error-follow-minor-mode) next-error-follow-minor-mode)) [separator-1] [kill-this-buffer] (menu-item "Kill Occur Buffer" kill-this-buffer :help "Kill the current *Occur* buffer") [quit-window] (menu-item "Quit Occur Window" quit-window :help "Quit the current *Occur* buffer. Bury it, and maybe delete the selected frame") [revert-buffer] (menu-item "Revert Occur Buffer" revert-buffer :help "Replace the text in the *Occur* buffer with the results of rerunning occur") [clone-buffer] (menu-item "Clone Occur Buffer" clone-buffer :help "Create and return a twin copy of the current *Occur* buffer") [occur-rename-buffer] (menu-item "Rename Occur Buffer" occur-rename-buffer :help "Rename the current *Occur* buffer to *Occur: original-buffer-name*.") [occur-edit-buffer] (menu-item "Edit Occur Buffer" occur-edit-mode :help "Edit the *Occur* buffer and apply changes to the original buffers.") [separator-2] [occur-mode-goto-occurrence-other-window] (menu-item "Go To Occurrence Other Window" occur-mode-goto-occurrence-other-window :help "Go to the occurrence the current line describes, in another window") [occur-mode-goto-occurrence] (menu-item "Go To Occurrence" occur-mode-goto-occurrence :help "Go to the occurrence the current line describes") [occur-mode-display-occurrence] (menu-item "Display Occurrence" occur-mode-display-occurrence :help "Display in another window the occurrence the current line describes") [occur-next] (menu-item "Move to Next Match" occur-next :help "Move to the Nth (default 1) next match in an Occur mode buffer") [occur-prev] (menu-item "Move to Previous Match" occur-prev :help "Move to the Nth (default 1) previous match in an Occur mode buffer")] 5) (#$ . 37505)) #@26 Keymap for `occur-mode'. (defvar occur-mode-map (byte-code "\301 \302\303\304#\210\302\305\306#\210\302\307\310#\210\302\311\306#\210\302\312\313#\210\302\314\315#\210\302\316\317#\210\302\320\321#\210\302\322\323#\210\302\324\325#\210\302\326\327#\210\330\331\332B#\210\211\207" [occur-menu-map make-sparse-keymap define-key [mouse-2] occur-mode-mouse-goto "" occur-mode-goto-occurrence "e" occur-edit-mode " " "o" occur-mode-goto-occurrence-other-window "" occur-mode-display-occurrence "\356" occur-next "\360" occur-prev "r" occur-rename-buffer "c" clone-buffer "" next-error-follow-minor-mode bindings--define-key [menu-bar occur] "Occur"] 6) (#$ . 39792)) #@93 Arguments to pass to `occur-1' to revert an Occur mode buffer. See `occur-revert-function'. (defvar occur-revert-arguments nil (#$ . 40478)) (byte-code "\300\301!\210\302\301\303\304#\210\305\306\307\310\311DD\312\313\314\315\316&\210\305\317\307\310\320DD\321\313\314\315\316&\210\305\322\307\310\323DD\324\313\314\315\316&\207" [make-variable-buffer-local occur-revert-arguments put permanent-local t custom-declare-variable occur-mode-hook funcall function #[0 "\300\207" [(turn-on-font-lock)] 1] "Hook run when entering Occur mode." :type hook :group matching occur-hook #[0 "\300\207" [nil] 1] "Hook run by Occur when there are any matches." occur-mode-find-occurrence-hook #[0 "\300\207" [nil] 1] "Hook run by Occur after locating an occurrence.\nThis will be called with the cursor position at the occurrence. An application\nfor this is to reveal context in an outline-mode when the occurrence is hidden."] 8) (defalias 'occur--garbage-collect-revert-args #[0 "\3018\211\203\211@\302!\203\303!\210A\266\202\202\210\304\300!\207" [occur-revert-arguments 2 overlayp delete-overlay kill-local-variable] 4]) (put 'occur-mode 'mode-class 'special) (defvar occur-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [occur-mode-hook variable-documentation put "Hook run after entering Occur mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp occur-mode-map definition-name occur-mode] 4) (defvar occur-mode-map (make-sparse-keymap)) (byte-code "\301\302N\204\303\301\302\304\305!#\210\306\307!\204\303\307\310\311#\210\312\313 !\210\307\302N\204-\303\307\302\304\314!#\210\306\300!\204B\303\300\310\311#\210\315\316\300\317\"\210!\210\300\302N\204P\303\300\302\304\320!#\210\303\311\321\322#\207" [occur-mode-abbrev-table occur-mode-map variable-documentation put purecopy "Keymap for `occur-mode'." boundp occur-mode-syntax-table definition-name occur-mode (lambda (#1=#:def-tmp-var) (defvar occur-mode-syntax-table #1#)) make-syntax-table "Syntax table for `occur-mode'." (lambda (#1#) (defvar occur-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `occur-mode'." derived-mode-parent special-mode] 5) #@451 Major mode for output from \[occur]. \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} In addition to any hooks its parent mode `special-mode' might have run, this mode runs the hook `occur-mode-hook', as the final or penultimate step during initialization. (defalias 'occur-mode #[0 "\306\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315 !\204'\316 \317 \"\210\320\f!\211\2035\211\321 =\203;\322\f\323 \"\210\210\324 \325\"\204R \"=\204R\326 \325\"C#\210\327 !\210\330\f!\210 \"\306\331!\210\332\333\334\335\336\307$\210\337#)\340\341!\207" [delay-mode-hooks major-mode mode-name occur-mode-map occur-mode-syntax-table occur-mode-abbrev-table make-local-variable t special-mode occur-mode "Occur" mode-class put keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table abbrev-table-get :parents abbrev-table-put use-local-map set-syntax-table revert-buffer-function occur-revert-function add-hook kill-buffer-hook occur--garbage-collect-revert-args nil occur-next-error run-mode-hooks occur-mode-hook local-abbrev-table next-error-function] 5 (#$ . 42776) nil]) #@31 Keymap for `occur-edit-mode'. (defvar occur-edit-mode-map (byte-code "\302 \303\"\210\304\305\306#\210\304\307\310#\210\304\311\312#\210\304\313\314#\210\315\316\317 B#\210\211\207" [text-mode-map occur-menu-map make-sparse-keymap set-keymap-parent define-key [mouse-2] occur-mode-mouse-goto "" occur-cease-edit "" occur-mode-display-occurrence "" next-error-follow-minor-mode bindings--define-key [menu-bar occur] "Occur"] 6) (#$ . 44145)) (defvar occur-edit-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [occur-edit-mode-hook variable-documentation put "Hook run after entering Occur-Edit mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp occur-edit-mode-map definition-name occur-edit-mode] 4) (defvar occur-edit-mode-map (make-sparse-keymap)) (byte-code "\301\302N\204\303\301\302\304\305!#\210\306\307!\204\303\307\310\311#\210\312\313 !\210\307\302N\204-\303\307\302\304\314!#\210\306\300!\204B\303\300\310\311#\210\315\316\300\317\"\210!\210\300\302N\204P\303\300\302\304\320!#\210\303\311\321\322#\207" [occur-edit-mode-abbrev-table occur-edit-mode-map variable-documentation put purecopy "Keymap for `occur-edit-mode'." boundp occur-edit-mode-syntax-table definition-name occur-edit-mode (lambda (#1=#:def-tmp-var) (defvar occur-edit-mode-syntax-table #1#)) make-syntax-table "Syntax table for `occur-edit-mode'." (lambda (#1#) (defvar occur-edit-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `occur-edit-mode'." derived-mode-parent occur-mode] 5) #@364 Major mode for editing *Occur* buffers. In this mode, changes to the *Occur* buffer are also applied to the originating buffer. To return to ordinary Occur mode, use \[occur-cease-edit]. In addition to any hooks its parent mode `occur-mode' might have run, this mode runs the hook `occur-edit-mode-hook', as the final or penultimate step during initialization. (defalias 'occur-edit-mode #[0 "\306\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315 !\204'\316 \317 \"\210\320\f!\211\2035\211\321 =\203;\322\f\323 \"\210\210\324 \325\"\204R \"=\204R\326 \325\"C#\210\327 !\210\330\f!\210 \"\331#\332\333\334\331\307$\210\335\336\337!!\210)\340\341!\207" [delay-mode-hooks major-mode mode-name occur-edit-mode-map occur-edit-mode-syntax-table occur-edit-mode-abbrev-table make-local-variable t occur-mode occur-edit-mode "Occur-Edit" mode-class put keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table abbrev-table-get :parents abbrev-table-put use-local-map set-syntax-table nil add-hook after-change-functions occur-after-change-function message substitute-command-keys "Editing: Type \\[occur-cease-edit] to return to Occur mode." run-mode-hooks occur-edit-mode-hook local-abbrev-table buffer-read-only] 5 (#$ . 45804) nil]) #@44 Switch from Occur Edit mode to Occur mode. (defalias 'occur-cease-edit #[0 "\300\301!\205\f\302 \210\303\304!\207" [derived-mode-p occur-edit-mode occur-mode message "Switching to Occur mode."] 2 (#$ . 47146) nil]) #@23 (fn BEG END LENGTH) (defalias 'occur-after-change-function #[771 "\212b\210\301 \302\303\"\304!\305\302\306\"\205\253\302\306\"?\205\253\307U\203?\310\303$\210\212\311\312\313#\203>`S|\210)\314 \314\315 !Zrq\210)\316!\206V\317\320\"\321 \212\322\306\305$b\210`Z\262\323`\")\324!r\325\307\326\327\330!\331\"\332$\216\333@\334\"\210b\210\335!\210\203\231\336\337 \"\210\202\242\301 \321 |\210c\210\340!*\262\266\205\266\204)\207" [buffer-read-only line-beginning-position get-text-property occur-target marker-buffer nil occur-prefix 0 put-text-property search-forward "\n" t line-number-at-pos window-start get-buffer-window display-buffer (nil (inhibit-same-window . t) (inhibit-switch-frame . t)) line-end-position next-single-property-change buffer-substring-no-properties internal--before-with-selected-window make-byte-code "\301\300!\207" vconcat vector [internal--after-with-selected-window] 2 select-window norecord recenter message "Buffer `%s' is read only." move-to-column] 19 (#$ . 47368)]) #@70 Handle `revert-buffer' for Occur mode buffers. (fn IGNORE1 IGNORE2) (defalias 'occur-revert-function #[514 "\301\302\303\304 C\"\"\207" [occur-revert-arguments apply occur-1 append buffer-name] 7 (#$ . 48426)]) (defalias 'occur-mode-find-occurrence #[0 "\300`\301\"\211\204\f\302\303!\210\304\305!!\204\302\306!\210\211\207" [get-text-property occur-target error "No occurrence on this line" buffer-live-p marker-buffer "Buffer for this occurrence was killed"] 4]) (defalias 'occur-mode-mouse-goto 'occur-mode-goto-occurrence) #@150 Go to the occurrence specified by EVENT, a mouse click. If not invoked by a mouse click, go to occurrence on the current line. (fn &optional EVENT) (defalias 'occur-mode-goto-occurrence #[256 "\211\205p\204\300 \202%r\301\302!\211@\262!q\210\212\303\302!!b\210\300 *\304\305!!\210\211b\210\2037\306p\"\210\307\310!\207" [occur-mode-find-occurrence window-buffer event-end posn-point pop-to-buffer marker-buffer next-error-found run-hooks occur-mode-find-occurrence-hook] 6 (#$ . 48966) (list last-nonmenu-event)]) #@69 Go to the occurrence the current line describes, in another window. (defalias 'occur-mode-goto-occurrence-other-window #[0 "p\300 \301\302!!\210\211b\210\303p\"\210\304\305!\207" [occur-mode-find-occurrence switch-to-buffer-other-window marker-buffer next-error-found run-hooks occur-mode-find-occurrence-hook] 5 (#$ . 49500) nil]) #@70 Display in another window the occurrence the current line describes. (defalias 'occur-mode-display-occurrence #[0 "p\300 \301\302\303!\304\"\262\305 r\306\307\310\311\312!\313\"\314$\216\315!\210b\210\316p\"\210\317\320!*\262\207" [occur-mode-find-occurrence nil display-buffer marker-buffer t internal--before-save-selected-window make-byte-code 0 "\301\300!\207" vconcat vector [internal--after-save-selected-window] 2 select-window next-error-found run-hooks occur-mode-find-occurrence-hook] 10 (#$ . 49840) nil]) #@25 (fn N SEARCH MESSAGE) (defalias 'occur-find-match #[771 "\204\300\262\301\302V\205:`\303\"\262\211\203%\304\303\"\203%\303\"\262\211\203/\211b\210\2023\305!\210S\262\202\207" [1 nil 0 occur-match get-text-property user-error] 7 (#$ . 50370)]) #@83 Move to the Nth (default 1) next match in an Occur mode buffer. (fn &optional N) (defalias 'occur-next #[256 "\300\301\302#\207" [occur-find-match next-single-property-change "No more matches"] 5 (#$ . 50642) "p"]) #@87 Move to the Nth (default 1) previous match in an Occur mode buffer. (fn &optional N) (defalias 'occur-prev #[256 "\300\301\302#\207" [occur-find-match previous-single-property-change "No earlier matches"] 5 (#$ . 50865) "p"]) #@206 Move to the ARGPth (default 1) next match in an Occur mode buffer. RESET non-nil means rewind to the first match. This is a compatibility function for \[next-error] invocations. (fn &optional ARGP RESET) (defalias 'occur-next-error #[512 "\211\203e\202\300W\203\301 \202\300V\203\302 \202`b\210\303\304!\300V\203/\305\2020\306\307#\210\310p\311\"\211\203@\312`\"\210\210\313 \207" [0 line-beginning-position line-end-position occur-find-match abs previous-single-property-change next-single-property-change "No more matches" get-buffer-window t set-window-point occur-mode-goto-occurrence] 6 (#$ . 51100) "p"]) (byte-code "\300\301\302\303\304\305\304\306\307\310& \210\311\312\313\314\315DD\316\317\320\304\305&\210\321\322\323\"\210\311\324\313\314\325DD\326\317\327\304\305&\210\311\330\313\314\331DD\332\317\327\304\305&\210\311\333\313\314\334DD\335\317\327\304\305\307\336& \210\311\337\313\314\340DD\341\317\342\304\305\307\336& \210\311\343\313\314\344DD\345\317\327\304\305\307\346& \210\311\347\313\314\350DD\351\317\352\304\305\307\310& \207" [custom-declare-face match ((((class color) (min-colors 88) (background light)) :background "yellow1") (((class color) (min-colors 88) (background dark)) :background "RoyalBlue3") (((class color) (min-colors 8) (background light)) :background "yellow" :foreground "black") (((class color) (min-colors 8) (background dark)) :background "blue" :foreground "white") (((type tty) (class mono)) :inverse-video t) (t :background "gray")) "Face used to highlight matches permanently." :group matching basic-faces :version "22.1" custom-declare-variable list-matching-lines-default-context-lines funcall function #[0 "\300\207" [0] 1] "Default number of context lines included around `list-matching-lines' matches.\nA negative number means to include that many lines before the match.\nA positive number means to include that many lines both before and after." :type integer defalias list-matching-lines occur list-matching-lines-face #[0 "\300\207" [match] 1] "Face used by \\[list-matching-lines] to show the text that matches.\nIf the value is nil, don't highlight the matching portions specially." face list-matching-lines-buffer-name-face #[0 "\300\207" [underline] 1] "Face used by \\[list-matching-lines] to show the names of buffers.\nIf the value is nil, don't highlight the buffer names specially." list-matching-lines-current-line-face #[0 "\300\207" [lazy-highlight] 1] "Face used by \\[list-matching-lines] to highlight the current line." "26.1" list-matching-lines-jump-to-current-line #[0 "\300\207" [nil] 1] "If non-nil, \\[list-matching-lines] shows the current line highlighted.\nSet the point right after such line when there are matches after it." boolean list-matching-lines-prefix-face #[0 "\300\207" [shadow] 1] "Face used by \\[list-matching-lines] to show the prefix column.\nIf the face doesn't differ from the default face,\ndon't highlight the prefix with line numbers specially." "24.4" occur-excluded-properties #[0 "\300\207" [(read-only invisible intangible field mouse-face help-echo local-map keymap yank-handler follow-link)] 1] "Text properties to discard when copying lines to the *Occur* buffer.\nThe value should be a list of text properties to discard or t,\nwhich means to discard all text properties." (choice (const :tag "All" t) (repeat symbol))] 10) (defalias 'occur-read-primary-args #[0 ":\302\203 \303\202\f\304\305\"\211\203.\306!\307U\203\310\2025 @\302\311\312\"\301#\262\2025\2055\313!D\207" [current-prefix-arg occur-collect-regexp-history read-regexp "Collect strings matching regexp" "List lines matching regexp" regexp-history-last regexp-opt-depth 0 "\\&" format "Regexp to collect (default %s): " prefix-numeric-value] 8]) #@536 Rename the current *Occur* buffer to *Occur: original-buffer-name*. Here `original-buffer-name' is the buffer name where Occur was originally run. If UNIQUE-P is non-nil (interactively, the prefix argument), or called non-interactively with INTERACTIVE-P nil, the renaming will not clobber the existing buffer(s) of that name, but will use `generate-new-buffer-name' instead. You can add this to `occur-hook' if you always want a separate *Occur* buffer for each buffer where you invoke `occur'. (fn &optional UNIQUE-P INTERACTIVE-P) (defalias 'occur-rename-buffer #[512 "r\302=\203 p\202\303\304!q\210\305\306\307\310 AA@\311#\312Q\206\"?\")\207" [major-mode occur-revert-arguments occur-mode get-buffer "*Occur*" rename-buffer "*Occur: " mapconcat buffer-name "/" "*"] 8 (#$ . 54875) "P\np"]) (defvar occur--final-pos nil) #@1904 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 match is extended to include complete lines. Only non-overlapping matches are considered. (Note that extending matches to complete lines could cause some of the matches to overlap; if so, they will not be shown as separate matches.) 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. Optional arg REGION, if non-nil, mean restrict search to the specified region. Otherwise search the entire buffer. REGION must be a list of (START . END) positions as returned by `region-bounds'. The lines are shown in a buffer named `*Occur*'. It serves as a menu to find any of the occurrences in this buffer. \\[describe-mode] in that buffer will explain how. If `list-matching-lines-jump-to-current-line' is non-nil, then show the current line highlighted with `list-matching-lines-current-line-face' and set point at the first match after such line. If REGEXP contains upper case characters (excluding those preceded by `\') and `search-upper-case' is non-nil, the matching is case-sensitive. When NLINES is a string or when the function is called interactively with prefix argument without a number (`C-u' alone as prefix) the matching strings are collected into the `*Occur*' buffer by using NLINES as a replacement regexp. NLINES may contain \& and \N which convention follows `replace-match'. For example, providing "defun\s +\(\S +\)" for REGEXP and "\1" for NLINES collects all the function names in a lisp program. When there is no parenthesized subexpressions in REGEXP the entire match is collected. In any case the searched buffer is not modified. (fn REGEXP &optional NLINES REGION) (defalias 'occur #[769 "\211@@\205 \211@@e]@A\205@Ad^\206\211\211\204$pC\202:\300\206*e\206/d\"\301\302`#\210\211C\262\303#\207" [make-overlay overlay-put occur--orig-point occur-1] 11 (#$ . 55716) (byte-code "\300 \301 \205\n\302 C\244\207" [occur-read-primary-args use-region-p region-bounds] 2)]) #@464 Show all lines in buffers BUFS containing a match for REGEXP. Optional argument NLINES specifies the number of context lines to show with each match, see `list-matching-lines-default-context-lines'. This function acts on multiple buffers; otherwise, it is exactly like `occur'. When you invoke this command interactively, you must specify the buffer names that you want, one by one. See also `multi-occur-in-matching-buffers'. (fn BUFS REGEXP &optional NLINES) (defalias 'multi-occur #[770 "\300#\207" [occur-1] 7 (#$ . 57948) (byte-code "\302\303p\304#C\305\302 \306=\203\307\202\310\305\304#\211\262\311\230\2043\211\312\"\204-\211B\262\210\202 \313\314\"\237)\266\202\315 B\207" [ido-ignore-item-temp-list read-buffer-function read-buffer "First buffer to search: " t nil ido-read-buffer "Next buffer to search (C-j to end): " "Next buffer to search (RET to end): " "" memql mapcar get-buffer occur-read-primary-args] 6)]) #@356 Show all lines matching REGEXP in buffers specified by BUFREGEXP. Normally BUFREGEXP matches against each buffer's visited file name, but ALLBUFS non-nil (interactively, if you specify a prefix argument), it matches against the buffer name and includes also buffers that don't visit files. See also `multi-occur'. (fn BUFREGEXP REGEXP &optional ALLBUFS) (defalias 'multi-occur-in-matching-buffers #[770 "\205\300\301\302\301\303\304\305\306\307\310 \f\"\311\"\312\313%\314 \"\"#\207" [occur-1 nil delq mapcar make-byte-code 257 "\301\203 \302\300\303!\"\202\304!\205\302\300\304!\"\205\211\207" vconcat vector [string-match buffer-name buffer-file-name] 5 "\n\n(fn BUF)" buffer-list] 16 (#$ . 58903) (byte-code "@\302 \203 \303\202\f\304!\211\305\232\203\202\211\266\202\306 B\207" [regexp-history current-prefix-arg read-regexp "List lines in buffers whose names match regexp: " "List lines in buffers whose filenames match regexp: " "" occur-read-primary-args] 4)]) #@15 (fn REGEXP) (defalias 'occur-regexp-descr #[257 "\300\301\302\303\304#\206 \305\302\303\306#\203$\307\310\302\303\306#!\311#\202'\310!#\207" [format " for %s\"%s\"" get-text-property 0 isearch-regexp-function-descr "" isearch-string propertize query-replace-descr help-echo] 10 (#$ . 59902)]) #@46 (fn REGEXP NLINES BUFS &optional BUF-NAME) (defalias 'occur-1 #[1027 "\203\n\306\232\203\307\310!\210\211\204\311\262\312\313\312\314\315\"\"\314\316\"\235\2031r\317!q\210\320 \210)\321!\262rq\210;\203E\322 \210\202H\323 \210\324\211\312\325 \210;\203\302\326\211\203\273\211@r\327!\203k\330!\202l\211q\210\212\327!\203{\331!\202|eb\210\327!\205\207\332!\333\n\324#\203\262\334 !\211\203\256rq\210\211c\210T\262i\326U\204\255\335c\210)\210\202\207\210*A\266\202\202X\210\211\262\202\362\336\206\315 \f\203\335 \203\335\337 \324\"\202\336\f:\340;!\205\351;<=\324=?& GGZ\341\342\343\344\345#\326U\203 \306\202\346\347\"\326U\203\350\202 \346\351 \"\343\352\353 #\354\326\355#\2061G\356\\\357 V\203>\306\202B\360!&\266\361 \210E>\211\326U\203^\362!\202{\363!\210\203n\364\365\366\"\"\210?\324@\367\312!\210\370\371!\262,\207" [occur--final-pos buffer-undo-list inhibit-read-only list-matching-lines-default-context-lines case-fold-search search-upper-case "" error "Occur doesn't work with the empty regexp" "*Occur*" nil delq mapcar #[257 "\300!\204\301!\205\302!\205\211\207" [buffer-live-p overlayp overlay-buffer] 3 "\n\n(fn BOO)"] #[257 "\300\301!\203 \302!\202!\207" [buffer-name overlayp overlay-buffer] 4 "\n\n(fn BOO)"] get-buffer rename-uniquely get-buffer-create fundamental-mode occur-mode t erase-buffer 0 overlayp overlay-buffer overlay-start overlay-end re-search-forward match-substitute-replacement "\n" occur-engine isearch-no-upper-case-p face-differs-from-default-p message "Searched %d %s%s; %s %s%s" ngettext "buffer" "buffers" format " (%d killed)" "no" "%d" "match" "matches" get-text-property isearch-string 42 window-width occur-regexp-descr occur--garbage-collect-revert-args kill-buffer display-buffer set-window-point get-buffer-window all-frames set-buffer-modified-p run-hooks occur-hook list-matching-lines-buffer-name-face list-matching-lines-prefix-face list-matching-lines-face occur-excluded-properties occur-revert-arguments next-error-last-buffer buffer-read-only] 20 (#$ . 60214)]) #@93 (fn REGEXP BUFFERS OUT-BUF NLINES CASE-FOLD TITLE-FACE PREFIX-FACE MATCH-FACE KEEP-PROPS) (defalias 'occur-engine #[2313 "rq\210\306\211\307 A\f\211\203\235\211@\310!\203#\311!\202&\312!\203\226r\310!\2036\311!\2027\211q\210\313\306\211rq\210`)\310!\204N\314 \202U\314\315\316\"!\212\310!\203f\317!\202geb\210\306y\210\310!\203z\320!\202{d\314 \211\307\211\211\306\307\211\211\211\321\307\204\231\322\302!\203\231\n\262` W\203\203`\262\323\"\313#\211\262\203UT\262\306\224\262\212b\210\324 \262b\210\325 \262)\n\326\"\\\262 \327 \262\307\223\210\330#\262G\306\306U\203\365T\262 \203B\204B\204\331\262 \204\314d!\262!\fU\203)\332\306\f\307%\210\333\306\334$\210 \"ZY\203B \"\\X\203B\313\262\f\211W\203\204\335$#\203\204T\262\333\306\224\306\225\336$\210\203q\332\306\224\306\225\307%\210\306\225U\203~T\202\211\266\202\202B\266\337\340\341\342\"\343\205\227\344 D\345\313\346\313\347\313\350\351BBBBBBBB\"#\340\350\352\313\353\354&\355\356\203\306\340\357\344\"#\202\307\357\340P\360\361##\340\356\350#P!\306U\203\341\211\202\362#  '\"& \262A@\262 @ \205) ?\205)V\205)\313\262\212eb\210Sy\210\330\324 \325  #)r$q\210\211\203L\332\306G\f\307%\210\333\306G\363$\210\364C\"\"@c\210c\210)\266b\210\203x\365 \326\"n\203nl\203n\331\202o\306#\262 \331y\210\202{db\210\nS\262 \202\231\203\231rq\210\337\366\364\n\"\"c\210) \203\330 \204\330\313\262\n\212eb\210 Sy\210\330\324 \325 #)\332\306G\f\307%\210\333\306G\367$\210r q\210\364C\"@c\210)\210)\266 )\306U\204\222 \\\262\f\n\\\262 rq\210b\210`\307\340\341\370\371\372\373 #\n\nU\203\321\202\341\374\f\371\375\376##G\331V\203&\321\202*\377!\201@\310!\203;\311!\202=!\310!\203U\341\201A\317!\320!#\202V\321&\201B\313#c\210`\262\203n\332#\210 \203\215 \204\215db\205\210\201C`\201D\"\206\210d\211\202\216eb\266))\266)A\266\202\202\210\306U\204\357\fG\331V\203\357eb\210`\307\341\201E\371\372\373 #\n\nU\203\311\321\202\324\341\374\f\371\375\376##\377!%c\210`\262\n\203\352\332 #\210\266eb\210\203\371\201F!\210)\266\205)\207" [case-fold-search inhibit-field-text-motion buffer-file-coding-system list-matching-lines-jump-to-current-line list-matching-lines-current-line-face occur--final-pos 0 nil overlayp overlay-buffer buffer-live-p t line-number-at-pos overlay-get occur--orig-point overlay-start overlay-end "" local-variable-p re-search-forward line-beginning-position line-end-position count-lines make-marker occur-engine-line 1 add-face-text-property add-text-properties (current-line t) string-match (occur-match t) apply propertize format "%7d:" append font-lock-face occur-prefix front-sticky rear-nonsticky occur-target (follow-link t help-echo "mouse-2: go to this occurrence") follow-link help-echo "mouse-2: go to this occurrence" replace-regexp-in-string "\n" "\n :" mouse-face highlight occur-context-lines (current-line t) occur-engine-add-prefix + concat (current-line t) "%d %s%s%s in buffer: %s%s\n" ngettext "match" "matches" " in %d %s" "line" "lines" occur-regexp-descr buffer-name " within region: %d-%d" read-only previous-single-property-change current-line "%d %s%s total%s:\n" set-buffer-file-coding-system] 49 (#$ . 62374)]) #@37 (fn BEG END &optional KEEP-PROPS) (defalias 'occur-engine-line #[770 "\211\203\"\302\300!\203\"\203\"\303\304\305$\203\"\306\307!\203\"\307\"\210\211\2039 \305=\2049{\310\311G $\210\211\207\312\"\207" [jit-lock-mode occur-excluded-properties boundp text-property-not-all fontified t fboundp jit-lock-fontify-now remove-list-of-text-properties 0 buffer-substring-no-properties] 9 (#$ . 65828)]) #@36 (fn LINES &optional PREFIX-FACE) (defalias 'occur-engine-add-prefix #[513 "\300\301\302\303\304\305!\306\"\307\310%\"\207" [mapcar make-byte-code 257 "\300\203\f\301\302\303\300#\202 \302\304Q\207" vconcat vector [propertize " :" font-lock-face "\n"] 5 "\n\n(fn LINE)"] 9 (#$ . 66248)]) #@38 (fn COUNT &optional KEEP-PROPS PT) (defalias 'occur-accumulate-lines #[769 "\212\211\203\211b\210\300V\301\211\211\211\300U\204X\203m\202$o\203'\211?\204X\2031\302\2022\303\\\262\304 \262\305 \262\306 #B\262\203O\303\202P\302y\300U\262\202\237\266\205)\207" [0 nil -1 1 line-beginning-position line-end-position occur-engine-line] 12 (#$ . 66555)]) #@130 (fn OUT-LINE NLINES KEEP-PROPS BEGPT ENDPT CURR-LINE PREV-LINE PREV-AFTER-LINES &optional PREFIX-FACE ORIG-LINE MULTI-OCCUR-P) (defalias 'occur-context-lines #[2824 "\302\303 !T[\n\n#A\237\302 T \n#A\304\203y\204y ZY\203N W\203NG ZZ8\305\306G \304%\210\307\306G\310$\266 \\X\203y V\203y\311\n\312#8\305\306G \304%\210\307\306G\313$\266\203\246G\\ GZY\203\243\314\211G\311\f\fG\312$Z\"\262\202\246\315\262\203\321GZX\203\307G\311\n\n\312#Z\233\262\202\321\f\306V\204\321\315\262\316\317\320 \205\337\321\n\n\"\205\363 \203\361\322\323\f#\202\362C\321\f\"C$\" \306V\205D\207" [list-matching-lines-jump-to-current-line list-matching-lines-current-line-face occur-accumulate-lines abs nil add-face-text-property 0 add-text-properties (current-line t) - 1 (current-line t) butlast "-------\n" apply concat append occur-engine-add-prefix propertize font-lock-face] 22 (#$ . 66945)]) #@40 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 in this buffer with no more questions,\n^ to move point back to previous match,\nu to undo previous replacement,\nU to undo all replacements,\nE to edit the replacement string.\nIn multi-buffer replacements type `Y' to replace all remaining\nmatches in all remaining buffers with no more questions,\n`N' to skip to the next buffer without replacing remaining matches\nin the current buffer." (#$ . 67932)) #@497 Keymap of responses to questions posed by commands like `query-replace'. The "bindings" in this map are not commands; they are answers. The valid answers include `act', `skip', `act-and-show', `act-and-exit', `exit', `exit-prefix', `recenter', `scroll-up', `scroll-down', `scroll-other-window', `scroll-other-window-down', `edit', `edit-replacement', `delete-and-edit', `automatic', `backup', `undo', `undo-all', `quit', and `help'. This keymap is used by `y-or-n-p' as well as `query-replace'. (defvar query-replace-map (byte-code "\300 \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\315#\210\301\317\320#\210\301\321\322#\210\301\323\322#\210\301\324\322#\210\301\325\326#\210\301\327\330#\210\301\331\332#\210\301\333\334#\210\301\335\336#\210\301\337\340#\210\301\341\342#\210\301\343\344#\210\301\345\346#\210\301\347\346#\210\301\350\346#\210\301\351\346#\210\301\352\353#\210\301\354\353#\210\301\355\356#\210\301\357\360#\210\301\361\356#\210\301\362\360#\210\301\363\364#\210\301\365\364#\210\301\366\367#\210\301\370\367#\210\301\371\372#\210\211\207" [make-sparse-keymap define-key " " act "" skip [delete] [backspace] "y" "n" "Y" "N" "e" edit-replacement "E" "," act-and-show "q" exit " " [return] "." act-and-exit "" edit "" delete-and-edit "\f" recenter "!" automatic "^" backup "u" undo "U" undo-all "" help [f1] [help] "?" "" quit "" "" scroll-up "\366" scroll-down [next] [prior] [134217750] scroll-other-window [M-next] [167772182] scroll-other-window-down [M-prior] [escape] exit-prefix] 5) (#$ . 68815)) #@455 Keymap that defines additional bindings for multi-buffer replacements. It extends its parent map `query-replace-map' with new bindings to operate on a set of buffers/files. The difference with its parent map is the additional answers `automatic-all' to replace all remaining matches in all remaining buffers with no more questions, and `exit-current' to skip remaining matches in the current buffer and to continue with the next buffer in the sequence. (defvar multi-query-replace-map (byte-code "\301 \302\"\210\303\304\305#\210\303\306\307#\210\211\207" [query-replace-map make-sparse-keymap set-keymap-parent define-key "Y" automatic-all "N" exit-current] 5) (#$ . 70506)) #@381 Process a list (and any sub-lists), expanding certain symbols. Symbol Expands To N (match-string N) (where N is a string of digits) #N (string-to-number (match-string N)) & (match-string 0) #& (string-to-number (match-string 0)) # replace-count Note that these symbols must be preceded by a backslash in order to type them using Lisp syntax. (fn N) (defalias 'replace-match-string-symbols #[257 "\211:\205r\211@:\203\300@!\210\202k\211@9\203k\301@!\302\303\"\203/\304\305!D\240\210\202j\302\306\"\203F\305\304\305\307\310\"!DD\240\210\202j\211\311\230\203S\312\240\210\202j\211\313\230\203`\314\240\210\202j\211\315\230\203j\316\240\210\210\211A\262\202\207" [replace-match-string-symbols symbol-name string-match "^[0-9]+$" match-string string-to-number "^#[0-9]+$" substring 1 "&" (match-string 0) "#&" (string-to-number (match-string 0)) "#" replace-count] 9 (#$ . 71194)]) #@25 (fn EXPRESSION COUNT) (defalias 'replace-eval-replacement #[514 "\211\3011 \302!0\202\303\304\"\262\211;\203\211\202 \305\306\")\207" [replace-count (error) eval error "Error evaluating replacement expression: %S" prin1-to-string t] 6 (#$ . 72136)]) #@286 Quote a replacement string. This just doubles all backslashes in REPLACEMENT and returns the resulting string. If REPLACEMENT is not a string, it is first passed through `prin1-to-string' with the `noescape' argument set. `match-data' is preserved across the call. (fn REPLACEMENT) (defalias 'replace-quote #[257 "\300 \301\302\303\304\305!\306\"\307$\216\310\311\211;\203\202\312\313\"\313\211%)\207" [match-data make-byte-code 0 "\301\300\302\"\207" vconcat vector [set-match-data evaporate] 3 replace-regexp-in-string "\\\\" prin1-to-string t] 8 (#$ . 72406)]) #@19 (fn DATA COUNT) (defalias 'replace-loop-through-replacements #[514 "\300HU\203&\300\301H\\I\210\302HA\302:\203 \202#\303HI\266\302H@\207" [0 1 2 3] 7 (#$ . 72987)]) #@204 Like `match-data', but markers in REUSE get invalidated. If NEW is non-nil, it is set and returned instead of fresh data, but coerced to the correct value of INTEGERS. (fn INTEGERS REUSE &optional NEW) (defalias 'replace-match-data #[770 "\211\203\300!\210\211=\203?\301@!=\203\211\206!\302\303#\207" [set-match-data markerp match-data t] 7 (#$ . 73176)]) #@688 Make a replacement with `replace-match', editing `\?'. FIXEDCASE, LITERAL are passed to `replace-match' (which see). After possibly editing it (if `\?' is present), NEWTEXT is also passed to `replace-match'. If NOEDIT is true, no check for `\?' is made (to save time). MATCH-DATA is used for the replacement, and is a data structure as returned from the `match-data' function. In case editing is done, it is changed to use markers. BACKWARD is used to reverse the replacement direction. The return value is non-nil if there has been no `\?' or NOEDIT was passed in. If LITERAL is set, no checking is done, anyway. (fn NEWTEXT FIXEDCASE LITERAL NOEDIT MATCH-DATA &optional BACKWARD) (defalias 'replace-match-maybe-edit #[1541 "\2042\2042\300\262\301\302\"\2032\303\304\305\306\300\211 \307%\307\224TB\310\311\211#\262\"\262\311\262\202 \312!\210\305#\210\312!\210\211\203K@b\210\207" [t string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\\\?\\)" read-string "Edit replacement string: " replace-match "" 3 replace-match-data nil set-match-data] 14 (#$ . 73553)]) #@74 Function(s) to call after query-replace has found a match in the buffer. (defvar replace-update-post-hook nil (#$ . 74653)) #@176 Function to use when searching for strings to replace. It is used by `query-replace' and `replace-string', and is called with three arguments, as if it were `search-forward'. (defvar replace-search-function nil (#$ . 74784)) #@243 Function to use when searching for regexps to replace. It is used by `query-replace-regexp', `replace-regexp', `query-replace-regexp-eval', and `map-query-replace-regexp'. It is called with three arguments, as if it were `re-search-forward'. (defvar replace-re-search-function nil (#$ . 75016)) #@143 Search for the next occurrence of SEARCH-STRING to replace. (fn SEARCH-STRING LIMIT REGEXP-FLAG DELIMITED-FLAG CASE-FOLD &optional BACKWARD) (defalias 'replace-search #[1541 "\206 \205?\205\306  \n \307\f\310 \211?\203,\202.\2063\311 \211\310#.\207" [isearch-regexp replace-char-fold isearch-regexp-function replace-lax-whitespace isearch-lax-whitespace replace-regexp-lax-whitespace char-fold-to-regexp nil t isearch-search-fun-default isearch-regexp-lax-whitespace isearch-case-fold-search isearch-adjusted isearch-nonincremental isearch-forward replace-re-search-function replace-search-function] 11 (#$ . 75318)]) (defvar replace-overlay nil) #@118 (fn MATCH-BEG MATCH-END RANGE-BEG RANGE-END SEARCH-STRING REGEXP-FLAG DELIMITED-FLAG CASE-FOLD &optional BACKWARD) (defalias 'replace-highlight #[2312 "\203' \203\306 \n\np$\210\202'\307  \"\310 \311\312#\210\310 \313\314#\210\n\205_\206; \205;?\205;\315\f ?\316\317\". \207" [query-replace-highlight replace-overlay query-replace-lazy-highlight replace-char-fold replace-lax-whitespace replace-regexp-lax-whitespace move-overlay make-overlay overlay-put priority 1001 face query-replace char-fold-to-regexp nil isearch-lazy-highlight-new-loop isearch-error isearch-other-end isearch-forward isearch-case-fold-search isearch-regexp-lax-whitespace isearch-lax-whitespace isearch-regexp-function isearch-regexp isearch-string] 18 (#$ . 76005)]) (defalias 'replace-dehighlight #[0 "\203\304!\210 \203\302\n!\210\305\306 \207" [replace-overlay query-replace-lazy-highlight lazy-highlight-cleanup isearch-lazy-highlight-last-string delete-overlay nil isearch-clean-overlays] 2]) #@47 (fn REPLACED SEARCH-STR NEXT-REPLACE STACK) (defalias 'replace--push-stack '(macro . #[1028 "\300\301\302\303\304BB\257E\207" [push list (point) if ((list (match-beginning 0) (match-end 0) (current-buffer)) (match-data t))] 11 (#$ . 77040)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put replace--push-stack lisp-indent-function 0 put edebug-form-spec (form form form gv-place)] 5) #@1186 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[ \t]+bar" nil t) (replace-match "foobar" nil nil)) which will run faster and probably do exactly what you want. Please see the documentation of `replace-match' to find out how to simulate `case-replace'. This function returns nil if and only if there were no matches to make, or the user didn't cancel the call. REPLACEMENTS is either a string, a list of strings, or a cons cell containing a function and its first argument. The function is called to generate each replacement like this: (funcall (car replacements) (cdr replacements) replace-count) It must return a string. Non-nil REGION-NONCONTIGUOUS-P means that the region is composed of noncontiguous pieces. The most common example of this is a rectangular region, where the pieces are separated by newline characters. (fn FROM-STRING REPLACEMENTS QUERY-FLAG REGEXP-FLAG DELIMITED-FLAG &optional REPEAT-COUNT MAP START END BACKWARD REGION-NONCONTIGUOUS-P) (defalias 'perform-replace #[2821 "\204\262\203 \203\306\307\310 !!\210\n\203( \203(\311  \"\202)\n\f\205/\n??\206:\312=\f\313\211\211\314\313\211\211\211\211\314\315\211\315\211\313\211\211@\313AA\313C\314\205\224\316\317\320\203i\321\202j\322\203\2009\203|\323N\206\201\324\202\201\322!\203\212\325\202\213\322\326\327\330!\260B#\203\270\331\332C\333!\"\240\210\334\335\336\337B\340\341\342\343\344\n!\345\"\346\347%\313$\210\203\330\203\360\350^!\262]b\210\351 \210\202\360\203\360\350]!\262^b\210\351 \210\352\344D!\"\353=\203\313\262\314\262;\203\262\313\262 \202.@;\203.\204\"\354\262\355\344\211#\211$B\262 E\2036\313F\356 \210\357 \210\360\216\2035\203Wo\206S\205S`X?\202cm\206b\205b`Y?\2035:\203\203\203u@\202xA@b\210\361\314#\202\365\203\237\362  \n&\205\365\361\314\"\202\365\203\253`SeV\202\257`TdW\205\365\203\311\203\302`SV\202\306`TW\205\365`\203\323\363\202\324\354u\210\362!!\n&\203\357\361\314\"\202\363\211b\210\313\262\211\262\2035@A@U?\262\2053?\2063\203\364\313\"\202!\365!\2053\366 \211@A@U?\2051\211\262\262G\203P\367@A@\370\313$\203PT\262 \202>A@A@\"\204eT\262\202>H\314=\204\212\204vH\204\212\371@A@\"\203\212T\262\202>\203\236\372!\210@ A \"\262\204\334\204\305\204\305\373@A@##\n & \210\374&\262 T\202>\357 \210\313\211\211\211\204\372!\210\375\376!\210\373\315\224\315\225  ''\n$& \210\203%!\203%\313\262\212@b\210\365!\210\366\314\")\262\377@A@\"\262\201W\366 \340\315\201X\343\344!\201Y\"\201Z$\216\372!\210\201[#)\262!\262\313I\203\213\366 \340\315\201X\343\344!\201\\\"\201Z$\216\372!\210\201[#)\262\202\215J\201]\201W)!\201W!#\210)\266\201^ \262\372!\210\344!\262\352\"\262\211\201_\267\202\250\201`KLr\201a\201b!q\210p\201c \210L\313\211MN\314\211O\314PQ\201d \210\375\201e!\210+\211R\201f\320\203 \321\202\n\322%\203 %9\203%\323N\206!\324\202!\322'\203*\325\202+\322+\201g\201h\327S!\260 !\210rRq\210\201i \210)\201j!\210)\266)\202\347\313\262\314\262\202\347\314\262 \313\262\314\262\202\347\203\217\211A\262\242\211@b\210\211A@\262\361\314\201k8#\262\210\202\347\201]\201l!\210\201m\201n!\210\201o\354!\210\202\347\211\201p=\204\270\211\201q=\203(\204\326\201]\201r!\210\201m\201n!\210\201o\354!\210\202\347\315G\315\314\313\211W\203\353\203\353\203\363\203\3538T\262\211A@\262\n \203\f\201s\202\201Z8\262 \203\201Z\202!\201s8\262\262\262\313\262U\203\\ \204\\\204\\\315U\203\\\201]\201r!\210\201m\201n!\210\201o\354!\210 \203\347\233\262\211@b\210\372\201k8!\210\212\315\224b\210\365\201t!!\210\366\314\201k8\")\262\374\"\"(&\262 S\212\315\224b\210(\203\257\365!\210\202\267\365\201t!!\210\366\314\201k8\")\262(\203\316\201s8\262\201q=\203\347\313\262\nZ\262\315\262T\262\210\202\336\201q=\203\315U\204\201]\201u\201v\201w#\"\210\201m\201n!\210\201o\354!\210\266\313\262\314\262\313\262\202\347\211\201x\267\202\277\204H\374!&\262 T\314\262\314\262?\262\202\347\204n\374!&\262 T\313\262\314\262\314\262\202\347\204\347\374!&\262 T\361\314\"\262\314\262\314\262`\211\203\256\315\224\315\225pE\202\261\366\314!\257B\262\202\347\211\201y=\204\315\211\353=\203\372\204\345\374!&\262 T\314\262\313\262#\314\262\211\353=\203\347\314\262 \202\347\211\201z\267\202\317\314\262?\262\202\347\201{\211TU\201{ \210*\202\347\201| \361\313\211#\262\315\224b\210\212\201} \340\315\201~\343\344!\201\"\201k$\216\201\200 \210)\210)\211b\210\211\313\211\223\266!\203\347 \203\347\365!\205i\366 \262\202\347\361\313\211#\262\201\201\201\202\"\262\313\262\203\220\372!\210\202\250\374!&\262\314\262\262\314\262\202\347\201\203\322\314\211#\210\361\313\"\262\201\204 \210\212\201\200 \210)\314\262\202\347\201\205U\313\262\201\206\201\207!V\"V\314\262E\203\367\211\201\210>\204\367\313F\211\201\211=\204\343\313@\202\343 \203'`\211\203\315\224\315\225pE\202\366\314!\257B\262\313\262\313\262\313\262\266\202>)V\204\246\201]\201u\201\212\201\213 # \201\214\f\f\f#\315V\203\243\201\215\201\216\201\217\201\220\201\221\313\315V\205y\201\215\201\222\"\315V\205\211\201\215\201\223\"\315V\205\231\201\215\201\224\"E\"\201\225#\"\202\244\322#\210\203\260\206\261,\207" [query-replace-map minibuffer-auto-raise case-fold-search search-upper-case case-replace replace-count raise-frame window-frame minibuffer-window isearch-no-upper-case-p literal nil t 0 apply propertize "Query replacing " "backward " "" isearch-message-prefix "word " "regexp " "%s with %s: " substitute-command-keys "(\\\\[help] for help) " mapcar #[257 "\300@!\300A!B\207" [copy-marker] 4 "\n\n(fn POSITION)"] bounds advice--add-function :after-while #[0 "\300\301!\207" [default-value isearch-filter-predicate] 2] #[257 "\300\301\"\207" [set-default isearch-filter-predicate] 4 "\n\n(fn GV--VAL)"] make-byte-code 514 "\301\302\303\304\305\306\307\310  \"\311\"\312\313%\300\242\"\"\207" vconcat vector [delq nil mapcar make-byte-code 257 "\300@Y\205\300AX\205\301@Y\205\301AX\207" vconcat vector [] 3 "\n\n(fn BOUNDS)"] 12 "\n\n(fn START END)" copy-marker deactivate-mark lookup-key automatic-all 1 replace-loop-through-replacements push-mark undo-boundary #[0 "\300 \207" [replace-dehighlight] 1] replace-match-data replace-search -1 looking-back looking-at match-data text-property-not-all read-only isearch-range-invisible set-match-data replace-highlight replace-match-maybe-edit run-hooks replace-update-post-hook buffer-substring-no-properties recenter-last-op isearch-filter-predicate minibuffer-prompt-properties region-extract-function last-input-event query-replace-lazy-highlight isearch-lazy-highlight-last-string query-replace-skip-read-only search-invisible query-replace-show-replacement message-log-max display-buffer-overriding-action default-directory buffer-read-only buffer-file-name buffer-undo-list inhibit-modification-hooks inhibit-read-only standard-output query-replace-help last-command this-command unread-command-events query-replace-descr "\301\300\302\"\207" [set-match-data evaporate] 3 match-substitute-replacement [set-match-data evaporate] message read-event #s(hash-table size 4 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (help 964 exit 1109 exit-current 1118 backup 1130)) (nil (inhibit-same-window . t)) get-buffer-create "*Help*" kill-all-local-variables erase-buffer temp-buffer-setup-hook princ " with " ".\n\n" help-mode internal-temp-output-buffer-show 2 "No previous match" ding no-terminate sit-for undo undo-all "Nothing to undo" 4 regexp-quote ngettext "Undid %d replacement" "Undid %d replacements" #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (act 1584 act-and-exit 1622 act-and-show 1658)) automatic #s(hash-table size 5 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (skip 1794 recenter 1805 edit 1822 edit-replacement 1902 delete-and-edit 1966)) recenter-top-bottom point-marker current-window-configuration "\301\300!\207" [set-window-configuration] recursive-edit read-string "Edit replacement string: " replace-match replace-dehighlight mode-exited append listify-key-sequence (skip backup) recenter "Replaced %d occurrence%s" "Replaced %d occurrences%s" + format " (skipped %s)" mapconcat identity delq "%s read-only" "%s invisible" "%s filtered out" ", "] 52 (#$ . 77463)]) (provide 'replace)