Function: LaTeX-current-environment
LaTeX-current-environment is a byte-compiled function defined in
latex.el.
Signature
(LaTeX-current-environment &optional ARG)
Documentation
Return the name (a string) of the enclosing LaTeX environment.
With optional ARG>=1, find that outer level.
If function is called inside a comment and
LaTeX-syntactic-comments is enabled, try to find the
environment in commented regions with the same comment prefix.
The functions LaTeX-find-matching-begin and LaTeX-find-matching-end
work analogously.
Source Code
;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/latex.el
(defvar LaTeX-syntactic-comments) ;; Defined further below.
(defun LaTeX-current-environment (&optional arg)
"Return the name (a string) of the enclosing LaTeX environment.
With optional ARG>=1, find that outer level.
If function is called inside a comment and
`LaTeX-syntactic-comments' is enabled, try to find the
environment in commented regions with the same comment prefix.
The functions `LaTeX-find-matching-begin' and `LaTeX-find-matching-end'
work analogously."
(save-excursion
(if (LaTeX-backward-up-environment arg)
(progn
(re-search-forward (concat
TeX-grop (LaTeX-environment-name-regexp)
TeX-grcl))
(match-string-no-properties 1))
"document")))