Function: latex-indent

latex-indent is a byte-compiled function defined in tex-mode.el.gz.

Signature

(latex-indent &optional ARG)

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/tex-mode.el.gz
(defun latex-indent (&optional _arg)
  (if (and (eq (get-text-property (if (and (eobp) (bolp))
                                      (max (point-min) (1- (point)))
                                    (line-beginning-position))
                                  'face)
	       'tex-verbatim))
      'noindent
    (with-syntax-table tex-latex-indent-syntax-table
      ;; TODO: Rather than ignore $, we should try to be more clever about it.
      (let ((indent
	     (save-excursion
	       (beginning-of-line)
	       (latex-find-indent))))
	(if (< indent 0) (setq indent 0))
	(if (<= (current-column) (current-indentation))
	    (indent-line-to indent)
	  (save-excursion (indent-line-to indent)))))))