All Manuals > LispWorks Editor User Guide > 3 Command Reference > 3.21 Searching and replacing

NextPrevUpTopContentsIndex

3.21.3 Replacement

Replace String

Editor Command

Arguments: target replacement
Key sequence: None

editor:replace-string-command p &optional target replacement

Replaces all occurrences of target string by replacement string, starting from the current point.

Whenever replacement is substituted for target , case may be preserved, depending on the value of the editor variable case-replace.

Query Replace

Editor Command

Arguments: target replacement
Key sequence: Meta+Shift+% target replacement

editor:query-replace-command p &optional target replacement

Replaces occurrences of target string by replacement string, starting from the current point, but only after querying the user. Each time target is found, an action must be indicated from the keyboard.

Whenever replacement is substituted for target , case may be preserved, depending on the value of the editor variable case-replace.

The following key sequences are used to control Query Replace :

Space or y

Replace target by replacement and move to the next occurrence of target .

Delete

Skip target without replacing it and move to the next occurrence of target .

.

Replace target by replacement and then exit.

!

Replace all subsequent occurrences of target by replacement without prompting.

Ctrl+R

Enter recursive edit. This allows the current occurrence of target to be edited. When this editing is completed, Exit Recursive Edit should be invoked. The next instance of target is then found.

Esc

Quit from Query Replace with no further replacements.

Directory Query Replace

Editor Command

Arguments: directory target replacement
Key sequence: None

Replaces occurrences of target string by replacement string for each file with the suffix .lisp or .lsp in directory , but only after querying the user. The current working directory is offered as a default for directory . A non-nil prefix argument causes all files to be searched, except for those ending with one of the strings in the list system:*ignorable-file-suffices *. Each time target is found, an action must be indicated from the keyboard. For details of possible actions see Query Replace.

System Query Replace

Editor Command

Arguments: system target replacement
Key sequence: None

Replaces occurrences of target string by replacement string, for each file in system , but only after querying the user. Each time target is found, an action must be indicated from the keyboard. For details of possible actions see Query Replace.

case-replace

Editor Variable

Default value: t

If the value of this variable is t , Replace String and Query Replace try to preserve case when doing replacements. If its value is nil , the case of the replacement string is as defined by the user.

Replace Regexp

Editor Command

Arguments: target replacement
Key sequence: None

editor:replace-regexp-command p &optional target replacement

Replaces all matches of target regular expression by replacement string, starting from the current point.

See Regular expression searching for a description of regular expressions.

Query Replace Regexp

Editor Command

Arguments: target replacement
Key sequence: None

editor:query-replace-regexp-command p &optional target replacement

Replaces matches of target regular expression by replacement string, starting from the current point, but only after querying the user. Each time target is matched, an action must be indicated from the keyboard.

See Regular expression searching for a description of regular expressions, and Query Replace for the keyboard gestures available.


LispWorks Editor User Guide (Macintosh version) - 3 May 2011

NextPrevUpTopContentsIndex