Function: rst-enumerate-region
rst-enumerate-region is an interactive and byte-compiled function
defined in rst.el.gz.
Signature
(rst-enumerate-region BEG END ALL)
Documentation
Add enumeration to all the leftmost paragraphs in the given region.
The region is specified between BEG and END. With ALL, do all lines instead of just paragraphs.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/rst.el.gz
(defun rst-enumerate-region (beg end all)
"Add enumeration to all the leftmost paragraphs in the given region.
The region is specified between BEG and END. With ALL,
do all lines instead of just paragraphs."
(interactive "r\nP")
(let ((enum 0)
(indent ""))
(rst-apply-indented-blocks
beg end (rst-find-leftmost-column beg end)
(lambda (count in-first in-sub in-super in-empty _relind)
(cond
(in-empty)
(in-super)
((zerop count))
(in-sub
(insert indent))
((or in-first all)
(let ((tag (format "%d. " (cl-incf enum))))
(setq indent (make-string (length tag) ? ))
(insert tag)))
(t
(insert indent)))
nil))))