Before using any of these functions to do a character search, look at character attributes (page 9). They provide a facility similar to the syntax table in real EMACS. Syntax tables are a powerful, general, and efficient mechanism for assigning meanings to characters in various modes. [annotate]
An exclusive upper limit for the char-code of characters given to the searching functions. The result of searches for characters with a char-code greater than or equal to this limit is ill-defined, but it is not an error to do such searches. [annotate] |
Returns a search-pattern object which can be given to the find-pattern and replace-pattern functions. A search-pattern is a specification of a particular sort of search to do. direction is either :forward or :backward, indicating the direction to search in. kind specifies the kind of search pattern to make, and pattern is a thing which specifies what to search for. [annotate] The interpretation of pattern depends on the kind of pattern being made. Currently defined kinds of search pattern are: [annotate]
result-search-pattern, if supplied, is a search-pattern to destructively modify to produce the new pattern. Where reasonable this should be supplied, since some kinds of search patterns may involve large data structures. [annotate] |
Returns t if search-pattern is a search-pattern object, otherwise nil. [annotate] |
| get-search-pattern | string direction | [Function] |
| last-search-pattern | [Variable] |
| last-search-string | [Variable] |
get-search-pattern interfaces to a default search string and pattern that search and replacing commands can use. These commands then share a default when prompting for what to search or replace, and save on consing a search pattern each time they execute. This uses Default Search Kind (see the Hemlock User's Manual) when updating the pattern object. This returns the pattern, so you probably don't need to refer to last-search-pattern, but last-search-string is useful when prompting. [annotate] |
Find the next match of search-pattern starting at mark. If a match is found then mark is altered to point before the matched text and the number of characters matched is returned. If no match is found then nil is returned and mark is not modified. [annotate] |
Replace n matches of search-pattern with the string replacement starting at mark. If n is nil then replace all matches. A mark pointing before the last replacement done is returned. [annotate] |