occur(3)n occur "search-string"
occur performs a search for a string in the current buffer; generating a list of every occurrence found. If the search-string has not been given via the command-line and the buffer has an active region when the command is called, the content of the region will be used as the search string, otherwise the string will be prompted for.
The buffer's magic(2m) mode setting is used to determine whether the search-string is a the regular expression or not, except with the current region is used.
The results are presented in the *item-list* window, the user may interact with the *item-list* buffer using the mouse or <RETURN>, on selecting a line then the user is moved to the corresponding line in the original buffer.
If an argument n is given then the width of the match sample string is limited to 15 or 28 chars, with a value of 1 or 2, on each side of the match making the output narrower; this can be used to allow the buffer to be placed in a side window such as a toolbar.
The *item-list* window may be closed with the command item-list-close(3) typically bound to esc-F7.
occur is a macro defined in itemlist.emf.
(c) Copyright JASSPA 2025
Last Modified: 2024/10/06
Generated On: 2025/09/29