Function: LaTeX-command-section-boundaries

LaTeX-command-section-boundaries is a byte-compiled function defined in tex.el.

Signature

(LaTeX-command-section-boundaries)

Documentation

Return the boundaries of the current section as (start . end).

The section is determined by LaTeX-command-section-level(var)/LaTeX-command-section-level(fun).

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/tex.el
(defun LaTeX-command-section-boundaries ()
  "Return the boundaries of the current section as (start . end).
The section is determined by `LaTeX-command-section-level'."
  (let* ((case-fold-search nil)
         (rx (concat "\\\\" (regexp-opt
                             (mapcar
                              #'LaTeX-section-name
                              (number-sequence
                               0 (LaTeX-command-section-level))))
                     "\\*?{")))
    (cons (save-excursion
            (re-search-backward rx nil t)
            (point))
          (save-excursion
            (re-search-forward (concat rx "\\|\\\\end{document}") nil t)
            (forward-line 0)
            (point)))))