I forgot to make a small modification in the auctex.texi patch before
sending, so please use this one instead. Thank you.
--
Med Venlig Hilsen / Kind Regards,
Mads Jensen
Rubinsteinsvej 31,st.th
DK-2450 Kbh. SV
Denmark
+45 6168 8518
My brain is my second favorite organ.
-- Woody Allen
Index: auctex.texi
===================================================================
RCS file: /sources/auctex/auctex/doc/auctex.texi,v
retrieving revision 1.314
diff -u -u -r1.314 auctex.texi
--- auctex.texi 4 Dec 2012 08:01:34 -0000 1.314
+++ auctex.texi 13 Jan 2013 20:51:06 -0000
@@ -12,7 +12,7 @@
(version @value{VERSION} from @value{UPDATED}),
a sophisticated TeX environment for Emacs.
-Copyright @copyright{} 1992-1995, 2001, 2002, 2004-2012
+Copyright @copyright{} 1992-1995, 2001, 2002, 2004-2013
Free Software Foundation, Inc.
@quotation
@@ -3812,6 +3812,7 @@
@cindex Adding macros
@cindex Macros, adding
@cindex Defining macros in style hooks
+@cindex Adding completion for arguments in macros
The most common thing to define in a style hook is new symbols (@TeX{}
macros). Most likely along with a description of the arguments to the
@@ -3999,6 +4000,67 @@
hooks have been processed, set the value of @code{exit-mark}. It will
point nowhere, until the argument hook sets it.
+@defvar TeX-complete-list
+List of regular expressions matching @TeX{} macro definitions.
+Subexpressions will be completed.
+@end defvar
+
+The list has the following format ((REGEXP MATCH TABLE END) @dots{}), that
+is, each entry is a list with four elements.
+
+REGEXP . Regular expression matching the macro we want to provide
+argument completion for.
+
+MATCH . A number in the subexpression to try completion for.
+
+TABLE . The list with symbols to offer completion from. See below for a
+list of tables that @AUCTeX provides by default.
+
+END . Text to insert after successful completion. Most often, this is
+just a curly bracket.
+
+The following example is taken from @file{varioref.el}
+@lisp
+;; Install completion for labels
+(setq TeX-complete-list
+ (append
+ '(("\\\\[Vv]ref{\\([^{}\n\r\\%,]*\\)" 1 LaTeX-label-list "}")
+ ("\\\\vref\\*?{\\([^{}\n\r\\%,]*\\)" 1 LaTeX-label-list "}")
+ ("\\\\Ref{\\([^{}\n\r\\%,]*\\)" 1 LaTeX-label-list "}")
+ ("\\\\vref\\*{\\([^{}\n\r\\%,]*\\)" 1 LaTeX-label-list "}")
+ ("\\\\fullref{\\([^{}\n\r\\%,]*\\)" 1 LaTeX-label-list "}")
+ ("\\\\vpageref\\*?\\(\\[[^]]*\\]\\)*{\\([^{}\n\r\\%,]*\\)"
+ 2 LaTeX-label-list "}"))
+ TeX-complete-list)
+@end lisp
+
+By default, @AUCTeX defines the following lists that can be used for
+completion.
+
+@vtable @code
+
+@item LaTeX-label-list
+List of labels.
+
+@item LaTeX-bibitem-list
+List of bibliography entries.
+
+@item LaTeX-environment-list
+List of names for environments defined in style files, and in the
+document.
+
+@item LaTeX-symbol-list
+List of names for commands defined in the document, and in the style
+files.
+
+@item LaTeX-style-list
+List of styles available for documentclass.
+
+@item LaTeX-auto-index-entry
+Index entries in the document.
+
+@end vtable
+
@node Adding Environments
@subsection Adding Support for Environments
@cindex Adding environments
@@ -4033,6 +4095,17 @@
@code{LaTeX-add-environments}. The fact that an argument is optional
can be indicated by wrapping the prompt string in a vector.
+@defvar LaTeX-after-insert-env-hooks nil
+List of functions to run after having inserting an environment. Each
+function in the hook has the form (ENV BEGIN END)
+
+ENV . Name of the environment just inserted
+
+BEGIN . The buffer position right before @samp{\begin{env}} starts.
+
+END . Position right before @samp{\end{env}}.
+@end defvar
+
For example, if you have defined a @code{loop} environment with the
three arguments @var{from}, @var{to}, and @var{step}, you can add
support for them in a style file.
@@ -4137,6 +4210,17 @@
@end lisp
@end ftable
+For lists, @AUCTeX has the @code{LaTeX-item-list} which associates an
+environment name with a function that is called when the list is
+inserted to insert the first item, and when new items are added. The
+following example is taken from @file{latex.el}. The function
+@code{LaTeX-item-bib} just inserts a new @code{bibitem}.
+
+@lisp
+(setq LaTeX-item-list '(("description" . LaTeX-item-argument)
+ ("thebibliography" . LaTeX-item-bib)))
+@end lisp
+
@node Adding Other
@subsection Adding Other Information
@cindex Adding bibliographies
@@ -4247,7 +4331,7 @@
@defvar TeX-auto-regexp-list
List of regular expressions matching @TeX{} macro definitions.
-The list has the following format ((REGEXP MATCH TABLE) @dots{}), that
+The list has the following format ((REEXP MATCH TABLE) @dots{}), that
is, each entry is a list with three elements.
REGEXP. Regular expression matching the macro we want to parse.
signature.asc
Description: OpenPGP digital signature
_______________________________________________ auctex-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/auctex-devel
