code:
@set UPDATED 23 March 2002
@set UPDATED-MONTH March 2002
@set EDITION 4.2
@set VERSION 4.2

repo_name: mthl/texinfo

license: mit


code:
@set UPDATED 28 March 2002
@set UPDATED-MONTH March 2002
@set EDITION 4.2
@set VERSION 4.2


code:
html_tex_tests = tex_l2h.sh tex_t4ht.sh

EXTRA_DIST = $(TESTS) indices_res index_split_res tex_l2h_res tex_t4ht_res $(html_tex_tests)

TESTS = indices.sh
# $(html_tex_tests)
#TESTS = tex_l2h.sh tex_t4ht.sh

test_dirs = indices index_split tex_l2h tex_t4ht
#test_dirs = tex_l2h tex_t4ht

copy-tests:
	for dir in $(test_dirs); do \
		if [ -d "$$dir" ]; then \
			if [ -d "$${dir}_res" ]; then \
				rm -f "$${dir}_res/"*.* ;\
			else \
				mkdir "$${dir}_res/" ; \
			fi ;\
			cp -p "$$dir/"*.* "$${dir}_res/"; \
			rm -f "$${dir}_res/"*.png "$${dir}_res/"*_l2h.css; \
		else \
			echo "No dir $$dir/"; \
		fi; \
	done

DISTCLEANFILES = *.log *.out

distclean-local:
	rm -rf diffs $(test_dirs)

dist-hook:
	for dir in $(test_dirs); do \
		rm -rf `find "$(distdir)/$${dir}_res" -name .svn` ;\
	done


code:
#! /bin/sh

basename=indices
diffs_dir=diffs
logfile=$basename.log
stdout_file=$basename.out

[ "z$srcdir" = 'z' ] && srcdir=.

[ -d $diffs_dir ] || mkdir $diffs_dir

echo "$basename" > $logfile
: > $stdout_file

[ -d index_split ] && rm -rf index_split
[ -d $basename ] && rm -rf $basename
mkdir $basename
echo "perl -w -x $srcdir/../../texi2html.pl -conf-dir $srcdir/../indices/ -test -split chapter -init index_test.init --out $basename/ $srcdir/../indices/index_table.texi $srcdir/../indices/index_split.texi >> $stdout_file 2>$basename/${basename}.2" >> $logfile
perl -w -x $srcdir/../../texi2html.pl -conf-dir $srcdir/../indices/ -test -split chapter -init index_test.init --out $basename/ $srcdir/../indices/index_table.texi $srcdir/../indices/index_split.texi >> $stdout_file 2>$basename/${basename}.2

ret=$?
if [ $ret != 0 ]; then
  echo "F: $basename/$basename.2"
  exit 1
fi

return_code=0
for dir in ${basename} index_split; do
  if [ -d $srcdir/${dir}_res ]; then
    diff -u --exclude=CVS --exclude=.svn --exclude='*.png' -r "$srcdir/${dir}_res" "${dir}" 2>>$logfile > "$diffs_dir/$dir.diff"
    dif_ret=$?
    if [ $dif_ret != 0 ]; then
      echo "D: $diffs_dir/$dir.diff"
      return_code=1
    else
      rm "$diffs_dir/$dir.diff"
    fi
  else
    echo "no res: ${dir}_res"
  fi
done

exit $return_code


code:
#! /bin/sh

LC_ALL=C; export LC_ALL

basename=tex_l2h
diffs_dir=diffs
logfile=$basename.log
stdout_file=$basename.out

[ "z$srcdir" = 'z' ] && srcdir=.

if which latex2html > /dev/null 2>&1; then
  :
else
  exit 77
fi

[ -d $diffs_dir ] || mkdir $diffs_dir

echo "$basename" > $logfile
: > $stdout_file

if tmp_dir=`mktemp -p /tmp -d l2h_t2h_XXXXXXXX`; then
  :
else
  exit 1
fi

[ -d $basename ] && rm -rf $basename
mkdir $basename
echo "perl -w -x $srcdir/../../texi2html.pl --set-init-var 'TEST 1' --set-init-var 'L2H_CLEAN 0' --set-init-var 'L2H_TMP $tmp_dir' --conf-dir $srcdir/../../examples --l2h --l2h-file $srcdir/../../examples/l2h.init --expand tex --out $basename/ $srcdir/../manuals/mini_ker.texi $srcdir/../formatting/tex.texi >> $stdout_file 2>$basename/${basename}.2" >> $logfile
perl -w -x $srcdir/../../texi2html.pl --set-init-var 'TEST 1' --set-init-var 'L2H_CLEAN 0' --set-init-var "L2H_TMP $tmp_dir" --conf-dir $srcdir/../../examples --l2h --l2h-file $srcdir/../../examples/l2h.init --expand tex --out $basename/ $srcdir/../manuals/mini_ker.texi $srcdir/../formatting/tex.texi >> $stdout_file 2>$basename/${basename}.2

return_code=0
ret=$?
if [ $ret != 0 ]; then
  echo "F: $basename/$basename.2"
  return_code=1
else
  rm -f $basename/*_l2h_images.log $basename/*.aux $basename/*_l2h.css $basename/*.png
  sed -i -e 's/^texexpand.*/texexpand /' "$basename/$basename.2"
  sed -i '/is no longer supported at.*line/d' "$basename/$basename.2"
  sed -i -e 's/CONTENT="LaTeX2HTML.*/CONTENT="LaTeX2HTML">/' -e \
   's/with LaTeX2HTML.*/with LaTeX2HTML/' "$basename/"*"_l2h.html"
  sed -i -e 's/^# LaTeX2HTML.*/# LaTeX2HTML/' "$basename/"*"_l2h_images.pl"  "$basename/"*"_l2h_labels.pl"
  sed -i -e 's/WIDTH="\([0-9]*\)\([0-9]\)"/WIDTH="100"/' -e 's/HEIGHT="\([0-9]*\)\([0-9]\)"/HEIGHT="12"/' "$basename/"*"_l2h_images.pl" "$basename/"*.html "$basename/"*-l2h_cache.pm
  # order of entries in *_l2h_images is not reproducible
  rm -f "$basename/"*".aux"  "$basename/"*"_l2h_images.out" "$basename/"*"_l2h_images.pl"
  for dir in ${basename}; do
    if [ -d $srcdir/${dir}_res ]; then
      diff -u --exclude=CVS --exclude=.svn --exclude='*.png' -r "$srcdir/${dir}_res" "${dir}" 2>>$logfile > "$diffs_dir/$dir.diff"
      dif_ret=$?
      if [ $dif_ret != 0 ]; then
        echo "D: $diffs_dir/$dir.diff"
        return_code=1
      else
        rm "$diffs_dir/$dir.diff"
      fi
    else
      echo "no res: ${dir}_res"
    fi
  done
fi

rm -rf $tmp_dir

exit $return_code


code:
#! /bin/sh

LC_ALL=C; export LC_ALL

basename=tex_t4ht
diffs_dir=diffs
logfile=$basename.log
stdout_file=$basename.out

[ "z$srcdir" = 'z' ] && srcdir=.

if which httexi > /dev/null 2>&1; then
  :
else
  exit 77
fi

[ -d $diffs_dir ] || mkdir $diffs_dir

echo "$basename" > $logfile
: > $stdout_file

if tmp_dir=`mktemp -p /tmp -d l2h_t2h_XXXXXXXX`; then
  :
else
  exit 1
fi

[ -d $basename ] && rm -rf $basename
mkdir $basename
echo "perl -w -x $srcdir/../../texi2html.pl --set-init-var 'TEST 1' --set-init-var 'L2H_TMP $tmp_dir' --conf-dir $srcdir/../../maintained_extra --init-file tex4ht.pm --expand tex --out $basename/ $srcdir/../manuals/mini_ker.texi $srcdir/../formatting/tex.texi >> $stdout_file 2>$basename/${basename}.2" >> $logfile
perl -w -x $srcdir/../../texi2html.pl --set-init-var 'TEST 1' --set-init-var "L2H_TMP $tmp_dir" --conf-dir $srcdir/../../maintained_extra --init tex4ht.pm --expand tex --out $basename/ $srcdir/../manuals/mini_ker.texi $srcdir/../formatting/tex.texi >> $stdout_file 2>$basename/${basename}.2

return_code=0
ret=$?
if [ $ret != 0 ]; then
  echo "F: $basename/$basename.2"
  return_code=1
else
  rm -f $basename/*_tex4ht_*.log \
      $basename/*_tex4ht_*.idv $basename/*_tex4ht_*.dvi \
      $basename/*_tex4ht_tex.html $basename/*.png

  for dir in ${basename}; do
    if [ -d $srcdir/${dir}_res ]; then
      diff -u --exclude=CVS --exclude=.svn --exclude='*.png' -r "$srcdir/${dir}_res" "${dir}" 2>>$logfile > "$diffs_dir/$dir.diff"
      dif_ret=$?
      if [ $dif_ret != 0 ]; then
        echo "D: $diffs_dir/$dir.diff"
        return_code=1
      else
        rm "$diffs_dir/$dir.diff"
      fi
    else
      echo "no res: ${dir}_res"
    fi
  done
fi

rm -rf $tmp_dir

exit $return_code


code:
EXTRA_DIST = testkb.texi viper.texi verbatim_html.texi templates.texi \
 tests.txt res res_all res_info

DISTCLEANFILES = tests.log tests.out

distclean-local:
	rm -rf out out_all out_info diffs

dist-hook:
	rm -rf `find $(distdir)/res $(distdir)/res_info $(distdir)/res_all -name .svn`


code:
\input texinfo   @c -*- mode: texinfo; coding: iso-8859-1-unix -*-
@c %**start of header
@setfilename templates.info
@documentencoding iso-8859-1
@documentlanguage en
@settitle  Emacs template package documentation, version 3.1c
@c %**end of header
@alias kbdmenu = kbd
@alias codetpl = samp
@alias codevar = code

@copying
This is the Emacs template package documentation, version 3.1c
Copyright @copyright{} 2008 Christoph Wedler, Vincent Bela�che.

@quotation
Permission is granted to ...
@end quotation
@end copying

@dircategory Emacs
@direntry
* Templates: (templates). Creating templates for files creation.
@end direntry

@titlepage
@title Emacs template package manual
@subtitle Details of Package Template
@author Christoph Wedler

@c  The following two commands
@c  start the copyright page.
@page
@vskip 0pt plus 1filll
@insertcopying

Published by ...
@end titlepage

@ifnottex
@node Top,,,(dir)top
@top Top node.

This is the manual of Emacs template package
@end ifnottex

@menu
* Overview:: Overview.
* Installation:: how to install the template package.
* Basics:: How to make and use templates.
* Advanced:: Templates for advanced users.
* Indexes:: Indexes for commands, keyword, and variable.
* News:: News for Package Template.
* Acknowledgements:: Acknowledgements.
@end menu

@node Overview,,,Top
@chapter Overview

When you create a new file with Emacs, package Template supplies an initial
buffer content via a template: a file with normal text and expansion forms.
There is a menu to easily create such templates.  You can also use new commands
to decorate comments and update the buffer contents.

The main difference between Template and @ref{Related,other similar
packages} is that you can define very flexible templates without having
to learn Lisp or changing your Emacs init file.  This package does not
help Lisp programmers to define complex macros.

@itemize
@item
The template mechanism is hooked into the normal find/open file command.  There
are also new commands for creating a new file using a template and inserting &
expanding a template.
@item
You do not have to enter the file name of the template file.  This package uses
a sophisticated search to find the most appropritate template (supporting
project- and subproject specific template files).  You can change the
suggestion, of course.
@item
A template file can be easily created.  Most of the file usually contains
simple text; only @dfn{expansion forms} which look like
@codetpl{(>>>@var{Key}<<<)} will get replaced.
@item
There are various useful predefined expansions: set point (the cursor
position), mark and registers to the current position; insert various parts of
the filename, the user/system name, the current date/time in various formats,
and some text to be entered by the user.
@item
Template-specific expansions can be defined at the end of the template file.
There are commands to create these definitions; only complex expansions would
require some knowledge of Lisp.
@end itemize

There is a menu to support the creation of template files.  Additionally, this
package provides the following features:

@itemize
@item
When saving a buffer, some parts of the buffer contents (header and time
stamps) are automatically updated if necessary.
@item
There are commands to decorate comments with dashes and alike.  Works for
languages with any comment style, even languages having mixed comments like C++
and Java.
@end itemize

@node Related,,,Overview
@section Packages Related to Template

There are template packages of two different categories, which are determined
by one question:

@emph{What do you want to do with templates?} Do you want to use templates
when creating new files, or do you want to insert some stuff during editing
(but you are not satisfied with the standard macro mechanism)?

Well, templates could be seen as both new-file templates and macro-like
template, but the main application of templates determines the answers for the
following questions:

@itemize
@item
@emph{How do you define a template?} You can define it by one file per
template or by customizing some Emacs variables.  The first solution (which is
used by package Template) avoids Emacs hacking but might not be optimal if you
just want to define complex macros or if you want to use templates to program a
new Emacs major-mode.
@item
@emph{How is an appropriate template selected?} If you want to use complex
macro during editing, the answer is clear: the user have to provide the name of
the template.  For new files, the appropriate template should be automatically
selected.  But of course, you don't want to loose any flexibility and you don't
want to customize your Emacs for every project you start.
@item
@emph{How do you do "clever" things in the template?} The aims are to have
many predefined expansions (e.g., the current date) and to define some
non-trivial things without learning Lisp.  Any functionality here is the
overlapping point of both template categories.
@end itemize

Here is a little list of related files, collected around 1998, some discarded
later (no @abbr{URL}s, no active updating, but you can send me a mail):

@itemize
@item
Package @cite{autoinsert.el} uses templates when creating new files.
These templates are defined via files or by customizing Emacs.  For each new
template you want to introduce, you must customize your Emacs, the selection is
restricted to one template per major-mode or regexp match.  No predefined
expansions; clever things are provided by usual Lisp expressions or the
macro-like templates of package @cite{skeleton}.
@item
Package @cite{skeleton.el} is a Lisp language extension for
writing statement skeletons, i.e., you get macro-like Lisp commands.
@item
Package @cite{tempo.el} helps you defining and using named macro-like
templates.  Its predefined macros are similar to some predefined expansions of
package Template.  A specific template is used by
html-helper-mode when creating a new html file.
(This is turned off with the default installation of package Template.)
@item
Package @cite{hm--html-menus} provides a command to insert templates
editing.  These templates are defined via files.  There are no predefined
expansions (except setting point), non-trivial expansions are defined via Lisp.
@end itemize

@node Installation,,,Top
@chapter Installation

@section Installation Instructions

@enumerate
@item
Copy file @file{template/lisp/template.el} into your
load-path and byte-compile it.
@item
Insert the following code into your Emacs init file
(@file{~/.emacs}):

@lisp
(require 'template)
(template-initialize)
@end lisp

@item
If you want to customize package Template, use @kbd{M-x
customize-group @key{RET} template
@key{RET}} or the customize entry in menu
@kbdmenu{Options}.
@item
You might want to copy the template files from directory
@file{template/templates/} to
@file{~/.templates/} and change them according to your
preferences.
@end enumerate

Installation instructions with further explanations can be found in file
@file{template/INSTALL} of the distribution.

@node Basics,,,Top
@chapter Basics

Emacs, template, file template, comment decoration, auto-updating, time stamp, details

@menu
* menus:: Menus and Key-Bindings.
* using:: Using a Template.
* finding:: Finding a Template.
* creating:: Creating a Template.
* decorating:: Decorating a Comment.
* updating:: Updating a Buffer.
@end menu

@node menus,,,Basics
@section  Menus and Key-Bindings
@c --------------------------------------------------------------------------------
For Emacs-21.1+ and XEmacs, this package defines the following menu entries and
key-bindings:

@itemize
@item
In menu @kbdmenu{File} , there is a new menu item @kbdmenu{New File
Using Template...}  .  The corresponding command is also bound to the
key sequence @kbd{C-x t}.
@item
At the end of menu @kbdmenu{Cmds} (in XEmacs if it exists) or menu
 @kbdmenu{Edit} , there is a new submenu @kbdmenu{Template Creation}.
@item
Enter @kbd{C-x C-=} (command @command{template-single-comment}) to
insert dashes and alike into the current line and end the comment.
@item
Enter @kbd{C-x C-;} (command @command{template-single-comment}) to
insert dashes and alike around the current comment block.
@item
At the end of menu @kbdmenu{Edit} , there is a new submenu
@kbdmenu{Comment}.  It also contains the two commands just mentioned.
@end itemize

@c --------------------------------------------------------------------------------
@node using,,,Basics
@section  Using a Template
@c --------------------------------------------------------------------------------
Package Template offers various ways how to use template files:

In Emacs, the usual way to create a new file is by typing @kbd{C-x C-f},
using the menu or the toolbar (running command @command{find-file} or
@command{ffap}) and entering a non-existent file name.  In this case,
you will be asked whether to use a template for the new file.  You can
turn off this feature.

@itemize
@item
Here a first undefined xref @xref{EExpansion}.
There is a new command @command{template-new-file} @footnote{for the
menu entry and its key-binding type @kbd{C-h f template-new-file},
@xref{EExpansion}} to create a new file using a template.  Here, you have
the chance to edit the name of the template file.  This command also
supports file name refinement which is useful to create a file in a
series of files like @file{exercise2.tex} etc.
@item
There is also a command (@kbd{M-x template-expand-template})
to insert a template file into the current buffer and expand its expansion
forms.
@end itemize

For more @command{template-new-file} and @codevar{template-auto-insert},
 @xref{Expansion}.

@c --------------------------------------------------------------------------------

@node finding,,,Basics
@section  Finding a Template
@c --------------------------------------------------------------------------------
The algorithm for finding the most appropriate template can be best explained
with a little example:

@itemize
@item
You have a project @file{~/proj/} with subprojects @file{foo/} and
@file{bar/} containing @file{.java} files.
@item
You want to define a general template for the @file{.java} in your
project files, although @file{.java} files in subproject @file{foo/}
should use their own template.  You also want to define a special
template for all files @file{proj.java} in the project.
@item
Since you do not want to clutter the project directory with template
files, you first create a directory @file{~/proj/Templates/}.  In this
directory, you create new files @file{TEMPLATE.java.tpl} and
@file{proj.java.tpl}.  In directory @file{~/proj/foo/}, you create a new
file @file{TEMPLATE.java.tpl}.
@end itemize

The creation of the template files in the right directory is already enough for
packages Template to find the most appropriate template for a new file:

@itemize
@item
If you create a new file @file{~/proj/foo/abc.java}, this package tries
to find a template based on the file extension of the new file.  The
generic base file name for a template is @file{TEMPLATE} and the
additional extension is @file{.tpl}, a file @file{TEMPLATE.java.tpl}
exists in @file{~/proj/foo/}, so that file is used as the template.
@item
If you create a new file @file{~/proj/bar/abc.java}, this package again
tries to find @file{TEMPLATE.java.tpl}.  Since this file doesn't exist
in @file{~/proj/bar/}, it first inspects the subdirectory
@file{Templates/} which doesn't exist.  The search continues with the
parent directory @file{~/proj/} and then its subdirectory
@file{Templates/}.  Thus @file{~/proj/Templates/TEMPLATE.java.tpl} will
be used.
@item
If you create a new file @file{~/proj/foo/proj.java}, this package finds
a template file with the same base name: it uses
@file{~/proj/Templates/proj.java.tpl}.  You might argue that
@file{~/proj/foo/TEMPLATE.java.tpl} resides in a more specific
directory, but having the same base name is considered to be more
important (remember that some file like Makefiles do not have file
extensions).
@item
If you create a new file @file{~/other_proj/foo/proj.java}, i.e., a
project where you have defined no template files, this package uses one
of the default templates, in this case
@file{~/.templates/TEMPLATE.java.tpl}.
@end itemize

For more on derivation @xref{Derivation}.

@c --------------------------------------------------------------------------------

@node creating,,,Basics
@section  Creating a Template
@c --------------------------------------------------------------------------------

There are various predefined expansions which are probably enough for
most templates.  A corresponding expansion forms can be easily inserted
by selecting the appropriate entry in the new submenu  @kbdmenu{Template
Creation}
:

@itemize
@item
Remember positions: use @codetpl{(>>>POINT<<<)} to set point (the cursor
position), @codetpl{(>>>MARK<<<)} to set mark (e.g., the opposite position
when a region is highlighted), and @codetpl{(>>>1<<<)} to @samp{(>>>0<<<)}
to registers to the current position.  Remember that @kbd{C-x r j
@var{Key}} jumps to the position stored in register @var{Key}.
@item

Insert parts of the file name, e.g., when creating the new file
@file{~/proj/foo/abc1.java}: @codetpl{(>>>DIR<<<)} is replaced by
@file{/home/user/proj/foo/}, @codetpl{(>>>FILE<<<)} by @file{abc1.java},
@codetpl{(>>>FILE_SANS<<<)} by @file{abc1} , @samp{(>>>FILE_UPCASE<<<)} by
@file{ABC1} , @codetpl{(>>>FILE_RAW<<<)} by @file{abc},
@codetpl{(>>>FILE_NUM<<<)} by @file{1} , and @samp{(>>>FILE_EXT<<<)} by
@file{java}.
@item
Insert the current date/time in two customizable and three fixed
formats: use @codetpl{(>>>DATE<<<)} for @samp{20 Feb 2002},
@codetpl{(>>>TIME<<<)} for @samp{20:01:13} , @samp{(>>>YEAR<<<)} for
@samp{2002} , @codetpl{(>>>ISO_DATE<<<)} for @samp{2002-02-20} , and
@codetpl{(>>>VC_DATE<<<)} for @samp{2002/02/20 19:01:13}
@item
Insert the user/system name in various formats: use
@codetpl{(>>>AUTHOR<<<)} for @email{Christoph Wedler
<wedler@@fmi.uni-passau.de>}, @codetpl{(>>>USER_NAME<<<)} for
@samp{Christoph Wedler} , @codetpl{(>>>LOGIN_NAME<<<)} for @samp{wedler} ,
and @codetpl{(>>>HOST_ADDR<<<)} for @samp{fmi.uni-passau.de} .
@item
Ask the user for some initial comment.  If this expansion is used, the buffer
for the new file will be marked as modified.  For each undefined expansion, the
user is also asked.
@item
Disabling the search for expansion forms:
@codetpl{(>>>ZERO_FORM<<<)} can be inserted into a string which
will be otherwise regarded as an expansion form, the region between
@codetpl{(>>>LITERAL<<<)} and the first
@codetpl{(>>>/LITERAL<<<)} after it will be skipped.
@end itemize

You can define your own expansions in your Emacs init file and at the end of a
template file.  A corresponding definition can be easily inserted by selecting
the appropriate entry in the new submenu  @kbdmenu{Template
Creation}:

@itemize

@item
@kbdmenu{Define User Input}
.  Ask the user to insert some text
using some specific prompt.  Optionally, ask for a text with completion, or for
a sequence of user input (exit with empty input).
@item
@kbdmenu{Define Text Register}
.  Define a text for
register @var{Reg} which can be inserted with @kbd{C-x r i @var{Reg}}.
Optionally, provide a comment for it which will be temporarily shown at
point.
@item
@kbdmenu{Define Message}
.  Define a message which will be
temporarily shown at point or before/after the expansion in a special buffer.
There is also a computed message in the echo area.
@item

Execute some Lisp coding defined at the end of the template.  By default, you
have to confirm it first, since it is insecure to execute unchecked coding.
(You do not have menu support to define this kind of expansion.)
@end itemize

@defopt template-default-expansion-alist
@end defopt
@defopt template-definition-start
@end defopt

@c --------------------------------------------------------------------------------

@node decorating,,,Basics
@section  Decorating a Comment
@c --------------------------------------------------------------------------------

There are commands to decorate comments with dashes and alike (@samp{-},
@samp{=} and @samp{#} by default).  Both commands are included in the
new submenu @kbdmenu{Comments}
and bound to keys:

@itemize
@item
Use command @code{template-single-comment} to jump to the
end of the current line and insert the dashes and the final
comment end-string up-to the fill position.  This command works with any
comment style, including for languages having mixed comments like C++ and Java.
It also works in major modes without a defined comment syntax.
@item
Use command @code{template-block-comment} to surround the
current comment block (i.e., contiguous comment lines) with extra lines
containing dashes and alike and to put the correct number of newlines around
the block.  This command only works with comments which are terminated with the
end of the line (like Java's @code{//}@c code class=text
 comment).
@end itemize

The comment decoration style is highly customizable and can be controlled by

@itemize
@item
The prefix argument given to the two commands.
@item
The existing comment decoration style when present.
@item
Determined by the indentation or the repetition of a single-character comment
start (like Emacs-Lisp's @code{;}@c code class=text
).
@end itemize

For more on comments @xref{Comments}.

@c --------------------------------------------------------------------------------

@node updating,,,Basics
@section  Updating a Buffer
@c --------------------------------------------------------------------------------
A buffer is automatically updated according to some rules when saving
the file.  This updating can be invoked explicitly by selecting the menu
entry @kbdmenu{Update Buffer} in the new submenu @kbdmenu{Comments} .

@itemize
@item
Update the file name in the first three lines of the buffer if the file name is
indicated by @code{@@(#) @var{FileName}}@c code class=text
 or
@code{;;; @var{FileName} --}@c code class=text
 where
@code{;;;}@c code class=text
 stands for any comment start (with optional
repetition of a single-character comment start).
@item
Update the date if it is the last text inside the
@code{address}@c code class=html
 element of a HTML buffer.
@item
Automatic updating is optional, as is user confirmation for it.  Automatic
updating can be disabled for buffers whose file name matches a regular
expression.
@item
If nothing will be changed by the updating, there will be no user confirmation
and the buffer will not be marked as modified.
@end itemize

@defopt template-update-buffer
@end defopt
@defopt template-auto-update
@end defopt
@defopt template-update-buffer-alist
@end defopt
@defopt template-header-regexp-alist
@end defopt

@node Advanced,,,Top
@chapter Templates for advanced users

@menu
* Customization:: Templates customization.
@end menu

@node Customization,,,Advanced
@section Templates customization

@menu
* Expansion:: Customization of keyword expansion rules.
* Derivation:: Customization of how templates are derived.
* Comments:: Customization of comments.
@end menu

@node Expansion,,,Customization
@subsection Customization of keyword expansion rules

@deffn {Interactive Command} template-new-file {file template with-undo}
Open a new file @var{file} by using a @var{template}.
Using a template for creating a new file consists of, steps 1 to 3 are
only executed when called interactively:
@enumerate
@item
Prompt for the name of the new file.
@item
Template derivation: suggest a reasonable template file to the user see
@codevar{template-derivation-alist}.
@item
File name refinement: e.g., if the given file name is @file{exercise}
and there are two files @file{exercise1.tex} and @file{exercise2.tex} in
the same directory and if we have a template @file{exercise.tex.tpl},
the file name is refined to @file{exercise3.tex}.  This is turned off
when @kbd{C-x t} is called with a prefix argument.
@item
Template insertion: insert the template file into the empty buffer.
@item
Read per-template expansion definition section starting at
@codevar{template-definition-start} and delete it.
@item
Display: before message in @codevar{template-message-buffer}.
@item
Execute pre-expansion commands defined in the definition section.
@item
Set local variables defined in the definition section.
@item
Expansion: expand the expansion forms (text matched by
@codevar{template-expansion-regexp}) They are defined in the definition
section, in @codevar{template-expansion-alist}, or provided by default,
see @codevar{template-expansion-regexp} and
@codevar{template-register-regexp}.
@item
Execute post-expansion commands defined in the definition section.
@item
Run @code{normal-mode} and functions in @codevar{find-file-hooks}.
@item
Update header according to @command{template-update-header} with
@c Vincent: What is this if-exists argument ?
argument @codevar{if-exists}.
@item
Display: after message in @codevar{template-message-buffer}.
@item
Report: display a temporary message at point defined in the definition
section and an automatically generated message in the minibuffer area,
see @codevar{template-message-timeout}.
@end enumerate
If optional @var{with-undo} is non-nil, store corresponding changes in
@codevar{buffer-undo-list}.  If @var{file} is nil, the buffer for @var{file} has
already been created and the accessible part will be replaced by the
expanded template.  If @var{template} is nil (empty input when called
interactively), do not use a template.
@end deffn

@defopt template-auto-insert
@end defopt

@node Derivation,,,Customization
@subsection Customization of how templates are derived

@defopt template-derivation-alist
@end defopt

@node Comments,,,Customization
@subsection Customization of comments

@defopt template-single-comment
@end defopt

@deffn {Interactive command} template-block-comment arg
It is bound to @kbd{C-x C-;}, and @kbdmenu{<menu-bar> <edit> <Comment> <Decorate Comment Block>}.

Decorate the current block of comment-only lines with dashes and alike.
That is, surround the the contiguous comment-only lines around point
with extra lines containing dashes and alike and to put the correct
number of newlines around the block.

Barf if the comment syntax at point has a non-empty @codevar{comment-end} or if
point is not in a comment-only line.

A block comment consists of all neighboring lines which start with
spaces and @codevar{comment-start}.  If @codevar{comment-start} is a string of length 1,
the number of repetitions of @codevar{comment-start} must be the same or larger
than in the line where the command is invoked from, too.

Prefix argument @var{arg} and @codevar{template-comment-specification} determines the
comment style to use.  The length of the separator line is determined by
@codevar{template-max-column}.

This command can also be used with point in an empty line after a block
comment.  A second invocation of this command directly after a
successful invocation deletes the remaining empty lines from the current
line on.
@end deffn

@defopt template-comment-specification-alist
List of specifications for comment functions.  Each specification at
@var{level}, starting at 1, is a list @code{(@var{separator}
@var{before-block} @var{after-block} @var{DELETE-LINES})}

@var{separator} is the string which is inserted repeatedly by commands
@kbd{C-x C-=} and @kbd{C-x C-;} up to @code{template-max-column}.

After that, @kbd{C-x C-;} deletes @var{DELETE-LINES} after the comment block
and inserts string @var{after-block} at the end of the block and
@var{before-block} at the front of the block.

The specification @var{level} to use is determined by:
@enumerate
@item
If the prefix argument is non-nil and its numeric value is > 0, this
value is the @var{level}.
@item
If the prefix argument is nil, and there is an old comment style, use
old comment style.
@item
If @codevar{template-comment-specification-special} is a function or the
current major mode has a property with this name and its value is a
function, this function returns the specification.
@item
If @codevar{comment-end} is empty and @codevar{comment-start} is a string of
length 1: @var{level} is number of repetitions of @codevar{comment-start}
at the beginning of the line.  Otherwise, if the correctly indented line
starts at the beginning of the line, @var{level}=3, else @var{level}=2.
@end enumerate
@end defopt

@node Indexes,,,Top
@chapter Indexes for commands, keyword, and variable

@menu
* Keyword Index:: Keyword Index.
* Command Index:: Command Index.
* Variable Index:: Customizable Variable Index.
@end menu

@node Keyword Index,,,Indexes
@section Keyword Index

@node Command Index,,,Indexes
@section Keyword Index

@printindex fn

@node Variable Index,,,Indexes
@section Variable Index

@printindex vr

@node News,,,Top
@chapter News for Package Template

@table @asis
@item Latest Version:
@strong{3.1c} (21 Aug 2003).
@item Requirements:
@cite{Emacs-20.2}, @cite{XEmacs-20.2}, or higher.

No menu support for Emacs before Version 21.1.
@item Licence:
@cite{GNU General Public License}.
@end table

@section Changes with Release 3.1c

@itemize
@item
Bug fix: on XEmacs, initialization would fail without menus "File" and "Edit" in menubar.
@item
Allow messages to be displayed in a separate buffer "*Template Messages*"
instead at point.
@item
Correct and improve header updating.
@item
Extend use of @code{M-x template-single-comment}.
@item
Minor bug fixes.  Miscellaneous.
@end itemize

@section Changes with Release 3.1

@itemize
@item
Moved to SourceForge.net.  Less technical description on web page.
@item
Remove examples from distribution, they were more confusing than helpful.
@item
Bug fix: would sometimes indent the current line when using the menubar.
@item
Menus work with Emacs-21, too.  Rename some menu entries.
@item
Don't search further for remote templates.  Nuke this home/base directory
stuff, stop search at root.
@item
Don't rely on command @command{ffap} to always add an entry to
@code{command-history} if the filename is read from terminal.  Special
setup for @code{ffap} and @code{html-helper}.
@item
Make date/time formats work as names suggest.
@item
Command to insert & expand a template file.
@item
Allow user to define a choice in the definition section to be answered
via @code{y-or-n-p}.
@item
Various miscellaneous improvements.  Minor bug fixes.
@end itemize

@node Acknowledgements,,,Top

Christoph Wedler @uref{http://sourceforge.net/users/wedler/}, 21 Aug 2003

@bye
@c --------------------------------------------------------------------------------

@c Local Variables:
@c mode: texinfo
@c TeX-master: t
@c compile-command: (progn (require 'info) (concat "makeinfo templates.texi \
@c  -o " (or (car-safe (last (Info-default-dirs))) "") "templates.info"))
@c End:


code:
\input texinfo @c -*-texinfo-*-
@setfilename testkb.info
@documentlanguage de
@documentencoding ASCII
@setchapternewpage on
@footnotestyle separate
@c
@ifset shorttitlepage-enabled
@shorttitlepage Cfg
@end ifset
@titlepage
@title Test for @@def stuff
@end titlepage
@c ----------------------------------------------------------------------------
@node Top,Overview,,(dir)
@chapter Test 1
Hier kann eine Erkl@"arung zum Thema stehen oder auch nicht.
Noch mehr erkl@"arungen zu dem Thema.
@menu
* Overview::.       Methode four.
@end menu
@c ----------------------------------------------------------------------------
@node Overview,,Top,Top
@chapter Class
Here you can read many things I need for this documentation.
But more and more of this exploration can be done here.
@section Overview
Das ist ein Test @r{Roman Text in einer Umgebung}

Hier ist normaler Text. Hier sollte keine Einr@"uckung stattfinden.
Sondern eher ein normaler umbruch. Somit kann es hier wieder
weitergehen. Oder sehe ich da was falsch.
Hier ist normaler Text. Hier sollte keine Einr@"uckung stattfinden.
Sondern eher ein normaler umbruch. Somit kann es hier wieder
weitergehen. Oder sehe ich da was falsch.
Hier ist normaler Text. Hier sollte keine Einr@"uckung stattfinden.
Sondern eher ein normaler umbruch. Somit kann es hier wieder
weitergehen. Oder sehe ich da was falsch.
Hier ist normaler Text. Hier sollte keine Einr@"uckung stattfinden.
Sondern eher ein normaler umbruch. Somit kann es hier wieder
weitergehen. Oder sehe ich da was falsch.

@defcv dcvKat dcvClass dcvName
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu defcv. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu defcv.
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu defcv. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu defcv.
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu defcv. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu defcv.
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu defcv. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu defcv.
@end defcv

@deffn {dfnKat} dfnName (dfnArgumente)
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu deffn. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu deffn.
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu deffn. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu deffn.
@itemize
@item Erstens
@item Zweitens
@item Drittens
@end itemize
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu deffn. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu deffn.
@sp 2
@example
Das ist ein Beispiel in HTML
Das ist ein Beispiel in HTML
Das ist ein Beispiel in HTML
Das ist ein Beispiel in HTML
@end example
@*
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu deffn. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu deffn.
@end deffn

@deffn {dfnKat1} dfnName1 (dfnArgumente11)
@deffnx {dfnKat2} dfnName2 (dfnArgumente12)
@deffnx {dfnKat3} dfnName3 (dfnArgumente13)
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu deffn. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu deffn.
@end deffn

@defivar {divClass} {divExemplarVar}
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu defivar. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu defivar.
@end defivar

@defmac dmcName (dmcArgumente)
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu defmac. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu defmac.
@end defmac

@defmethod {dmeClass} dmName (dmArguments)
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu defmethod. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu defmethod.
@end defmethod

@defop {dopKat} {dopClass} dopName (dopArgumente)
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu defop. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu defop.
@end defop

@defopt {dptName}
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu defopt. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu defopt.
@end defopt

@defspec dspName (dspArgument)
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu defspec. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu defspec.
@end defspec

@deftp {dtpKat} dtpType (dtpA1 dtpA2)
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu deftp. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu deftp.
@end deftp

@deftypefn {PUBLIC} int EditLine (int col, int row)
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu deftypefn. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu deftypefn.
@end deftypefn

@deftypefun int FunktionEins (int col, int row)
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu deftypefun. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu deftypefun.
@end deftypefun

@deftypemethod {dtmClass} int dtmName (int col, int row)
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu deftypemethod. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu deftypemethod.
@end deftypemethod

@deftypevar DataType VarName
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu deftypevar. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu deftypevar.
@end deftypevar

@deftypeivar {dtiv} DataType VarName
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu deftypeivar. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu deftypeivar.
@end deftypeivar

@deftypevr {dtv} DataType VarName
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu deftypevr. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu deftypevr.
@end deftypevr

@defun FuntionName (Argumente)
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu defun. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu defun.
@end defun

@defvar VariablenName
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu defvar. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu defvar.
@end defvar

@defvr {dvrKat} dvrName
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu defvr. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu defvr.
@end defvr

@deftypeop {dtypeopCat} deftypeopClass deftypeopType deftypeopName deftypeopArgs
Hier mu@ss{} in HTML eine Tabelle erzeugt werden. Hier ist das ok.
Beschreibung zu deftypeop. Hier mu@ss{} in HTML eine Tabelle erzeugt
werden. Hier ist das ok. Beschreibung zu deftypeop.
@end deftypeop

@appendix Indizes
@appendixsec Konzept Index
@printindex cp
@appendixsec Funktionen Index
@printindex fn
@appendixsec Programme Index
@printindex pg
@appendixsec Tasten Index
@printindex ky
@appendixsec Var Index
@printindex vr
@contents
@bye


code:
texi testkb.texi
texi verbatim_html.texi
texi viper.texi --ifinfo
texi templates.texi
testkb testkb.texi
verbatim_html verbatim_html.texi
viper_unsplit viper.texi --ifinfo
viper_chapter_split viper.texi --split chapter --ifinfo
formatting_html32 ../coverage/formatting.texi --init html32.pm
templates templates.texi


code:
\input texinfo @c -*-texinfo-*-

@node Top,First node,(dir)
@top Tests
@menu
* First node::    node 1
* description: node @'{a}.    node with braces
* node: (manual)A node. node in another manual

a verbatim in menu comment @verbatim verbatim on same line than @verbatim

bidule

@end verbatim

* node d@'a::       node without braces
@end menu

Tests for environments not matching

@quotation
A quotation
@end cartouche

@deffn {Function Reference} print_navigation $filehandle
Text
@end deftypefun

@table
@item item
line
@end vtable

@table @emph
@item ref
@example
example
@end display
@end table

@node First node
@chapter first node chapter

A list with bullet
Before itemize, in that case @@bullet isn'right, one needs @@bullet@{@} (in info) @itemize @bullet{} @c segfault <- @item on the same line that itemize
@item on the same line than item
some text
@item
more text @end  itemize

A list with text before first @@item:

@itemize @bullet
text @item more
text
@end itemize

@ifhtml
a verbatim, not first on the line @verbatim text following @verbatim

text

@@@@ @ text before @end  verbatim @end verbatim Text following end verbatim, must be exactly one space
between end and verbatim. @@end verbatim doesn't need to begin at beginning
of line.
@end ifhtml

In tex, @@end verbatim must be on its own on a line.

A verbatim with begin and end on its own line
@verbatim
verbatim @samp{item}

@end verbatim

@ifhtml
Now html  @html
<b>
some html </b>
@end html bidule ignored

@@end html begins the line, and there must be exactly one space between @@end
and html and thing following @@end html are ignored in info. Strangely
the empty line following @@end html is ignored but spaces are inserted.
@end ifhtml

Now html valid for @TeX{}  @html
<b>
some html </b>
@end html
Some text one the line following @@end html

And html on it's own line

@html
<tt> an html tt</tt>
@end html

A sc: @sc{ieee}, and another one in example:
@example
@sc{aeei}
@end example

@ifhtml
ignore @ignore ignored

@end ignore bidule ignore
@end ifhtml

Ignore is the same than @@html.

Now ifnothtml on same line @ifnothtml text following ifnothtml

text following an empty line
text before end ifnothtml @end  ifnothtml

@@end ifnothtml doesn't need to begin the line, and there can be more
than one space between @@end and ifnothtml, but nothing more
on the line.

Text on the line before ifnothtml with text following,
@ifnothtml text following ifnothtml,
@end  ifnothtml
Text on the line following ifnothtml.

Text on the line before ifnothtml without text following,
@ifnothtml
some text on a line between ifnothtml and end  ifnothtml,
@end  ifnothtml
Text on the line following ifnothtml.

Text on the line before ifnothtml,
@ifnothtml
@end  ifnothtml
Text on the line following empty ifnothtml

@TeX{} has problems with the ftable.

@ifhtml
an ftable on same line @ftable @bullet
@item fun1
@itemx fun2
fun1 et fun2 @item more fun
text on the same line than end   @end  ftable
works like @@ifnothtml
@end ifhtml

@item outside format.

@tab outside format.

@multitable {@samp{bidule}}
truc before table beginning @item first cell @tab ignored cell
@itemx second row
@end multitable

before bad  multitable @multitable 6 7
@item 1-1 @tab 1-2 @item@tab@item 3-1 @tab 3-2 @end multitable

right multitable
@multitable @columnfractions 6 7
@item 1-1 @tab 1-2 @item@tab@item 3-1 @tab 3-2 @end multitable

Columnfraction multitable with an ignored cell
@multitable @columnfractions 0.3 0.4
@item 1-1 @tab 1-2 @tab 1-3 (ignored)
@end multitable

multitable beginning with @@tab
@multitable {@samp{@verb{.something.}}} {sec}
@tab after first tab
@item new line
@end multitable

A flushright
@flushright some text flushed right
@end flushright

A center @center Centered line
And a center after empty line

@center centered line after empty line

And a center at end of line @center
And an empty center @center

An empty flushright @flushright

@end flushright

A verb follows:

@verb{' a little

very little
verb '}

another with space as delimiter

@verb{ what@@ }

@@verb followed by end of line seems incorrect.
Now verb delimited with *, with an empty line, a comment and @@samp:

@verb{*with
verb @c comment

and samp @samp{text }
*}

@node node @'{a}, node d@'a, First node, Top
@chapter node 'a with braces
In the node with braces

A footnote with an empty line within.
@footnote{with empty line

before before}

Now a ref with a footnote within, there aren't 2 paragraphes in the footnote
in that case in info. tex doesn't like the paragraph break in the ref
@ifhtml
@ref{First
node, within ref a footnote @footnote{with empty line

before before}}.

Conversely, a ref in a footnote
@footnote{ This is a ref @ref{First node} }

A footnote with an example
@footnote{
@example

An example

@end example
}

@end ifhtml

Some @@verbatim, @@verb and @@ignore within an xref, very hard for @TeX{}:
@ifhtml
@xref{First node,
@verbatim

some
verbatim   @@
text
within an xref

@end verbatim

and now verb delimited with * with an empty line a comment and @@samp
@verb{*with
verb @c comment

and samp @samp{text }
next line
*}

last ignored sentence
@ignore
ignore me causing problems to makeinfo
@end ignore

}.
@end ifhtml

@xref{First node,
no verb}.

@node node d@'a,, node @'{a}, Top
@chapter node 'a without braces
@menu
* node::       node
@end menu

@node node,,,
@section node

A node with gggggggg
before example @example after example

the example
before end example  @end  example
after end example

Text only after the end

@example
Example
@end example text following end example.

@deffn category name args
Deffn.
@end deffn text following end deffn.

@contents
@bye