hgbook

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

Add to hook chapter.
Document each macro in 99defs.tex.
author Bryan O'Sullivan <bos@serpentine.com>
date Mon Jul 17 00:01:01 2006 -0700 (2006-07-17)
parents e68f4a96c16e
children b49a7dd4e564
line diff
     1.1 --- a/en/99defs.tex	Sun Jul 16 23:29:29 2006 -0400
     1.2 +++ b/en/99defs.tex	Mon Jul 17 00:01:01 2006 -0700
     1.3 @@ -1,34 +1,92 @@
     1.4 +% Bug ID.
     1.5  \newcommand{\bug}[1]{\index{Mercurial issue!no.~#1}\href{http://www.selenic.com/mercurial/bts/issue#1}{Mercurial issue no.~#1}}
     1.6 +
     1.7 +% File name in the user's home directory.
     1.8  \newcommand{\tildefile}[1]{\texttt{\~{}/#1}}
     1.9 +
    1.10 +% File name.
    1.11  \newcommand{\filename}[1]{\texttt{#1}}
    1.12 +
    1.13 +% Directory name.
    1.14  \newcommand{\dirname}[1]{\texttt{#1}}
    1.15 +
    1.16 +% File name, with index entry.
    1.17 +% The ``s'' prefix comes from ``special''.
    1.18  \newcommand{\sfilename}[1]{\index{\texttt{#1} file}\texttt{#1}}
    1.19 +
    1.20 +% Directory name, with index entry.
    1.21  \newcommand{\sdirname}[1]{\index{\texttt{#1} directory}\texttt{#1}}
    1.22 +
    1.23 +% Mercurial extension.
    1.24  \newcommand{\hgext}[1]{\index{\texttt{#1} extension}\texttt{#1}}
    1.25 +
    1.26 +% Mercurial command.
    1.27  \newcommand{\hgcmd}[1]{\index{\texttt{#1} command}``\texttt{hg #1}''}
    1.28 +
    1.29 +% Mercurial command, with arguments.
    1.30 +\newcommand{\hgcmdargs}[2]{\index{\texttt{#1} command}``\texttt{hg #1 #2}''}
    1.31 +
    1.32 +% Shell/system command.
    1.33  \newcommand{\command}[1]{\index{\texttt{#1} command}\texttt{#1}}
    1.34 +
    1.35 +% Shell/system command, with arguments.
    1.36  \newcommand{\cmdargs}[2]{\index{\texttt{#1} command}``\texttt{#1 #2}''}
    1.37 -\newcommand{\hgcmdargs}[2]{\index{\texttt{#1} command}``\texttt{hg #1 #2}''}
    1.38 +
    1.39 +% Mercurial command option.
    1.40  \newcommand{\hgopt}[2]{\index{\texttt{#1} command!\texttt{#2} option}\texttt{#2}}
    1.41 +
    1.42 +% Mercurial global option.
    1.43 +\newcommand{\hggopt}[1]{\index{global options!\texttt{#1} option}\texttt{#1}}
    1.44 +
    1.45 +% Shell/system command option.
    1.46  \newcommand{\cmdopt}[2]{\index{\texttt{#1} command!\texttt{#2} option}\texttt{#2}}
    1.47 +
    1.48 +% Command option.
    1.49  \newcommand{\option}[1]{\texttt{#1}}
    1.50 +
    1.51 +% Software package.
    1.52  \newcommand{\package}[1]{\index{\texttt{#1} package}\texttt{#1}}
    1.53 +
    1.54 +% Section name from a hgrc file.
    1.55  \newcommand{\rcsection}[1]{\index{\texttt{hgrc} file!\texttt{#1} section}\texttt{[#1]}}
    1.56 +
    1.57 +% Named item in a hgrc file section.
    1.58  \newcommand{\rcitem}[2]{\index{\texttt{hgrc} file!\texttt{#1}
    1.59      section!\texttt{#2} entry}\texttt{#1.#2}}
    1.60 +
    1.61 +% hgrc file.
    1.62  \newcommand{\hgrc}{\index{\texttt{hgrc} file}\texttt{hgrc}}
    1.63 +
    1.64 +% Hook name.
    1.65  \newcommand{\hook}[1]{\index{\texttt{#1} hook}\index{hooks!\texttt{#1}}\texttt{#1}}
    1.66 +
    1.67 +% Environment variable.
    1.68  \newcommand{\envar}[1]{\index{\texttt{#1} environment
    1.69      variable}\index{environment variables!\texttt{#1}}\texttt{#1}}
    1.70  
    1.71 +% Python module.
    1.72 +\newcommand{\pymod}[1]{\index{\texttt{#1} module}\texttt{#1}}
    1.73 +
    1.74 +% Python class in a module.
    1.75 +\newcommand{\pymodclass}[2]{\index{\texttt{#1} module!\texttt{#2}
    1.76 +    class}\texttt{#1.#2}}
    1.77 +
    1.78 +% Note: blah blah.
    1.79  \newsavebox{\notebox}
    1.80  \newenvironment{note}%
    1.81    {\begin{lrbox}{\notebox}\begin{minipage}{0.7\textwidth}\textbf{Note:}\space}%
    1.82    {\end{minipage}\end{lrbox}\fbox{\usebox{\notebox}}}
    1.83  
    1.84 +% Code sample, eating 4 characters of leading space.
    1.85  \DefineVerbatimEnvironment{codesample4}{Verbatim}{frame=single,gobble=4,numbers=left,commandchars=\\\{\}}
    1.86 +
    1.87 +% Code sample, eating 2 characters of leading space.
    1.88 +\DefineVerbatimEnvironment{codesample2}{Verbatim}{frame=single,gobble=2,numbers=left,commandchars=\\\{\}}
    1.89 +
    1.90 +% Interaction from the examples directory.
    1.91  \newcommand{\interaction}[1]{\VerbatimInput[frame=single,numbers=left,commandchars=\\\{\}]{examples/#1.out}}
    1.92  
    1.93 +% Graphics inclusion.
    1.94  \ifpdf
    1.95    \newcommand{\grafix}[1]{\includegraphics{#1}}
    1.96  \else