comparison en/99defs.tex @ 37:9fd0c59b009a

Add to hook chapter. Document each macro in 99defs.tex.
author Bryan O'Sullivan <bos@serpentine.com>
date Mon, 17 Jul 2006 00:01:01 -0700
parents e68f4a96c16e
children b49a7dd4e564
comparison
equal deleted inserted replaced
36:5cee64874312 37:9fd0c59b009a
1 % Bug ID.
1 \newcommand{\bug}[1]{\index{Mercurial issue!no.~#1}\href{http://www.selenic.com/mercurial/bts/issue#1}{Mercurial issue no.~#1}} 2 \newcommand{\bug}[1]{\index{Mercurial issue!no.~#1}\href{http://www.selenic.com/mercurial/bts/issue#1}{Mercurial issue no.~#1}}
3
4 % File name in the user's home directory.
2 \newcommand{\tildefile}[1]{\texttt{\~{}/#1}} 5 \newcommand{\tildefile}[1]{\texttt{\~{}/#1}}
6
7 % File name.
3 \newcommand{\filename}[1]{\texttt{#1}} 8 \newcommand{\filename}[1]{\texttt{#1}}
9
10 % Directory name.
4 \newcommand{\dirname}[1]{\texttt{#1}} 11 \newcommand{\dirname}[1]{\texttt{#1}}
12
13 % File name, with index entry.
14 % The ``s'' prefix comes from ``special''.
5 \newcommand{\sfilename}[1]{\index{\texttt{#1} file}\texttt{#1}} 15 \newcommand{\sfilename}[1]{\index{\texttt{#1} file}\texttt{#1}}
16
17 % Directory name, with index entry.
6 \newcommand{\sdirname}[1]{\index{\texttt{#1} directory}\texttt{#1}} 18 \newcommand{\sdirname}[1]{\index{\texttt{#1} directory}\texttt{#1}}
19
20 % Mercurial extension.
7 \newcommand{\hgext}[1]{\index{\texttt{#1} extension}\texttt{#1}} 21 \newcommand{\hgext}[1]{\index{\texttt{#1} extension}\texttt{#1}}
22
23 % Mercurial command.
8 \newcommand{\hgcmd}[1]{\index{\texttt{#1} command}``\texttt{hg #1}''} 24 \newcommand{\hgcmd}[1]{\index{\texttt{#1} command}``\texttt{hg #1}''}
25
26 % Mercurial command, with arguments.
27 \newcommand{\hgcmdargs}[2]{\index{\texttt{#1} command}``\texttt{hg #1 #2}''}
28
29 % Shell/system command.
9 \newcommand{\command}[1]{\index{\texttt{#1} command}\texttt{#1}} 30 \newcommand{\command}[1]{\index{\texttt{#1} command}\texttt{#1}}
31
32 % Shell/system command, with arguments.
10 \newcommand{\cmdargs}[2]{\index{\texttt{#1} command}``\texttt{#1 #2}''} 33 \newcommand{\cmdargs}[2]{\index{\texttt{#1} command}``\texttt{#1 #2}''}
11 \newcommand{\hgcmdargs}[2]{\index{\texttt{#1} command}``\texttt{hg #1 #2}''} 34
35 % Mercurial command option.
12 \newcommand{\hgopt}[2]{\index{\texttt{#1} command!\texttt{#2} option}\texttt{#2}} 36 \newcommand{\hgopt}[2]{\index{\texttt{#1} command!\texttt{#2} option}\texttt{#2}}
37
38 % Mercurial global option.
39 \newcommand{\hggopt}[1]{\index{global options!\texttt{#1} option}\texttt{#1}}
40
41 % Shell/system command option.
13 \newcommand{\cmdopt}[2]{\index{\texttt{#1} command!\texttt{#2} option}\texttt{#2}} 42 \newcommand{\cmdopt}[2]{\index{\texttt{#1} command!\texttt{#2} option}\texttt{#2}}
43
44 % Command option.
14 \newcommand{\option}[1]{\texttt{#1}} 45 \newcommand{\option}[1]{\texttt{#1}}
46
47 % Software package.
15 \newcommand{\package}[1]{\index{\texttt{#1} package}\texttt{#1}} 48 \newcommand{\package}[1]{\index{\texttt{#1} package}\texttt{#1}}
49
50 % Section name from a hgrc file.
16 \newcommand{\rcsection}[1]{\index{\texttt{hgrc} file!\texttt{#1} section}\texttt{[#1]}} 51 \newcommand{\rcsection}[1]{\index{\texttt{hgrc} file!\texttt{#1} section}\texttt{[#1]}}
52
53 % Named item in a hgrc file section.
17 \newcommand{\rcitem}[2]{\index{\texttt{hgrc} file!\texttt{#1} 54 \newcommand{\rcitem}[2]{\index{\texttt{hgrc} file!\texttt{#1}
18 section!\texttt{#2} entry}\texttt{#1.#2}} 55 section!\texttt{#2} entry}\texttt{#1.#2}}
56
57 % hgrc file.
19 \newcommand{\hgrc}{\index{\texttt{hgrc} file}\texttt{hgrc}} 58 \newcommand{\hgrc}{\index{\texttt{hgrc} file}\texttt{hgrc}}
59
60 % Hook name.
20 \newcommand{\hook}[1]{\index{\texttt{#1} hook}\index{hooks!\texttt{#1}}\texttt{#1}} 61 \newcommand{\hook}[1]{\index{\texttt{#1} hook}\index{hooks!\texttt{#1}}\texttt{#1}}
62
63 % Environment variable.
21 \newcommand{\envar}[1]{\index{\texttt{#1} environment 64 \newcommand{\envar}[1]{\index{\texttt{#1} environment
22 variable}\index{environment variables!\texttt{#1}}\texttt{#1}} 65 variable}\index{environment variables!\texttt{#1}}\texttt{#1}}
23 66
67 % Python module.
68 \newcommand{\pymod}[1]{\index{\texttt{#1} module}\texttt{#1}}
69
70 % Python class in a module.
71 \newcommand{\pymodclass}[2]{\index{\texttt{#1} module!\texttt{#2}
72 class}\texttt{#1.#2}}
73
74 % Note: blah blah.
24 \newsavebox{\notebox} 75 \newsavebox{\notebox}
25 \newenvironment{note}% 76 \newenvironment{note}%
26 {\begin{lrbox}{\notebox}\begin{minipage}{0.7\textwidth}\textbf{Note:}\space}% 77 {\begin{lrbox}{\notebox}\begin{minipage}{0.7\textwidth}\textbf{Note:}\space}%
27 {\end{minipage}\end{lrbox}\fbox{\usebox{\notebox}}} 78 {\end{minipage}\end{lrbox}\fbox{\usebox{\notebox}}}
28 79
80 % Code sample, eating 4 characters of leading space.
29 \DefineVerbatimEnvironment{codesample4}{Verbatim}{frame=single,gobble=4,numbers=left,commandchars=\\\{\}} 81 \DefineVerbatimEnvironment{codesample4}{Verbatim}{frame=single,gobble=4,numbers=left,commandchars=\\\{\}}
82
83 % Code sample, eating 2 characters of leading space.
84 \DefineVerbatimEnvironment{codesample2}{Verbatim}{frame=single,gobble=2,numbers=left,commandchars=\\\{\}}
85
86 % Interaction from the examples directory.
30 \newcommand{\interaction}[1]{\VerbatimInput[frame=single,numbers=left,commandchars=\\\{\}]{examples/#1.out}} 87 \newcommand{\interaction}[1]{\VerbatimInput[frame=single,numbers=left,commandchars=\\\{\}]{examples/#1.out}}
31 88
89 % Graphics inclusion.
32 \ifpdf 90 \ifpdf
33 \newcommand{\grafix}[1]{\includegraphics{#1}} 91 \newcommand{\grafix}[1]{\includegraphics{#1}}
34 \else 92 \else
35 \newcommand{\grafix}[1]{\includegraphics{#1.png}} 93 \newcommand{\grafix}[1]{\includegraphics{#1.png}}
36 \fi 94 \fi