[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[help-texinfo] FYI: texi2dvi: sort functions
From: |
Akim Demaille |
Subject: |
[help-texinfo] FYI: texi2dvi: sort functions |
Date: |
Mon, 16 Jun 2008 12:27:59 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux) |
Index: ChangeLog
from Akim Demaille <address@hidden>
* util/texi2dvi: Sort functions.
Index: util/texi2dvi
===================================================================
RCS file: /cvsroot/texinfo/texinfo/util/texi2dvi,v
retrieving revision 1.126
diff -u -u -r1.126 texi2dvi
--- util/texi2dvi 16 Jun 2008 10:23:41 -0000 1.126
+++ util/texi2dvi 16 Jun 2008 10:27:21 -0000
@@ -47,104 +47,6 @@
build_mode=${TEXI2DVI_BUILD_MODE:-local}
build_dir=${TEXI2DVI_BUILD_DIRECTORY:-.}
-usage ()
-{
- cat <<EOF
-Usage: $program [OPTION]... FILE...
-
-Run each Texinfo or (La)TeX FILE through TeX in turn until all
-cross-references are resolved, building all indices. The directory
-containing each FILE is searched for included files. The suffix of FILE
-is used to determine its language ((La)TeX or Texinfo). To process
-(e)plain TeX files, set the environment variable LATEX=tex.
-
-In order to make texi2dvi a drop-in replacement of TeX/LaTeX in AUC-TeX,
-the FILE may also be composed of the following simple TeX commands.
- \`\\input{FILE}' the actual file to compile
- \`\\nonstopmode' same as --batch
-
-Makeinfo is used to perform Texinfo macro expansion before running TeX
-when needed.
-
-General options:
- -b, --batch no interaction
- -D, --debug turn on shell debugging (set -x)
- -h, --help display this help and exit successfully
- -o, --output=OFILE leave output in OFILE (implies --clean);
- only one input FILE may be specified in this case
- -q, --quiet no output unless errors (implies --batch)
- -s, --silent same as --quiet
- -v, --version display version information and exit successfully
- -V, --verbose report on what is done
-
-TeX tuning:
- -@ use @input instead of \input for preloaded Texinfo
- --dvi output a DVI file [default]
- -e, -E, --expand force macro expansion using makeinfo
- -I DIR search DIR for Texinfo files
- -l, --language=LANG specify LANG for FILE, either latex or texinfo
- --no-line-error do not pass --file-line-error to TeX
- -p, --pdf use pdftex or pdflatex for processing
- -r, --recode call recode before TeX to translate input
- --recode-from=ENC recode from ENC to the @documentencoding
- --src-specials pass --src-specials to TeX
- -t, --command=CMD insert CMD in copy of input file
- or --texinfo=CMD multiple values accumulate
- --translate-file=FILE use given charset translation file for TeX
-
-Build modes:
- --build=MODE specify the treatment of auxiliary files [$build_mode]
- --tidy same as --build=tidy
- -c, --clean same as --build=clean
- --build-dir=DIR specify where the tidy compilation is performed;
- implies --tidy;
- defaults to TEXI2DVI_BUILD_DIRECTORY [$build_dir]
- --mostly-clean remove the auxiliary files and directories
- but not the output
-
-The MODE specifies where the TeX compilation takes place, and, as a
-consequence, how auxiliary files are treated. The build mode
-can also be set using the environment variable TEXI2DVI_BUILD_MODE.
-
-Valid MODEs are:
- \`local' compile in the current directory, leaving all the auxiliary
- files around. This is the traditional TeX use.
- \`tidy' compile in a local *.t2d directory, where the auxiliary files
- are left. Output files are copied back to the original file.
- \`clean' same as \`tidy', but remove the auxiliary directory afterwards.
- Every compilation therefore requires the full cycle.
-
-Using the \`tidy' mode brings several advantages:
- - the current directory is not cluttered with plethora of temporary files.
- - clutter can be even reduced using --build-dir=dir: all the *.t2d
- directories are stored there.
- - clutter can be reduced to zero using, e.g., --build-dir=/tmp/\$USER.t2d
- or --build-dir=\$HOME/.t2d.
- - the output file is updated after every succesful TeX run, for
- sake of concurrent visualization of the output. In a \`local' build
- the viewer stops during the whole TeX run.
- - if the compilation fails, the previous state of the output file
- is preserved.
- - PDF and DVI compilation are kept in separate subdirectories
- preventing any possibility of auxiliary file incompatibility.
-
-On the other hand, because \`tidy' compilation takes place in another
-directory, occasionally TeX won't be able to find some files (e.g., when
-using \\graphicspath): in that case use -I to specify the additional
-directories to consider.
-
-The values of the BIBTEX, LATEX (or PDFLATEX), MAKEINDEX, MAKEINFO,
-TEX (or PDFTEX), TEXINDEX, and THUMBPDF environment variables are used
-to run those commands, if they are set. Any CMD strings are added
-after @setfilename for Texinfo input, in the first line for LaTeX input.
-
-Email bug reports to <address@hidden>,
-general questions and discussion to <address@hidden>.
-Texinfo home page: http://www.gnu.org/software/texinfo/
-EOF
- exit 0
-}
-
# Initialize variables for option overriding and otherwise.
# Don't use `unset' since old bourne shells don't have this command.
# Instead, assign them an empty value.
@@ -292,6 +194,34 @@
}
+# ensure_dir DIR1 DIR2...
+# -----------------------
+# Make sure the directories exist.
+ensure_dir ()
+{
+ for dir
+ do
+ test -d "$dir" \
+ || mkdir "$dir" \
+ || error 1 "cannot create directory: $dir"
+ done
+}
+
+
+# error EXIT_STATUS LINE1 LINE2...
+# --------------------------------
+# Report an error and exit with failure if EXIT_STATUS is non null.
+error ()
+{
+ local s="$1"
+ shift
+ report "$@"
+ if test "$s" != 0; then
+ exit $s
+ fi
+}
+
+
# findprog PROG
# -------------
# Return true if PROG is somewhere in PATH, else false.
@@ -329,15 +259,6 @@
done
}
-# verbose WORD1 WORD2
-# -------------------
-# Report some verbose information.
-verbose ()
-{
- if $verb; then
- echo >&2 "$0: $@"
- fi
-}
# run COMMAND-LINE
# ----------------
@@ -350,33 +271,120 @@
}
-# error EXIT_STATUS LINE1 LINE2...
-# --------------------------------
-# Report an error and exit with failure if EXIT_STATUS is non null.
-error ()
+# usage
+# -----
+# Display usage and exit successfully.
+usage ()
{
- local s="$1"
- shift
- report "$@"
- if test "$s" != 0; then
- exit $s
- fi
+ cat <<EOF
+Usage: $program [OPTION]... FILE...
+
+Run each Texinfo or (La)TeX FILE through TeX in turn until all
+cross-references are resolved, building all indices. The directory
+containing each FILE is searched for included files. The suffix of FILE
+is used to determine its language ((La)TeX or Texinfo). To process
+(e)plain TeX files, set the environment variable LATEX=tex.
+
+In order to make texi2dvi a drop-in replacement of TeX/LaTeX in AUC-TeX,
+the FILE may also be composed of the following simple TeX commands.
+ \`\\input{FILE}' the actual file to compile
+ \`\\nonstopmode' same as --batch
+
+Makeinfo is used to perform Texinfo macro expansion before running TeX
+when needed.
+
+General options:
+ -b, --batch no interaction
+ -D, --debug turn on shell debugging (set -x)
+ -h, --help display this help and exit successfully
+ -o, --output=OFILE leave output in OFILE (implies --clean);
+ only one input FILE may be specified in this case
+ -q, --quiet no output unless errors (implies --batch)
+ -s, --silent same as --quiet
+ -v, --version display version information and exit successfully
+ -V, --verbose report on what is done
+
+TeX tuning:
+ -@ use @input instead of \input for preloaded Texinfo
+ --dvi output a DVI file [default]
+ -e, -E, --expand force macro expansion using makeinfo
+ -I DIR search DIR for Texinfo files
+ -l, --language=LANG specify LANG for FILE, either latex or texinfo
+ --no-line-error do not pass --file-line-error to TeX
+ -p, --pdf use pdftex or pdflatex for processing
+ -r, --recode call recode before TeX to translate input
+ --recode-from=ENC recode from ENC to the @documentencoding
+ --src-specials pass --src-specials to TeX
+ -t, --command=CMD insert CMD in copy of input file
+ or --texinfo=CMD multiple values accumulate
+ --translate-file=FILE use given charset translation file for TeX
+
+Build modes:
+ --build=MODE specify the treatment of auxiliary files [$build_mode]
+ --tidy same as --build=tidy
+ -c, --clean same as --build=clean
+ --build-dir=DIR specify where the tidy compilation is performed;
+ implies --tidy;
+ defaults to TEXI2DVI_BUILD_DIRECTORY [$build_dir]
+ --mostly-clean remove the auxiliary files and directories
+ but not the output
+
+The MODE specifies where the TeX compilation takes place, and, as a
+consequence, how auxiliary files are treated. The build mode
+can also be set using the environment variable TEXI2DVI_BUILD_MODE.
+
+Valid MODEs are:
+ \`local' compile in the current directory, leaving all the auxiliary
+ files around. This is the traditional TeX use.
+ \`tidy' compile in a local *.t2d directory, where the auxiliary files
+ are left. Output files are copied back to the original file.
+ \`clean' same as \`tidy', but remove the auxiliary directory afterwards.
+ Every compilation therefore requires the full cycle.
+
+Using the \`tidy' mode brings several advantages:
+ - the current directory is not cluttered with plethora of temporary files.
+ - clutter can be even reduced using --build-dir=dir: all the *.t2d
+ directories are stored there.
+ - clutter can be reduced to zero using, e.g., --build-dir=/tmp/\$USER.t2d
+ or --build-dir=\$HOME/.t2d.
+ - the output file is updated after every succesful TeX run, for
+ sake of concurrent visualization of the output. In a \`local' build
+ the viewer stops during the whole TeX run.
+ - if the compilation fails, the previous state of the output file
+ is preserved.
+ - PDF and DVI compilation are kept in separate subdirectories
+ preventing any possibility of auxiliary file incompatibility.
+
+On the other hand, because \`tidy' compilation takes place in another
+directory, occasionally TeX won't be able to find some files (e.g., when
+using \\graphicspath): in that case use -I to specify the additional
+directories to consider.
+
+The values of the BIBTEX, LATEX (or PDFLATEX), MAKEINDEX, MAKEINFO,
+TEX (or PDFTEX), TEXINDEX, and THUMBPDF environment variables are used
+to run those commands, if they are set. Any CMD strings are added
+after @setfilename for Texinfo input, in the first line for LaTeX input.
+
+Email bug reports to <address@hidden>,
+general questions and discussion to <address@hidden>.
+Texinfo home page: http://www.gnu.org/software/texinfo/
+EOF
+ exit 0
}
-# ensure_dir DIR1 DIR2...
-# -----------------------
-# Make sure the directories exist.
-ensure_dir ()
+
+# verbose WORD1 WORD2
+# -------------------
+# Report some verbose information.
+verbose ()
{
- for dir
- do
- test -d "$dir" \
- || mkdir "$dir" \
- || error 1 "cannot create directory: $dir"
- done
+ if $verb; then
+ echo >&2 "$0: $@"
+ fi
}
+
## ---------------- ##
## Handling lists. ##
## ---------------- ##
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [help-texinfo] FYI: texi2dvi: sort functions,
Akim Demaille <=