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 function, since the symbol itself can be defined automatically.
Here is a few examples from `latex.el'.
(TeX-add-style-hook "latex" (function (lambda () (TeX-add-symbols '("arabic" TeX-argument-counter-hook) '("label" TeX-argument-define-label-hook) '("ref" TeX-argument-label-hook) '("newcommand" TeX-argument-define-macro-hook [ "Number of arguments" ] t) '("newtheorem" TeX-argument-define-environment-hook [ TeX-argument-environment-hook "Numbered like" ] t [ TeX-argument-counter-hook "Within counter" ])))))
Function: TeX-add-symbols symbol ...
Add each symbol to the list of known symbols.
Each argument to TeX-add-symbols
is a list describing one symbol.
The head of list is the name if the symbol, the remaining elements
describe each argument.
If there are no additional elements, the symbol will be inserted with point inside braces. Otherwise, each argument of this function should match an argument to the TeX macro. What is done depend on the argument type.
If a macro is defined multiple times, AUC TeX will chose the one with the longest definition (i.e.\ the one with most arguments).
Thus, to overwrite
'("tref" 1) ; one argument
you can specify
'("tref" TeX-argument-label-hook ignore) ; two arguments
ignore
is a functions that does not do anything, so when you
insert a `tref' you will be prompted for a label and no more.
string
number
nil
t
other symbols
list
vector
A lot of argument hooks has already been defined. The first argument to all hooks are a flag indicating if it is an optional argument. It is up to the hook to determine what to do with the remaining arguments, if any. Typically the next argument is used to overwrite the default prompt.
TeX-argument-conditional-hook
TeX-argument-literal-hook
TeX-argument-free-hook
TeX-argument-eval-hook
TeX-argument-file-hook
TeX-argument-label-hook
TeX-argument-macro-hook
TeX-argument-environment-hook
TeX-argument-cite-hook
TeX-argument-counter-hook
TeX-argument-savebox-hook
TeX-argument-file-hook
TeX-argument-input-file-hook
TeX-argument-define-label-hook
TeX-argument-define-macro-hook
TeX-argument-define-environment-hook
TeX-argument-define-cite-hook
TeX-argument-define-counter-hook
TeX-argument-define-savebox-hook
TeX-argument-corner-hook
TeX-argument-lr-hook
TeX-argument-tb-hook
TeX-argument-pagestyle-hook
TeX-argument-verb-hook
TeX-argument-pair-hook
TeX-argument-size-hook
TeX-argument-coordinate-hook
If you add new hooks, you can assume that point is placed directly after
the previous argument, or after the macro name if this is the first
argument. Please leave point located after the argument you are
inserting. If you want point to be located somewhere else after all
hooks have been processed, set the value of exit-mark
. It will
point nowhere, until the argument hook set it.