Function: reftex-init-section-numbers

reftex-init-section-numbers is an autoloaded and byte-compiled function defined in reftex-parse.el.gz.

Signature

(reftex-init-section-numbers &optional TOC-ENTRY APPENDIX)

Documentation

Initialize section numbers with zeros or with what is found in the TOC-ENTRY.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/reftex-parse.el.gz
;;;###autoload
(defun reftex-init-section-numbers (&optional toc-entry appendix)
  "Initialize section numbers with zeros or with what is found in the TOC-ENTRY."
  (let* ((level  (or (nth 5 toc-entry) -1))
         (numbers (nreverse (split-string (or (nth 6 toc-entry) "") "\\.")))
         (depth (1- (length reftex-section-numbers)))
         (i depth) number-string)
    (while (>= i 0)
      (if (> i level)
          (aset reftex-section-numbers i 0)
        (setq number-string (or (car numbers) "0"))
        (if (string-match "\\`[A-Z]\\'" number-string)
            (aset reftex-section-numbers i
                  (- (string-to-char number-string) ?A -1))
            (aset reftex-section-numbers i (string-to-number number-string)))
        (pop numbers))
      (decf i)))
  (put 'reftex-section-numbers 'appendix appendix))