JezK
Edit File: Using-occur.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!-- This manual is for GNU Texinfo (version 6.8, 8 June 2021), a documentation system that can produce both online information and a printed manual from a single source using semantic markup. Copyright (C) 1988, 1990-1993, 1995-1999, 2001-2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". --> <title>Using occur (GNU Texinfo 6.8)</title> <meta name="description" content="Using occur (GNU Texinfo 6.8)"> <meta name="keywords" content="Using occur (GNU Texinfo 6.8)"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="texi2any"> <meta name="viewport" content="width=device-width,initial-scale=1"> <link href="index.html" rel="start" title="Top"> <link href="Command-and-Variable-Index.html" rel="index" title="Command and Variable Index"> <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> <link href="Catching-Mistakes.html" rel="up" title="Catching Mistakes"> <link href="Running-Info_002dvalidate.html" rel="next" title="Running Info-validate"> <link href="Using-texinfo_002dshow_002dstructure.html" rel="prev" title="Using texinfo-show-structure"> <style type="text/css"> <!-- a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em} a.summary-letter {text-decoration: none} blockquote.indentedblock {margin-right: 0em} div.display {margin-left: 3.2em} div.example {margin-left: 3.2em} kbd {font-style: oblique} pre.display {font-family: inherit} pre.format {font-family: inherit} pre.menu-comment {font-family: serif} pre.menu-preformatted {font-family: serif} span.nolinebreak {white-space: nowrap} span.roman {font-family: initial; font-weight: normal} span.sansserif {font-family: sans-serif; font-weight: normal} span:hover a.copiable-anchor {visibility: visible} ul.no-bullet {list-style: none} --> </style> </head> <body lang="en"> <div class="section" id="Using-occur"> <div class="header"> <p> Next: <a href="Running-Info_002dvalidate.html" accesskey="n" rel="next">Finding Badly Referenced Nodes</a>, Previous: <a href="Using-texinfo_002dshow_002dstructure.html" accesskey="p" rel="prev">Using <code>texinfo-show-structure</code></a>, Up: <a href="Catching-Mistakes.html" accesskey="u" rel="up">Catching Mistakes</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p> </div> <hr> <span id="Using-occur-1"></span><h4 class="subsection">D.9.5 Using <code>occur</code></h4> <span id="index-Occurrences_002c-listing-with-_0040occur"></span> <span id="index-occur"></span> <p>Sometimes the <code>texinfo-show-structure</code> command produces too much information. Perhaps you want to remind yourself of the overall structure of a Texinfo file, and are overwhelmed by the detailed list produced by <code>texinfo-show-structure</code>. In this case, you can use the <code>occur</code> command directly. To do this, type: </p> <div class="example"> <pre class="example"><kbd>M-x occur</kbd> </pre></div> <p>and then, when prompted, type a <em>regexp</em>, a regular expression for the pattern you want to match. (See <a data-manual="emacs" href="../emacs/Regexps.html#Regexps">Regular Expressions</a> in <cite>The GNU Emacs Manual</cite>.) The <code>occur</code> command works from the current location of the cursor in the buffer to the end of the buffer. If you want to run <code>occur</code> on the whole buffer, place the cursor at the beginning of the buffer. </p> <p>For example, to see all the lines that contain the word ‘<samp>@chapter</samp>’ in them, just type ‘<samp>@chapter</samp>’. This will produce a list of the chapters. It will also list all the sentences with ‘<samp>@chapter</samp>’ in the middle of the line. </p> <p>If you want to see only those lines that start with the word ‘<samp>@chapter</samp>’, type ‘<samp>^@chapter</samp>’ when prompted by <code>occur</code>. If you want to see all the lines that end with a word or phrase, end the last word with a ‘<samp>$</samp>’; for example, ‘<samp>catching mistakes$</samp>’. This can be helpful when you want to see all the nodes that are part of the same chapter or section and therefore have the same ‘Up’ pointer. </p> <p>See <a data-manual="emacs" href="../emacs/Other-Repeating-Search.html#Other-Repeating-Search">Using Occur</a> in <cite>The GNU Emacs Manual</cite>, for more information. </p> </div> </body> </html>