This file is indexed.

/usr/share/doc/monotone/html/Lua-Reference.html is in monotone-doc 1.1-7.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.0, http://www.gnu.org/software/texinfo/ -->
<head>
<title>monotone documentation: Lua Reference</title>

<meta name="description" content="monotone documentation: Lua Reference">
<meta name="keywords" content="monotone documentation: Lua Reference">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="General-Index.html#General-Index" rel="index" title="General Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index.html#Top" rel="up" title="Top">
<link href="Hooks.html#Hooks" rel="next" title="Hooks">
<link href="Formats.html#Formats" rel="prev" title="Formats">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {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}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space: nowrap}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: serif; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="texinfo.css">


</head>

<body lang="en">
<a name="Lua-Reference"></a>
<div class="header">
<p>
Next: <a href="Special-Topics.html#Special-Topics" accesskey="n" rel="next">Special Topics</a>, Previous: <a href="Formats.html#Formats" accesskey="p" rel="prev">Formats</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="General-Index.html#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Lua-Reference-1"></a>
<h2 class="chapter">6 Lua Reference</h2>

<p>Monotone makes use of the <a href="http://www.lua.org">Lua</a> programming
language to customize and extend its behaviour.  By writing
<em>functions</em> which are loaded and evaluated at runtime, you can
help monotone to make a particular decision, set a suitable default or
preference or perform a certain action.
</p>
<a name="rcfiles"></a><p>Lua functions are defined in &ldquo;rcfiles&rdquo; which will be
read every time monotone runs. <samp>rcfiles</samp> consist of:
</p>
<ul>
<li> <samp>$HOME/.monotone/monotonerc</samp> on Unix or
<samp>%APPDATA%\monotone\monotonerc</samp> on Windows

</li><li> <samp>_MTN/monotonerc</samp> in the current workspace

</li><li> Files given in the <samp>--rcfile=<var>file</var></samp> option on the command line.

</li><li> All files in a directory given by <samp>--rcfile=<var>directory</var></samp> on
the command line.
</li></ul>

<p>The files are loaded in the order <samp>.monotone/monotonerc</samp>,
<samp>_MTN/monotonerc</samp>, <samp>--rcfile</samp> in the command line order.
Definitions loaded later shadow (override) earlier definitions.
</p>
<p>There are two uses for Lua functions; hooks and user-defined
commands. This section documents hooks; see
<code><a href="Additional-Lua-Functions.html#register_005fcommand">register_command</a></code> for user-defined commands. The source
distribution contains some example user commands in the
<samp>contrib/command</samp> directory.
</p>
<p>Hooks are Lua functions that are called from monotone code in many
places. Monotone provides default definitions for some hooks; see
<a href="Default-hooks.html#Default-hooks">Default hooks</a> for their complete source. For other hooks, if no
definition is provided, a default return value is used. When writing new
hooks, it may be helpful to reuse some code from the default
ones. Since Lua is a lexically scoped language with closures, this can
be achieved with the following code:
</p>
<div class="smallexample">
<pre class="smallexample">do
    local old_hook = default_hook
    function default_hook(arg)
        if not old_hook(arg) then
            -- do other stuff
        end
    end
end
</pre></div>

<p>Now the default hook is trapped in a variable local to this block, and can
only be seen by the new hook. Since in Lua functions default to the global
scope, the new hook is seen from inside monotone.
</p>
<p>Monotone also provides a number of helper functions to hook writers
exposing functionality not available with standard Lua.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="Hooks.html#Hooks" accesskey="1">Hooks</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">All hooks called by monotone.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Additional-Lua-Functions.html#Additional-Lua-Functions" accesskey="2">Additional Lua Functions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Extra functionality available to hook writers.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Implementation-Differences.html#Implementation-Differences" accesskey="3">Implementation Differences</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Functional differences from standard Lua
</td></tr>
</table>

<hr>
<div class="header">
<p>
Next: <a href="Special-Topics.html#Special-Topics" accesskey="n" rel="next">Special Topics</a>, Previous: <a href="Formats.html#Formats" accesskey="p" rel="prev">Formats</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="General-Index.html#General-Index" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>