Function: TeX-add-style-hook

TeX-add-style-hook is a byte-compiled function defined in tex.el.

Signature

(TeX-add-style-hook STYLE HOOK &optional DIALECT-EXPR)

Documentation

Give STYLE yet another HOOK to run.

DIALECT-EXPR serves the purpose of marking the hook to be run only in that dicontext.

DIALECT-EXPR may be a single symbol defining the dialect, see variable TeX-style-hook-dialect for supported dialects.

DIALECT-EXPR can also be an expression like one of the following:

* (or DIALECT1 DIALECT2 ...)
* (nor DIALECT1 DIALECT2 ...)
* (and DIALECT1 DIALECT2 ...)
* (not DIALECT )

When omitted DIALECT-EXPR is equivalent to (nor ), ie all dialected are allowed.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/tex.el
(defun TeX-add-style-hook (style hook &optional dialect-expr)
  "Give STYLE yet another HOOK to run.

DIALECT-EXPR serves the purpose of marking the hook to be run only in
that dicontext.

DIALECT-EXPR may be a single symbol defining the dialect, see
variable `TeX-style-hook-dialect' for supported dialects.

DIALECT-EXPR can also be an expression like one of the following:

* (or  DIALECT1 DIALECT2 ...)
* (nor DIALECT1 DIALECT2 ...)
* (and DIALECT1 DIALECT2 ...)
* (not DIALECT )

When omitted DIALECT-EXPR is equivalent to `(nor )', ie all
dialected are allowed."
  (let ((entry (assoc-string style TeX-style-hook-list)))
    (and dialect-expr (setq hook (vector 'TeX-style-hook hook
                                         (TeX-shdex-eval dialect-expr))))
    (cond ((null entry)
           ;; New style, add entry.
           (setq TeX-style-hook-list (cons (list style hook)
                                           TeX-style-hook-list)))
          ((member hook entry)
           ;; Old style, hook already there, do nothing.
           nil)
          (t
           ;; Old style, new hook.
           (setcdr entry (cons hook (cdr entry)))))))