blob: c5a631e99173766486be38065aacb2f8556a799c [file] [log] [blame]
<!DOCTYPE html>
<html>
<!-- Created by Texinfo 6.8dev+dev, http://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.8dev, 23 February 2022),
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-2022 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.8dev)</title>
<meta name="description" content="Using occur (GNU Texinfo 6.8dev)">
<meta name="keywords" content="Using occur (GNU Texinfo 6.8dev)">
<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">
<!--
div.example {margin-left: 3.2em}
kbd.kbd {font-style: oblique}
-->
</style>
</head>
<body lang="en">
<div class="subsection-level-extent" id="Using-occur">
<div class="nav-panel">
<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 class="code">texinfo-show-structure</code></a>, Up: <a href="Catching-Mistakes.html" accesskey="u" rel="up">Catching Mistakes</a> &nbsp; [<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>
<h4 class="subsection section-level-set-subsection" id="Using-occur-1">D.9.5 Using <code class="code">occur</code></h4>
<a class="index-entry-id" id="index-Occurrences_002c-listing-with-_0040occur"></a>
<a class="index-entry-id" id="index-occur"></a>
<p>Sometimes the <code class="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 class="code">texinfo-show-structure</code>. In this case, you can use the <code class="code">occur</code>
command directly. To do this, type:
</p>
<div class="example">
<pre class="example-preformatted"><kbd class="kbd">M-x occur</kbd>
</pre></div>
<p>and then, when prompted, type a <em class="dfn">regexp</em>, a regular expression for
the pattern you want to match. (See <a data-manual="emacs" href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html#Regexps">Regular Expressions</a> in <cite class="cite">The GNU Emacs Manual</cite>.) The <code class="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 class="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
&lsquo;<samp class="samp">@chapter</samp>&rsquo; in them, just type &lsquo;<samp class="samp">@chapter</samp>&rsquo;. This will
produce a list of the chapters. It will also list all the sentences
with &lsquo;<samp class="samp">@chapter</samp>&rsquo; in the middle of the line.
</p>
<p>If you want to see only those lines that start with the word
&lsquo;<samp class="samp">@chapter</samp>&rsquo;, type &lsquo;<samp class="samp">^@chapter</samp>&rsquo; when prompted by
<code class="code">occur</code>. If you want to see all the lines that end with a word
or phrase, end the last word with a &lsquo;<samp class="samp">$</samp>&rsquo;; for example,
&lsquo;<samp class="samp">catching mistakes$</samp>&rsquo;. 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 &lsquo;Up&rsquo; pointer.
</p>
<p>See <a data-manual="emacs" href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Other-Repeating-Search.html#Other-Repeating-Search">Using Occur</a> in <cite class="cite">The GNU Emacs Manual</cite>,
for more information.
</p>
</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Running-Info_002dvalidate.html">Finding Badly Referenced Nodes</a>, Previous: <a href="Using-texinfo_002dshow_002dstructure.html">Using <code class="code">texinfo-show-structure</code></a>, Up: <a href="Catching-Mistakes.html">Catching Mistakes</a> &nbsp; [<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>
</body>
</html>