Manage auto insertion of labels.

* latex.el (LaTeX-auto-insert-label): New customizable variable.
(LaTeX-label): Use it.

* doc/auctex.texi (Environments): Document
`LaTeX-auto-insert-label'.

* doc/changes.texi: Mention `LaTeX-auto-insert-label'.  Fix a
couple of bad-boxes in the PDF output of the manual.
Keep error overview window if View command is run.

* tex-buf.el (TeX-command): Keep the frame and the buffer
associate to the error overview if the command to be run is View.
Rename LaTeX-auto-insert-label and document its use for sections.

* latex.el (LaTeX-insert-label): Rename from
`LaTeX-auto-insert-label' and mention sections in the doc-string.
(LaTeX-label): Update accordingly.

* doc/auctex.texi (Sectioning): Mention `LaTeX-insert-label'.
(Environments): Update `LaTeX-insert-label' name and document use
for sectioning commands.
(Environments, Completion): Prettify
`TeX-complete-expert-commands' documentation by using a table
environment.

* doc/changes.texi: Rename `LaTeX-auto-insert-label' to
`LaTeX-insert-label' and mention sections too.
Change again method to determine whether a label should be inserted.

* latex.el (LaTeX-insert-label): Remove.
(LaTeX-label): Add a new mandatory argument.  Do not use
`LaTeX-insert-label'.  Determine the prefix at the beginning of
the function and insert the label only if the prefix is non nil.
(LaTeX-section-label, LaTeX-env-figure, LaTeX-env-label): Use the
second mandatory argument of `LaTeX-label'.

* style/amsmath.el: Update copyright years.
("amsmath"): Append the environments to `LaTeX-label-alist'
instead of prepeding them.  Use the second mandatory argument of
the `LaTeX-label' function.

* style/longtable.el: Update copyright years.
("longtable"): Move addition of "longtable" environment to
`LaTeX-label-alist' inside the style hook.  Append the environment
to the alist instead of prepending it.  Use the second mandatory
argument of the `LaTeX-label' function.

* doc/auctex.texi (Sectioning, Environments): Remove references to
`LaTeX-insert-label'.
(Environments): Document `LaTeX-label-alist'.

* doc/changes.texi: Remove references to `LaTeX-insert-label'.
Adapt mathtools.el to latest amsmath.el changes.

* style/mathtools.el ("mathtools"): Don't use the removed
`LaTeX-amsmath-env-aligned' function.

Signed-off-by: Tassilo Horn <tsdh@gnu.org>
Font-lock fix for verbatim environment args.

* font-latex.el (font-latex-set-syntactic-keywords): Allow for a
mandatory argument for a verbatim environment.
Code cleanup and optimizations.

* font-latex.el (font-latex-add-quotes): Code optimization: use
'(add-to-list (make-local-variable (quote foo)) some-value)'
instead of '(make-local-variable (quote foo)) (add-to-list 'foo
some-value)' wherever possible.

* bib-cite.el (bib-cite-minor-mode)
(bib-cite-setup-highlight-mouse-keymap): Code optimization: use
'(set (make-local-variable (quote foo)) some-value)' instead of
'(make-local-variable (quote foo)) (setq foo some-value)' wherever
possible.

* latex.el (BibTeX-auto-store)
(LaTeX-common-initialization): Ditto.

* tex-info.el (TeX-texinfo-mode): Code optimization: use '(set
(make-local-variable (quote foo)) some-value)' instead of
'(make-local-variable (quote foo)) (setq foo some-value)' wherever
possible. Add in style Texinfo standard macros '@acronym' and
'@tie'.

* tex.el (TeX-assoc-string) new defalias to work-around missing
assoc-string in XEmacs.
(TeX-unload-style): Code optimization: use 'TeX-assoc-string'
instead of 'assoc' to search style in 'TeX-style-hook-list', and
use delq on returned value of assoc-string for removing the style
--- on the one hand delq will go through the whole list rather
than stop after the first match like in original code, but on the
other hand comparison are faster because eq instead of equal is
used and we are working on assoc cell rather than on key, so less
indirection, furthermore delq is C code. Anyway that make the code
much smaller and easier to understand.
(TeX-file-extensions): Add txi amongst extension of texinfo files,
for consistency with info node '(texinfo) Minimum'
(TeX-run-style-hooks): Code optimization: use 'TeX-assoc-string'
instead of 'assoc' to search style in 'TeX-style-hook-list'.
(VirTeX-common-initialization): Code optimization: use '(set
(make-local-variable (quote foo)) some-value)' instead of
'(make-local-variable (quote foo)) (setq foo some-value)' wherever
possible.

Signed-off-by: Tassilo Horn <tsdh@gnu.org>
Change Vincent's email address in ChangeLog.
Fix the expansion of %' in TeX-expand-list.

* tex.el (TeX-expand-list): Add the previous position to the
lenght of the expanded string to get the current position in the
%' expander.

Signed-off-by: Mosè Giordano <mose@gnu.org>
Add test for the %` expander.

* tests/tex/command-expansion.el: New test file.
Bugfix in file name expansion.

* tex-buf.el (TeX-command-expand): Fix possible endless loop in
file name expansion.

Signed-off-by: Tassilo Horn <tsdh@gnu.org>