Function: LaTeX-insert-item

LaTeX-insert-item is an interactive and byte-compiled function defined in latex.el.

Signature

(LaTeX-insert-item)

Documentation

Insert a new item in an environment.

You may use LaTeX-item-list to change the routines used to insert the item.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/latex.el
(defun LaTeX-insert-item ()
  "Insert a new item in an environment.
You may use `LaTeX-item-list' to change the routines used to insert the item."
  (declare (modes LaTeX-mode))
  (interactive "*")
  (let ((environment (LaTeX-current-environment)))
    (when (and (TeX-active-mark)
               (> (point) (mark)))
      (exchange-point-and-mark))
    (if (save-excursion
          ;; If the current line has only whitespace characters, put
          ;; the new \item on this line, not creating a new line
          ;; below.
          (goto-char (line-beginning-position))
          (if LaTeX-insert-into-comments
              (re-search-forward
               (concat "\\=" TeX-comment-start-regexp "+")
               (line-end-position) t))
          (looking-at "[ \t]*$"))
        (delete-region (match-beginning 0) (match-end 0))
      (LaTeX-newline))
    (if (assoc environment LaTeX-item-list)
        (funcall (cdr (assoc environment LaTeX-item-list)))
      (TeX-insert-macro "item"))
    (indent-according-to-mode)))