Function: LaTeX-current-indentation
LaTeX-current-indentation is a byte-compiled function defined in
latex.el.
Signature
(LaTeX-current-indentation &optional FORCE-TYPE)
Documentation
Return the indentation of a line.
FORCE-TYPE can be used to force the calculation of an inner or
outer indentation in case of a commented line. The symbols
inner and outer are recognized.
Source Code
;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/latex.el
(defun LaTeX-current-indentation (&optional force-type)
"Return the indentation of a line.
FORCE-TYPE can be used to force the calculation of an inner or
outer indentation in case of a commented line. The symbols
`inner' and `outer' are recognized."
(if (and fill-prefix
(or (and force-type
(eq force-type 'inner))
(and (not force-type)
(or
;; If `LaTeX-syntactic-comments' is not enabled,
;; do conventional indentation
LaTeX-syntactic-comments
;; Line comments in `docTeX-mode' are always
;; indented syntax-aware so we need their inner
;; indentation.
(and (TeX-in-line-comment)
(eq major-mode 'docTeX-mode))))))
;; INNER indentation
(save-excursion
(beginning-of-line)
(looking-at (concat "\\(?:[ \t]*" TeX-comment-start-regexp "+\\)+"
"\\([ \t]*\\)"))
(- (length (match-string 1)) (length (TeX-comment-padding-string))))
;; OUTER indentation
(current-indentation)))